You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
## FluentAssertions.Web
2
-
This is a [*FluentAssertions*](https://fluentassertions.com/) extension over the *HttpResponseMessage* object.
2
+
This is a [*FluentAssertions*](https://fluentassertions.com/)and [*AwesomeAssertions*](https://awesomeassertions.org//)extension over the *HttpResponseMessage* object.
3
3
4
-
It provides assertions specific to HTTP responses and outputs rich erros messages when the tests fail, so less time with debugging is spent.
4
+
It provides assertions specific to HTTP responses and outputs rich errors messages when the tests fail, so less time with debugging is spent.
5
5
6
6
```csharp
7
7
[Fact]
@@ -33,7 +33,7 @@ Thus this library solves two problems:
33
33
34
34
##### Focus on the Assert part and not on the HttpClient related APIs, neither on the response deserialization
35
35
36
-
Once the response is ready you'll want to assert it. With first level properties like `StatusCode` is somehow easy, especially with FluentAssertions, but often we need more, like to deserialize the content into an object of a certain type and then to Assert it. Or to simply assert something about the response content itself. Soon duplication code occurs and the urge to reduce it is just the next logical step.
36
+
Once the response is ready you'll want to assert it. With first level properties like `StatusCode` is somehow easy, especially with FluentAssertions/AwesomeAssertions, but often we need more, like to deserialize the content into an object of a certain type and then to Assert it. Or to simply assert something about the response content itself. Soon duplication code occurs and the urge to reduce it is just the next logical step.
37
37
38
38
##### Debugging failed tests interrupts the programmer's flow state
39
39
When a test is failing, the following actions are taken most of the time:
@@ -65,6 +65,12 @@ If you are using FluentAssertions >= 8.0.0
65
65
dotnet add package FluentAssertions.Web.v8
66
66
```
67
67
68
+
If you are using AwesomeAssertions >= 8.0.0
69
+
70
+
```
71
+
dotnet add package AwesomeAssertions.Web
72
+
```
73
+
68
74
### FluentAssertions.Web Examples
69
75
70
76
- Asserting that the response content of a HTTP POST request is equivalent to a certain object
@@ -232,7 +238,8 @@ The change must be done before the test is run and this depends on the testing f
232
238
233
239
#### Newtonsoft.Json
234
240
235
-
The serializer itself is replaceable, so you can implement your own, by implementing the `ISerialize` interface. The serializer is shipped via the **FluentAssertions.Web.Serializers.NewtonsoftJson** package.
241
+
The serializer itself is replaceable, so you can implement your own, by implementing the `ISerialize` interface.
242
+
The serializer is shipped via the **FluentAssertions.Web.Serializers.NewtonsoftJson** and **AwesomeAssertions.Web.Serializers.NewtonsoftJson** package.
The related `Newtonsoft.Json.JsonSerializerSetttings` used to configure the Newtonsoft.Json serializer is accesible via the `NewtonsoftJsonSerializerConfig.Options` static field. So if you want to add a custom converter, then the related setting is changed like this:
0 commit comments