Skip to content

Commit 8b35d48

Browse files
authored
Remove TestableHttpClient.NFluent (#188)
1 parent 06172d8 commit 8b35d48

34 files changed

+9
-2053
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1010

1111
### Removed
1212
- Official support for .NET Core 3.1 has been removed. This means we no longer provide a specific version for .NET Core 3.0 and we no longer test this version explicitly. Since we support .NET Standard 2.0, the library could still be used.
13+
- TestableHttpClient.NFluent has been moved to it's own repository.
1314

1415
### Added
1516
- Added `Responses.Route` that allows changing the response based on the url. The url supports patterns.

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
<ItemGroup Condition="'$(IsTestProject)' == 'false'">
3535
<None Include="$(MSBuildThisFileDirectory)/images/icon.png" Pack="true" PackagePath="" />
3636
<None Include="$(MSBuildThisFileDirectory)/LICENSE.md" Pack="true" PackagePath="" />
37-
<None Include="$(MSBuildProjectDirectory)/README.md" Pack="true" PackagePath="" />
37+
<None Include="$(MSBuildThisFileDirectory)/README.md" Pack="true" PackagePath="" />
3838
</ItemGroup>
3939
</Project>

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 David Perfors
3+
Copyright (c) 2020-2022 David Perfors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,13 @@
22

33
![GitHub](https://img.shields.io/github/license/testablehttpclient/TestableHttpClient) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/testablehttpclient/TestableHttpClient/CI)
44

5-
Using HttpClient in code that is unit tested is seen as rather difficult, these libraries aims to make it easier to assert the calls that are made via an HttpClient and to make assertions on the HttpResponseMessages.
6-
7-
This repository contains multiple related libraries. The separation is mainly made in order to separate dependencies and not to force a specific library to the user.
8-
9-
|Libary|Description|Main dependency|Nuget|
10-
|------|-----------|---------------|-----|
11-
|TestableHttpClient|Basic library for mocking HttpMessageHandler and to make manual assertions on HttpResponseMessage.|None|![Nuget](https://img.shields.io/nuget/v/TestableHttpClient)|
12-
|TestableHttpClient.NFluent|Library containing [NFluent](https://github.com/tpierrain/NFluent) checks for HttpResponseMessage and TestableHttpMessageHandler.|NFluent|![Nuget](https://img.shields.io/nuget/v/TestableHttpClient.NFluent)|
5+
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.
136

147
## How to install
158

16-
The libraries are released as a NuGet packages and can be installed via the NuGet manager in Visual Studio or by running one of the following commands:
17-
9+
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:
1810
```
1911
dotnet add package TestableHttpClient
20-
dotnet add package TestableHttpClient.NFluent
2112
```
2213

2314
## How to use TestableHttpClient
@@ -33,27 +24,6 @@ testHandler.ShouldHaveMadeRequestsTo("https://httpbin.org/*");
3324

3425
More examples can be found in the [IntegrationTests project](test/TestableHttpClient.IntegrationTests)
3526

36-
## How to use TestableHttpClient.NFluent to test responses
37-
38-
```csharp
39-
var client = new HttpClient();
40-
41-
var result = await httpClient.GetAsync("https://httpbin.org/status/200");
42-
43-
Check.That(result).HasStatusCode(HttpStatusCode.OK).And.HasContentHeader("Content-Type", "*/json*");
44-
```
45-
46-
## How to use TestableHttpClient.NFluent to which requests are made
47-
48-
```csharp
49-
var testHandler = new TestableHttpMessageHandler();
50-
var httpClient = new HttpClient(testHandler); // or testHandler.CreateClient();
51-
52-
var result = await httpClient.GetAsync("http://httpbin.org/status/200");
53-
54-
Check.That(testHandler).HasMadeRequestsTo("https://httpbin.org/*");
55-
```
56-
5727
## Supported .NET versions
5828

5929
TestableHttpClient is build as a netstandard2.0 library, so theoretically it can work on every .NET version that support netstandard2.0.

TestableHttpClient.sln

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2222
EndProject
2323
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestableHttpClient.IntegrationTests", "test\TestableHttpClient.IntegrationTests\TestableHttpClient.IntegrationTests.csproj", "{37A6C1C0-1117-43DE-BD15-290BC8AD32BE}"
2424
EndProject
25-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestableHttpClient.NFluent", "src\TestableHttpClient.NFluent\TestableHttpClient.NFluent.csproj", "{127E2F48-CB33-488E-88E3-1BB0043C8CC1}"
26-
EndProject
27-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestableHttpClient.NFluent.Tests", "test\TestableHttpClient.NFluent.Tests\TestableHttpClient.NFluent.Tests.csproj", "{29F350FB-5901-41AC-8605-F3413EE49E4A}"
28-
EndProject
2925
Global
3026
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3127
Debug|Any CPU = Debug|Any CPU
@@ -72,30 +68,6 @@ Global
7268
{37A6C1C0-1117-43DE-BD15-290BC8AD32BE}.Release|x64.Build.0 = Release|Any CPU
7369
{37A6C1C0-1117-43DE-BD15-290BC8AD32BE}.Release|x86.ActiveCfg = Release|Any CPU
7470
{37A6C1C0-1117-43DE-BD15-290BC8AD32BE}.Release|x86.Build.0 = Release|Any CPU
75-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
76-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
77-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Debug|x64.ActiveCfg = Debug|Any CPU
78-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Debug|x64.Build.0 = Debug|Any CPU
79-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Debug|x86.ActiveCfg = Debug|Any CPU
80-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Debug|x86.Build.0 = Debug|Any CPU
81-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
82-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Release|Any CPU.Build.0 = Release|Any CPU
83-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Release|x64.ActiveCfg = Release|Any CPU
84-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Release|x64.Build.0 = Release|Any CPU
85-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Release|x86.ActiveCfg = Release|Any CPU
86-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1}.Release|x86.Build.0 = Release|Any CPU
87-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
88-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
89-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Debug|x64.ActiveCfg = Debug|Any CPU
90-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Debug|x64.Build.0 = Debug|Any CPU
91-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Debug|x86.ActiveCfg = Debug|Any CPU
92-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Debug|x86.Build.0 = Debug|Any CPU
93-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
94-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Release|Any CPU.Build.0 = Release|Any CPU
95-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Release|x64.ActiveCfg = Release|Any CPU
96-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Release|x64.Build.0 = Release|Any CPU
97-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Release|x86.ActiveCfg = Release|Any CPU
98-
{29F350FB-5901-41AC-8605-F3413EE49E4A}.Release|x86.Build.0 = Release|Any CPU
9971
EndGlobalSection
10072
GlobalSection(SolutionProperties) = preSolution
10173
HideSolutionNode = FALSE
@@ -104,8 +76,6 @@ Global
10476
{FD5111E1-2970-4DC4-84DD-E4966E17DCB3} = {4C8914F8-D732-462B-978E-3BB5DBE547D7}
10577
{70673E72-C346-4AC2-946D-D9F99816FC72} = {BBCED492-E92B-4FA8-A4A5-B5A76091F25E}
10678
{37A6C1C0-1117-43DE-BD15-290BC8AD32BE} = {BBCED492-E92B-4FA8-A4A5-B5A76091F25E}
107-
{127E2F48-CB33-488E-88E3-1BB0043C8CC1} = {4C8914F8-D732-462B-978E-3BB5DBE547D7}
108-
{29F350FB-5901-41AC-8605-F3413EE49E4A} = {BBCED492-E92B-4FA8-A4A5-B5A76091F25E}
10979
EndGlobalSection
11080
GlobalSection(ExtensibilityGlobals) = postSolution
11181
SolutionGuid = {CD31CAB7-6661-4E80-9A70-BC8BA6B9B764}

src/TestableHttpClient.NFluent/AssemblyInfo.cs

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/TestableHttpClient.NFluent/FluentHttpRequestMessagesChecks.cs

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/TestableHttpClient.NFluent/GlobalUsings.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/TestableHttpClient.NFluent/Header.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)