8000 Added support for AwesomeAssertions fork by msmolka · Pull Request #144 · adrianiftode/FluentAssertions.Web · GitHub
[go: up one dir, main page]

Skip to content

Added support for AwesomeAssertions fork #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="AwesomeAssertions" Version="9.0.0" />
<PackageVersion Include="AwesomeAssertions.Analyzers" Version="9.0.0" />
</ItemGroup>

</Project>
49 changes: 49 additions & 0 deletions FluentAssertions.Web.sln
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Web.v8.Tes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Web.Types", "src\FluentAssertions.Web.Types\FluentAssertions.Web.Types.csproj", "{455E5F41-B678-4286-BB4D-FC232D08CAC0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwesomeAssertions.Web", "src\AwesomeAssertions.Web\AwesomeAssertions.Web.csproj", "{54EF3A12-DB43-48C4-A64C-97D2B62E3C2E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwesomeAssertions.Web.Types", "src\AwesomeAssertions.Web.Types\AwesomeAssertions.Web.Types.csproj", "{418ADD1B-EA19-4EAE-95DE-5ED327BC4E9E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwesomeAssertions.Web.Serializers.NewtonsoftJson", "src\AwesomeAssertions.Web.Serializers.NewtonsoftJson\AwesomeAssertions.Web.Serializers.NewtonsoftJson.csproj", "{79495BD6-C628-42E9-8147-990B8112F377}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwesomeAssertions.Web.Tests", "test\AwesomeAssertions.Web.Tests\AwesomeAssertions.Web.Tests.csproj", "{BBBB8E66-221B-4D89-A942-E63BC7C64C94}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwesomeAssertions.Web.Serializers.NewtonsoftJson.Tests", "test\AwesomeAssertions.Web.Serializers.NewtonsoftJson.Tests\AwesomeAssertions.Web.Serializers.NewtonsoftJson.Tests.csproj", "{1455C2AB-9EE2-4C4B-96AC-B030EB06928C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwesomeAssertions.Web.AwesomeAssertionsWebConfig.Tests", "test\AwesomeAssertions.Web.AwesomeAssertionsWebConfig.Tests\AwesomeAssertions.Web.AwesomeAssertionsWebConfig.Tests.csproj", "{E2EC106A-42E7-448F-85F5-85FB07BA2AC1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Api.AwesomeAssertions.Tests", "test\Sample.Api.AwesomeAssertions.Tests\Sample.Api.AwesomeAssertions.Tests.csproj", "{2D38D734-43BF-423C-9CED-8484B5141E85}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -108,6 +122,34 @@ Global
{455E5F41-B678-4286-BB4D-FC232D08CAC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{455E5F41-B678-4286-BB4D-FC232D08CAC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{455E5F41-B678-4286-BB4D-FC232D08CAC0}.Release|Any CPU.Build.0 = Release|Any CPU
{54EF3A12-DB43-48C4-A64C-97D2B62E3C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54EF3A12-DB43-48C4-A64C-97D2B62E3C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54EF3A12-DB43-48C4-A64C-97D2B62E3C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54EF3A12-DB43-48C4-A64C-97D2B62E3C2E}.Release|Any CPU.Build.0 = Release|Any CPU
{418ADD1B-EA19-4EAE-95DE-5ED327BC4E9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{418ADD1B-EA19-4EAE-95DE-5ED327BC4E9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{418ADD1B-EA19-4EAE-95DE-5ED327BC4E9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{418ADD1B-EA19-4EAE-95DE-5ED327BC4E9E}.Release|Any CPU.Build.0 = Release|Any CPU
{79495BD6-C628-42E9-8147-990B8112F377}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79495BD6-C628-42E9-8147-990B8112F377}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79495BD6-C628-42E9-8147-990B8112F377}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79495BD6-C628-42E9-8147-990B8112F377}.Release|Any CPU.Build.0 = Release|Any CPU
{BBBB8E66-221B-4D89-A942-E63BC7C64C94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BBBB8E66-221B-4D89-A942-E63BC7C64C94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BBBB8E66-221B-4D89-A942-E63BC7C64C94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BBBB8E66-221B-4D89-A942-E63BC7C64C94}.Release|Any CPU.Build.0 = Release|Any CPU
{1455C2AB-9EE2-4C4B-96AC-B030EB06928C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1455C2AB-9EE2-4C4B-96AC-B030EB06928C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1455C2AB-9EE2-4C4B-96AC-B030EB06928C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1455C2AB-9EE2-4C4B-96AC-B030EB06928C}.Release|Any CPU.Build.0 = Release|Any CPU
{E2EC106A-42E7-448F-85F5-85FB07BA2AC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2EC106A-42E7-448F-85F5-85FB07BA2AC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2EC106A-42E7-448F-85F5-85FB07BA2AC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2EC106A-42E7-448F-85F5-85FB07BA2AC1}.Release|Any CPU.Build.0 = Release|Any CPU
{2D38D734-43BF-423C-9CED-8484B5141E85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D38D734-43BF-423C-9CED-8484B5141E85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D38D734-43BF-423C-9CED-8484B5141E85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D38D734-43BF-423C-9CED-8484B5141E85}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -126,6 +168,13 @@ Global
{EBB6D06F-B87F-4BDA-8F1B-A6E88C96C2E1} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
{056E517C-F644-4B8A-9494-09276E6E3C6B} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
{455E5F41-B678-4286-BB4D-FC232D08CAC0} = {14FDD52D-B83A-445B-BD2F-04B3E7B8033C}
{54EF3A12-DB43-48C4-A64C-97D2B62E3C2E} = {14FDD52D-B83A-445B-BD2F-04B3E7B8033C}
{418ADD1B-EA19-4EAE-95DE-5ED327BC4E9E} = {14FDD52D-B83A-445B-BD2F-04B3E7B8033C}
{79495BD6-C628-42E9-8147-990B8112F377} = {14FDD52D-B83A-445B-BD2F-04B3E7B8033C}
{BBBB8E66-221B-4D89-A942-E63BC7C64C94} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
{1455C2AB-9EE2-4C4B-96AC-B030EB06928C} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
{E2EC106A-42E7-448F-85F5-85FB07BA2AC1} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
{2D38D734-43BF-423C-9CED-8484B5141E85} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {81F41C75-2F8A-4E70-BA17-38146C4BB6E6}
Expand Down
21 changes: 17 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## FluentAssertions.Web
This is a [*FluentAssertions*](https://fluentassertions.com/) extension over the *HttpResponseMessage* object.
This is a [*FluentAssertions*](https://fluentassertions.com/) and [*AwesomeAssertions*](https://awesomeassertions.org//) extension over the *HttpResponseMessage* object.

It provides assertions specific to HTTP responses and outputs rich erros messages when the tests fail, so less time with debugging is spent.
It provides assertions specific to HTTP responses and outputs rich errors messages when the tests fail, so less time with debugging is spent.

```csharp
[Fact]
Expand Down Expand Up @@ -33,7 +33,7 @@ Thus this library solves two problems:

##### Focus on the Assert part and not on the HttpClient related APIs, neither on the response deserialization

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.
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.

##### Debugging failed tests interrupts the programmer's flow state
When a test is failing, the following actions are taken most of the time:
Expand Down Expand Up @@ -65,6 +65,12 @@ If you are using FluentAssertions >= 8.0.0
dotnet add package FluentAssertions.Web.v8
```

If you are using AwesomeAssertions >= 8.0.0

```
dotnet add package AwesomeAssertions.Web
```

### FluentAssertions.Web Examples

- Asserting that the response content of a HTTP POST request is equivalent to a certain object
Expand Down Expand Up @@ -232,7 +238,8 @@ The change must be done before the test is run and this depends on the testing f

#### Newtonsoft.Json

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.
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** and **AwesomeAssertions.Web.Serializers.NewtonsoftJson** package.

[![NuGet](https://img.shields.io/nuget/v/FluentAssertions.Web.Serializers.NewtonsoftJson.svg)](https://www.nuget.org/packages/FluentAssertions.Web.Serializers.NewtonsoftJson)

Expand All @@ -242,6 +249,12 @@ To set the default serializer to **Newtonsoft.Json** one, use the following conf
```csharp
FluentAssertionsWebConfig.Serializer = new NewtonsoftJsonSerializer();

```
or

```csharp
AwesomeAssertionsWebConfig.Serializer = new NewtonsoftJsonSerializer();

```

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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageDescription>
NewtonsoftJson based serializer for AwesomeAssertions.Web
</PackageDescription>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);AAV</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AwesomeAssertions.Web.Types\AwesomeAssertions.Web.Types.csproj" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\FluentAssertions.Web.Serializers.NewtonsoftJson\**\*.*" Exclude="**\bin\**;**\obj\**;**\Properties\**;**\*.csproj">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<PackagePath>$(ContentTargetFolders)\src\%RecursiveDir%</PackagePath>
</Compile>
</ItemGroup>

<PropertyGroup>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>

<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="BuildOnlySettings;ResolveReferences">
<ItemGroup>
<!-- Filter out unnecessary files -->
<_ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')->WithMetadataValue('PrivateAssets', 'all'))"/>
</ItemGroup>

<!-- Print batches for debug purposes -->
<Message Text="Batch for .nupkg: ReferenceCopyLocalPaths = @(_ReferenceCopyLocalPaths), ReferenceCopyLocalPaths.DestinationSubDirectory = %(_ReferenceCopyLocalPaths.DestinationSubDirectory) Filename = %(_ReferenceCopyLocalPaths.Filename) Extension = %(_ReferenceCopyLocalPaths.Extension)" Importance="High" Condition="'@(_ReferenceCopyLocalPaths)' != ''" />

<ItemGroup>
<!-- Add file to package with consideration of sub folder. If empty, the root folder is chosen. -->
<BuildOutputInPackage Include="@(_ReferenceCopyLocalPaths)" TargetPath="%(_ReferenceCopyLocalPaths.DestinationSubDirectory)"/>
</ItemGroup>
</Target>



</Project>
22 changes: 22 additions & 0 deletions src/AwesomeAssertions.Web.Types/AwesomeAssertions.Web.Types.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);AAV</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\FluentAssertions.Web.Types\**\*.*" Exclude="**\bin\**;**\obj\**;**\Properties\**;**\*.csproj;**\GlobalUsings.cs">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<PackagePath>$(ContentTargetFolders)\src\%RecursiveDir%</PackagePath>
</Compile>
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions src/AwesomeAssertions.Web.Types/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
global using AwesomeAssertions.Web.Internal.Serializers;
global using System;
global using System.IO;
global using System.Text.Json;
global using System.Threading.Tasks;
4 changes: 4 additions & 0 deletions src/AwesomeAssertions.Web.Types/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("AwesomeAssertions.Web.Tests")]
[assembly: InternalsVisibleTo("AwesomeAssertions.Web.AwesomeAssertionsWebConfig.Tests")]
55 changes: 55 additions & 0 deletions src/AwesomeAssertions.Web/AwesomeAssertions.Web.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageDescription>
This is a AwesomeAssertions extension over the HttpResponseMessage object.
It provides specific assertions and outputs rich erros messages that include the HTTP Request and Response.
</PackageDescription>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);FAV8;AAV</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AwesomeAssertions"/>
<PackageReference Include="System.Text.Json" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AwesomeAssertions.Web.Types\AwesomeAssertions.Web.Types.csproj" PrivateAssets="all"/>
</ItemGroup>

<ItemGroup>
<None Include="../../readme.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\FluentAssertions.Web\**\*.*" Exclude="**\bin\**;**\obj\**;**\Properties\**;**\*.csproj;**\GlobalUsings.cs">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<PackagePath>$(ContentTargetFolders)\src\%RecursiveDir%</PackagePath>
</Compile>
</ItemGroup>

<PropertyGroup>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>

<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="BuildOnlySettings;ResolveReferences">
<ItemGroup>
<!-- Filter out unnecessary files -->
<_ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')-&gt;WithMetadataValue('PrivateAssets', 'all'))" />
</ItemGroup>

<!-- Print batches for debug purposes -->
<Message Text="Batch for .nupkg: ReferenceCopyLocalPaths = @(_ReferenceCopyLocalPaths), ReferenceCopyLocalPaths.DestinationSubDirectory = %(_ReferenceCopyLocalPaths.DestinationSubDirectory) Filename = %(_ReferenceCopyLocalPaths.Filename) Extension = %(_ReferenceCopyLocalPaths.Extension)" Importance="High" Condition="'@(_ReferenceCopyLocalPaths)' != ''" />

<ItemGroup>
<!-- Add file to package with consideration of sub folder. If empty, the root folder is chosen. -->
<BuildOutputInPackage Include="@(_ReferenceCopyLocalPaths)" TargetPath="%(_ReferenceCopyLocalPaths.DestinationSubDirectory)" />
</ItemGroup>
</Target>

</Project>
13 changes: 13 additions & 0 deletions src/AwesomeAssertions.Web/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
global using AwesomeAssertions.Equivalency;
global using AwesomeAssertions.Execution;
global using AwesomeAssertions.Web;
global using AwesomeAssertions.Web.Internal;
global using System;
global using System.Collections.Generic;
global using System.Diagnostics;
global using System.IO;
global using System.Linq;
global using System.Net;
global using System.Net.Http;
global using System.Text.Json;
global using System.Threading.Tasks;
3 changes: 3 additions & 0 deletions src/AwesomeAssertions.Web/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("AwesomeAssertions.Web.Tests")]
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<PropertyGroup>
<Authors>Adrian Iftode</Authors>
<PackageTags>fluentassertions;httpresponsemessage;fluentassertionsweb;unit;unittest;integration;integrationtest;functionaltest</PackageTags>
<PackageTags>fluentassertions;awesomeassertions;httpresponsemessage;fluentassertionsweb;awesomeassertionsweb;unit;unittest;integration;integrationtest;functionaltest</PackageTags>
<VersionPrefix>1.1.0</VersionPrefix>
<PackageProjectUrl>https://github.com/adrianiftode/FluentAssertions.Web</PackageProjectUrl>
<RepositoryUrl>https://github.com/adrianiftode/FluentAssertions.Web</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// ReSharper disable once CheckNamespace
#if AAV
namespace AwesomeAssertions;
#else
namespace FluentAssertions;
#endif

/// <summary>
/// Newtonsoft.Json based serializer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// ReSharper disable once CheckNamespace
#if AAV
namespace AwesomeAssertions;
#else
namespace FluentAssertions;
#endif

/// <summary>
/// Holder of the global <see cref="Newtonsoft.Json.JsonSerializerSettings"/>
Expand Down
4 changes: 4 additions & 0 deletions src/FluentAssertions.Web.Types/DeserializationException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
using System;
using System.Runtime.Serialization;

#if AAV
namespace AwesomeAssertions;
#else
namespace FluentAssertions;
#endif

/// <summary>
/// Captures serialization exceptions.
Expand Down
15 changes: 15 additions & 0 deletions src/FluentAssertions.Web.Types/FluentAssertionsWebConfig.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
// ReSharper disable once CheckNamespace
#if AAV
namespace AwesomeAssertions;
#else
namespace FluentAssertions;
#endif

#if AAV
/// <summary>
/// Holder of the global <see cref="AwesomeAssertionsWebConfig"/>
/// </summary>
public static class AwesomeAssertionsWebConfig
#else
/// <summary>
/// Holder of the global <see cref="FluentAssertionsWebConfig"/>
/// </summary>
public static class FluentAssertionsWebConfig
#endif
{
private static ISerializer? _serializer;

#if AAV
static AwesomeAssertionsWebConfig() => Serializer = new SystemTextJsonSerializer();
#else
static FluentAssertionsWebConfig() => Serializer = new SystemTextJsonSerializer();
#endif

/// <summary>
/// The serializer instance used to deserialize the responses into a model of a specified typed
Expand Down
4 changes: 4 additions & 0 deletions src/FluentAssertions.Web.Types/ISerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
using System.IO;
using System.Threading.Tasks;

#if AAV
namespace AwesomeAssertions;
#else
namespace FluentAssertions;
#endif

/// <summary>
/// Provides an abstraction to deserialize a Stream of binary data into a C# object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
using System.Reflection;
using System.Text.Json.Serialization;

#if AAV
namespace AwesomeAssertions.Web.Internal.Serializers;
#else
namespace FluentAssertions.Web.Internal.Serializers;
#endif

internal class SystemTextJsonSerializer : ISerializer
{
Expand Down
Loading
0