Skip to content

Commit 268dc73

Browse files
authored
Add release process documentation
1 parent 4091f70 commit 268dc73

File tree

6 files changed

+121
-6
lines changed

6 files changed

+121
-6
lines changed

Directory.Build.props

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
<LangVersion>8.0</LangVersion>
44
<Nullable>enable</Nullable>
55
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
6-
<IncludeSymbols>true</IncludeSymbols>
7-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
86
<Version>0.0.1</Version>
7+
<PackageProjectUrl>https://github.com/dnperfors/TestableHttpClient</PackageProjectUrl>
8+
</PropertyGroup>
9+
10+
<PropertyGroup>
911
<Authors>David Perfors</Authors>
10-
<Product />
1112
<Copyright>Copyright (c) 2020 David Perfors</Copyright>
12-
<Description>A simple library to make testing HttpClient and related classes easier.</Description>
13-
<PackageProjectUrl>https://github.com/dnperfors/TestableHttpClient</PackageProjectUrl>
13+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
14+
<DevelopmentDependency>false</DevelopmentDependency>
15+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
16+
<IncludeSymbols>true</IncludeSymbols>
17+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
18+
<IncludeSource>true</IncludeSource>
1419
<RepositoryUrl>https://github.com/dnperfors/TestableHttpClient</RepositoryUrl>
15-
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
20+
<RepositoryType>git</RepositoryType>
1621
</PropertyGroup>
1722

1823
<ItemGroup>

docs/release-process.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# TestableHttpClient release process
2+
3+
This document describes how we release our libraries, how we version the libraries and how to describe changes for the libraries.
4+
5+
## NuGet packages
6+
7+
Every library that is release should generate a NuGet package via the `dotnet pack` command. This is currently done via the `dotnetcore` workflow on github. The packages are published as soon as a git tag is created.
8+
9+
All information for the package is described in either the `Directory.Build.props` files in the root directory, or in the `.csproj` file of the library itself.
10+
11+
The documentation for the specific library should be placed in a `README.md` file next to the `.csproj` file from that library. This way it is easier to update the documentation of the package on nuget.org.
12+
13+
## Changelog
14+
15+
Currently no official changelog is kept. The changelog described in the github release is manually created based on the commits since the last release.
16+
17+
For every release a milestone is created and all issues and PullRequests are linked to the milestone where they will appear in. This can than act as the official changelog.
18+
19+
Note that we currently don't use the changelog functionality of nuget itself, to prevent merge conflicts when multiple PR's need to be merged.
20+
21+
## Versioning
22+
23+
All packages in this repository use the same version, mainly because the libraries are meant as framework specific extensions of the `TestableHttpClient` library. Therefore it would only lead to confusion when version numbers differ from each other.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# TestableHttpClient.NFluent
2+
3+
In integration tests, asserting HttpResponseMessages can be a real challenge, especially since error messages are sometimes not very clear. NFluent is known for giving clear error messages and `TestableHttpClient.NFluent` is designed to easily verify HttpResponseMessages and give clear error messages.
4+
5+
For example when the following check fails:
6+
```c#
7+
Check.That(response).HasResponseHeader("Server");
8+
```
9+
it will return the following message:
10+
```
11+
The checked response's headers does not contain the expected header.
12+
The checked response's headers:
13+
{"Connection"} (1 item)
14+
The expected header:
15+
["Server"]
16+
```
17+
18+
## How to install
19+
20+
TestableHttpClient.NFluent is released as a NuGet packages and can be installed via the NuGet manager in VisualStudio or by running the following command on the command line:
21+
```
22+
dotnet add package TestableHttpClient.NFluent
23+
```
24+
25+
## How to use
26+
27+
```c#
28+
var client = new HttpClient();
29+
30+
var result = await httpClient.GetAsync("https://httpbin.org/status/200");
31+
32+
Check.That(result).HasStatusCode(HttpStatusCode.OK).And.HasContentHeader("Content-Type", "*/json*");
33+
```
34+
35+
## Authors
36+
37+
* **David Perfors** - [dnperfors](https://github.com/dnperfors)
38+
39+
See also the list of [contributors](https://github.com/dnperfors/TestableHttpClient/contributors) who participated in this project.
40+
41+
## License
42+
43+
This project is released under the MIT license, see [LICENSE.md](LICENSE.md) for more information.

src/TestableHttpClient.NFluent/TestableHttpClient.NFluent.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5+
6+
<Description>NFluent checks for checking HttpResponseMessages.</Description>
7+
<PackageTags>httpclient;unittesting;dotnet;nfluent</PackageTags>
58
</PropertyGroup>
69

710
<ItemGroup>

src/TestableHttpClient/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# TestableHttpClient
2+
3+
Creating unittest for code that uses `HttpClient` can be difficult to test. It requires a custom HttpMessageHandler or a mocked version. TestableHttpClient provides a testable version of HttpMessageHandler and several helper functions to configure the `TestableHttpHandler` and several ways to assert which requests were made.
4+
5+
## Howto install
6+
7+
TestableHttpClient is released as a NuGet packages and can be installed via the NuGet manager in VisualStudio or by running the following command on the command line:
8+
```
9+
dotnet add package TestableHttpClient
10+
```
11+
12+
## How to use
13+
14+
```c#
15+
var testHandler = new TestableHttpMessageHandler();
16+
var httpClient = new HttpClient(testHandler);
17+
18+
var result = await httpClient.GetAsync("http://httpbin.org/status/200");
19+
20+
testHandler.ShouldHaveMadeRequestsTo("https://httpbin.org/*");
21+
```
22+
23+
More examples can be found in the [IntegrationTests project](test/TestableHttpClient.IntegrationTests)
24+
25+
## Authors
26+
27+
* **David Perfors** - [dnperfors](https://github.com/dnperfors)
28+
29+
See also the list of [contributors](https://github.com/dnperfors/TestableHttpClient/contributors) who participated in this project.
30+
31+
## License
32+
33+
This project is released under the MIT license, see [LICENSE.md](LICENSE.md) for more information.
34+
35+
## Acknowledgments
36+
37+
This library is largely inspired by the HttpTest functionality from [Flurl](https://flurl.dev).
38+
A lot of the ideas came from the thread about unit testing HttpClient code in [this dotnet issue](https://github.com/dotnet/runtime/issues/14535).

src/TestableHttpClient/TestableHttpClient.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5+
6+
<Description>A simple library to make testing HttpClient and related classes easier.</Description>
7+
<PackageTags>httpclient;unittesting;dotnet;mock</PackageTags>
58
</PropertyGroup>
69

710
<ItemGroup>

0 commit comments

Comments
 (0)