diff --git a/Directory.Packages.props b/Directory.Packages.props
new file mode 100644
index 0000000..f7104a7
--- /dev/null
+++ b/Directory.Packages.props
@@ -0,0 +1,22 @@
+
+
+
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FluentAssertions.Web.sln b/FluentAssertions.Web.sln
index 4e9727d..2d2fc1d 100644
--- a/FluentAssertions.Web.sln
+++ b/FluentAssertions.Web.sln
@@ -4,35 +4,38 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.2.32630.192
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{14FDD52D-B83A-445B-BD2F-04B3E7B8033C}"
+ ProjectSection(SolutionItems) = preProject
+ src\Directory.Build.props = src\Directory.Build.props
+ EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{BFF7517A-C9EA-458D-829E-28A10F8D61BF}"
+ ProjectSection(SolutionItems) = preProject
+ test\Directory.Build.props = test\Directory.Build.props
+ EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Web.Tests", "test\FluentAssertions.Web.Tests\FluentAssertions.Web.Tests.csproj", "{313919D0-7CE6-4118-A6A2-8963362A338F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Web", "src\FluentAssertions.Web\FluentAssertions.Web.csproj", "{3C892A67-86B1-491F-8BF6-6E782FE4F689}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{B6E9FBF3-AC48-48B0-9CBB-CA260F59CCD9}"
+ ProjectSection(SolutionItems) = preProject
+ samples\Directory.Build.props = samples\Directory.Build.props
+ EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7F2E3E40-CDC2-413A-9527-802DD4973A96}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
appveyor.yml = appveyor.yml
- common.dependencies.props = common.dependencies.props
- common.package.props = common.package.props
- common.props = common.props
- common.tests.props = common.tests.props
+ Directory.Packages.props = Directory.Packages.props
readme.md = readme.md
+ nuget.config = nuget.config
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Api.Net31", "samples\Sample.Api.Net31\Sample.Api.Net31.csproj", "{A62ABBAE-BFB8-467A-9FBC-974172C718E2}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Api.Tests", "samples\Sample.Api.Tests\Sample.Api.Tests.csproj", "{5E7E24A9-A31F-4EBB-A3BA-167B0DD9C37E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Api.Tests", "test\Sample.Api.Tests\Sample.Api.Tests.csproj", "{5E7E24A9-A31F-4EBB-A3BA-167B0DD9C37E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Api.Net60", "samples\Sample.Api.Net60\Sample.Api.Net60.csproj", "{FACC5AED-9978-441D-A359-DCD83F924BF8}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Api.Net50", "samples\Sample.Api.Net50\Sample.Api.Net50.csproj", "{4C9619BF-7ED4-42A3-B25C-15E288264C6F}"
-EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Sample.Api.Shared", "Samples\Sample.Api.Shared\Sample.Api.Shared.shproj", "{815C141D-4504-42B1-A6F7-672C2476A474}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Web.Serializers.NewtonsoftJson", "src\FluentAssertions.Web.Serializers.NewtonsoftJson\FluentAssertions.Web.Serializers.NewtonsoftJson.csproj", "{1BDE8312-1789-40EA-86B2-83784E560740}"
@@ -43,6 +46,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentAssertions.Web.Fluent
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Api.Net70", "samples\Sample.Api.Net70\Sample.Api.Net70.csproj", "{DCC4B007-DCE3-443E-BC9D-635EE367882B}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Api.Net80", "samples\Sample.Api.Net80\Sample.Api.Net80.csproj", "{9B53847C-0D39-46AB-9E39-A2DCA0676D88}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -65,10 +70,6 @@ Global
{FACC5AED-9978-441D-A359-DCD83F924BF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FACC5AED-9978-441D-A359-DCD83F924BF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FACC5AED-9978-441D-A359-DCD83F924BF8}.Release|Any CPU.Build.0 = Release|Any CPU
- {4C9619BF-7ED4-42A3-B25C-15E288264C6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4C9619BF-7ED4-42A3-B25C-15E288264C6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4C9619BF-7ED4-42A3-B25C-15E288264C6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4C9619BF-7ED4-42A3-B25C-15E288264C6F}.Release|Any CPU.Build.0 = Release|Any CPU
{1BDE8312-1789-40EA-86B2-83784E560740}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1BDE8312-1789-40EA-86B2-83784E560740}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1BDE8312-1789-40EA-86B2-83784E560740}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -85,6 +86,10 @@ Global
{DCC4B007-DCE3-443E-BC9D-635EE367882B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCC4B007-DCE3-443E-BC9D-635EE367882B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DCC4B007-DCE3-443E-BC9D-635EE367882B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9B53847C-0D39-46AB-9E39-A2DCA0676D88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9B53847C-0D39-46AB-9E39-A2DCA0676D88}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9B53847C-0D39-46AB-9E39-A2DCA0676D88}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9B53847C-0D39-46AB-9E39-A2DCA0676D88}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -92,14 +97,14 @@ Global
GlobalSection(NestedProjects) = preSolution
{313919D0-7CE6-4118-A6A2-8963362A338F} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
{3C892A67-86B1-491F-8BF6-6E782FE4F689} = {14FDD52D-B83A-445B-BD2F-04B3E7B8033C}
- {5E7E24A9-A31F-4EBB-A3BA-167B0DD9C37E} = {B6E9FBF3-AC48-48B0-9CBB-CA260F59CCD9}
+ {5E7E24A9-A31F-4EBB-A3BA-167B0DD9C37E} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
{FACC5AED-9978-441D-A359-DCD83F924BF8} = {B6E9FBF3-AC48-48B0-9CBB-CA260F59CCD9}
- {4C9619BF-7ED4-42A3-B25C-15E288264C6F} = {B6E9FBF3-AC48-48B0-9CBB-CA260F59CCD9}
{815C141D-4504-42B1-A6F7-672C2476A474} = {B6E9FBF3-AC48-48B0-9CBB-CA260F59CCD9}
{1BDE8312-1789-40EA-86B2-83784E560740} = {14FDD52D-B83A-445B-BD2F-04B3E7B8033C}
{F2C0B6F2-4ACE-4688-8F96-9EB1D5718B60} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
{538479CE-5922-4FF9-A09D-80C9E91FFFF1} = {BFF7517A-C9EA-458D-829E-28A10F8D61BF}
{DCC4B007-DCE3-443E-BC9D-635EE367882B} = {B6E9FBF3-AC48-48B0-9CBB-CA260F59CCD9}
+ {9B53847C-0D39-46AB-9E39-A2DCA0676D88} = {B6E9FBF3-AC48-48B0-9CBB-CA260F59CCD9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {81F41C75-2F8A-4E70-BA17-38146C4BB6E6}
diff --git a/appveyor.yml b/appveyor.yml
index aa9018f..1076f2d 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,4 +1,4 @@
-version: 1.5.0-ci-{build}
+version: 1.6.0-ci-{build}
image: Visual Studio 2022
branches:
only:
diff --git a/common.dependencies.props b/common.dependencies.props
deleted file mode 100644
index aea2976..0000000
--- a/common.dependencies.props
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- 6.5.1
- 5.2.4
- 10.0.1
- 5.0.2
-
-
-
\ No newline at end of file
diff --git a/common.props b/common.props
deleted file mode 100644
index 843169b..0000000
--- a/common.props
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- netstandard2.0
- true
- latest
- enable
- CS8600;CS8602;CS8603
- True
- portable
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/common.tests.props b/common.tests.props
deleted file mode 100644
index 4640ee7..0000000
--- a/common.tests.props
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
- latest
- enable
- CS8600;CS8602;CS8603
- false
-
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers
-
-
-
\ No newline at end of file
diff --git a/nuget.config b/nuget.config
new file mode 100644
index 0000000..fbcef10
--- /dev/null
+++ b/nuget.config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props
new file mode 100644
index 0000000..5d23ce3
--- /dev/null
+++ b/samples/Directory.Build.props
@@ -0,0 +1,10 @@
+
+
+
+ false
+ true
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/samples/Sample.Api.Net50/Sample.Api.Net50.csproj b/samples/Sample.Api.Net50/Sample.Api.Net50.csproj
deleted file mode 100644
index 25488b5..0000000
--- a/samples/Sample.Api.Net50/Sample.Api.Net50.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- net5.0
- true
- false
- false
- false
-
-
-
-
-
diff --git a/samples/Sample.Api.Net60/Sample.Api.Net60.csproj b/samples/Sample.Api.Net60/Sample.Api.Net60.csproj
index aba5aaf..98d784a 100644
--- a/samples/Sample.Api.Net60/Sample.Api.Net60.csproj
+++ b/samples/Sample.Api.Net60/Sample.Api.Net60.csproj
@@ -1,9 +1,7 @@
- net6.0
- true
- false
+ net6.0
diff --git a/samples/Sample.Api.Net70/Sample.Api.Net70.csproj b/samples/Sample.Api.Net70/Sample.Api.Net70.csproj
index c9cfb8c..fd07e20 100644
--- a/samples/Sample.Api.Net70/Sample.Api.Net70.csproj
+++ b/samples/Sample.Api.Net70/Sample.Api.Net70.csproj
@@ -1,9 +1,7 @@
- net7.0
- true
- false
+ net7.0
diff --git a/samples/Sample.Api.Net50/Properties/launchSettings.json b/samples/Sample.Api.Net80/Properties/launchSettings.json
similarity index 58%
rename from samples/Sample.Api.Net50/Properties/launchSettings.json
rename to samples/Sample.Api.Net80/Properties/launchSettings.json
index b51b126..77e49fd 100644
--- a/samples/Sample.Api.Net50/Properties/launchSettings.json
+++ b/samples/Sample.Api.Net80/Properties/launchSettings.json
@@ -1,27 +1,30 @@
-{
+{
+ "$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
"iisExpress": {
- "applicationUrl": "http://localhost:51573/",
- "sslPort": 44315
+ "applicationUrl": "http://localhost:58229",
+ "sslPort": 44366
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
+ "launchUrl": "api/values",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
- "Sample.Api.Net50": {
+ "FluentAssertions.Web.Api": {
"commandName": "Project",
"launchBrowser": true,
+ "launchUrl": "api/values",
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
- },
- "applicationUrl": "https://localhost:5001;http://localhost:5000"
+ }
}
}
}
\ No newline at end of file
diff --git a/samples/Sample.Api.Net80/Sample.Api.Net80.csproj b/samples/Sample.Api.Net80/Sample.Api.Net80.csproj
new file mode 100644
index 0000000..e588fbd
--- /dev/null
+++ b/samples/Sample.Api.Net80/Sample.Api.Net80.csproj
@@ -0,0 +1,9 @@
+
+
+
+ net8.0
+
+
+
+
+
diff --git a/samples/Sample.Api.Shared/Controllers/CommentsController.cs b/samples/Sample.Api.Shared/Controllers/CommentsController.cs
index c554bb0..0034bcf 100644
--- a/samples/Sample.Api.Shared/Controllers/CommentsController.cs
+++ b/samples/Sample.Api.Shared/Controllers/CommentsController.cs
@@ -18,7 +18,7 @@ public IEnumerable Get() => new[]
[HttpGet("{id}")]
public Comment Get(int id)
{
- Response.Headers.Add("x-vendor", "vendor");
+ Response.Headers["x-vendor"] = "vendor";
return new Comment { Author = "Adrian", Content = "Hey", CommentId = id };
}
diff --git a/samples/Sample.Api.Shared/Startup.cs b/samples/Sample.Api.Shared/Startup.cs
index 491d48c..6b4aecd 100644
--- a/samples/Sample.Api.Shared/Startup.cs
+++ b/samples/Sample.Api.Shared/Startup.cs
@@ -5,6 +5,7 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Primitives;
using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
namespace Sample.Api
@@ -39,10 +40,7 @@ IWebHostEnvironment env
context.Response.OnStarting(() =>
{
- if (!context.Response.Headers.ContainsKey(XCorrelationIdHeaderName))
- {
- context.Response.Headers.Add(XCorrelationIdHeaderName, correlationId);
- }
+ context.Response.Headers.TryAdd(XCorrelationIdHeaderName, correlationId);
return Task.CompletedTask;
});
diff --git a/common.package.props b/src/Directory.Build.props
similarity index 59%
rename from common.package.props
rename to src/Directory.Build.props
index ba36903..e008a9a 100644
--- a/common.package.props
+++ b/src/Directory.Build.props
@@ -1,5 +1,15 @@
+
+ netstandard2.0
+ true
+ latest
+ enable
+ CS8600;CS8602;CS8603
+ True
+ portable
+
+
Adrian Iftode
fluentassertions;httpresponsemessage;fluentassertionsweb;unit;unittest;integration;integrationtest;functionaltest
@@ -10,4 +20,8 @@
True
+
+
+
+
\ No newline at end of file
diff --git a/src/FluentAssertions.Web.Serializers.NewtonsoftJson/FluentAssertions.Web.Serializers.NewtonsoftJson.csproj b/src/FluentAssertions.Web.Serializers.NewtonsoftJson/FluentAssertions.Web.Serializers.NewtonsoftJson.csproj
index e5d8e12..a1b4ff3 100644
--- a/src/FluentAssertions.Web.Serializers.NewtonsoftJson/FluentAssertions.Web.Serializers.NewtonsoftJson.csproj
+++ b/src/FluentAssertions.Web.Serializers.NewtonsoftJson/FluentAssertions.Web.Serializers.NewtonsoftJson.csproj
@@ -1,8 +1,5 @@
-
-
-
NewtonsoftJson based serializer for FluentAssertions.Web
@@ -10,7 +7,7 @@
-
+
diff --git a/src/FluentAssertions.Web/FluentAssertions.Web.csproj b/src/FluentAssertions.Web/FluentAssertions.Web.csproj
index dd8fd2f..a3bc593 100644
--- a/src/FluentAssertions.Web/FluentAssertions.Web.csproj
+++ b/src/FluentAssertions.Web/FluentAssertions.Web.csproj
@@ -1,8 +1,5 @@
-
-
-
This is a FluentAssertions 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.
@@ -10,8 +7,8 @@
-
-
+
+
diff --git a/src/FluentAssertions.Web/HttpStatusCodeAssertions.cs b/src/FluentAssertions.Web/HttpStatusCodeAssertions.cs
index 46c63bc..0f801ab 100644
--- a/src/FluentAssertions.Web/HttpStatusCodeAssertions.cs
+++ b/src/FluentAssertions.Web/HttpStatusCodeAssertions.cs
@@ -502,7 +502,7 @@ public AndConstraint Be300Ambiguous(string becaus
.BecauseOf(because, becauseArgs)
.ForCondition(HttpStatusCode.Ambiguous == Subject!.StatusCode)
.FailWith("Expected {context:response} to be {0}{reason}, but found {1}.{2}"
- , HttpStatusCode.Ambiguous, Subject!.StatusCode, Subject);
+ , $"{nameof(HttpStatusCode)}.{nameof(HttpStatusCode.Ambiguous)}", Subject!.StatusCode, Subject);
return new AndConstraint(this);
}
@@ -606,7 +606,7 @@ public AndConstraint Be302Redirect(string because
.BecauseOf(because, becauseArgs)
.ForCondition(HttpStatusCode.Redirect == Subject!.StatusCode)
.FailWith("Expected {context:response} to be {0}{reason}, but found {1}.{2}"
- , HttpStatusCode.Redirect, Subject!.StatusCode, Subject);
+ , $"{nameof(HttpStatusCode)}.{nameof(HttpStatusCode.Redirect)}", Subject!.StatusCode, Subject);
return new AndConstraint(this);
}
@@ -658,7 +658,7 @@ public AndConstraint Be303RedirectMethod(string b
.BecauseOf(because, becauseArgs)
.ForCondition(HttpStatusCode.RedirectMethod == Subject!.StatusCode)
.FailWith("Expected {context:response} to be {0}{reason}, but found {1}.{2}"
- , HttpStatusCode.RedirectMethod, Subject!.StatusCode, Subject);
+ , $"{nameof(HttpStatusCode)}.{nameof(HttpStatusCode.RedirectMethod)}", Subject!.StatusCode, Subject);
return new AndConstraint(this);
}
@@ -762,7 +762,7 @@ public AndConstraint Be307TemporaryRedirect(strin
.BecauseOf(because, becauseArgs)
.ForCondition(HttpStatusCode.TemporaryRedirect == Subject!.StatusCode)
.FailWith("Expected {context:response} to be {0}{reason}, but found {1}.{2}"
- , HttpStatusCode.TemporaryRedirect, Subject!.StatusCode, Subject);
+ , $"{nameof(HttpStatusCode)}.{nameof(HttpStatusCode.TemporaryRedirect)}", Subject!.StatusCode, Subject);
return new AndConstraint(this);
}
diff --git a/test/Directory.Build.props b/test/Directory.Build.props
new file mode 100644
index 0000000..6fd8925
--- /dev/null
+++ b/test/Directory.Build.props
@@ -0,0 +1,20 @@
+
+
+
+ netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net6.0;net7.0;net8.0
+ latest
+ enable
+ CS8600;CS8602;CS8603
+ $(NoWarn);NU1902;NU1903
+ false
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/FluentAssertions.Web.FluentAssertionsWebConfig.Tests/FluentAssertions.Web.FluentAssertionsWebConfig.Tests.csproj b/test/FluentAssertions.Web.FluentAssertionsWebConfig.Tests/FluentAssertions.Web.FluentAssertionsWebConfig.Tests.csproj
index 2d03df1..45fb4f3 100644
--- a/test/FluentAssertions.Web.FluentAssertionsWebConfig.Tests/FluentAssertions.Web.FluentAssertionsWebConfig.Tests.csproj
+++ b/test/FluentAssertions.Web.FluentAssertionsWebConfig.Tests/FluentAssertions.Web.FluentAssertionsWebConfig.Tests.csproj
@@ -1,11 +1,5 @@
-
-
-
- netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0
-
-
@@ -16,9 +10,5 @@
-
-
-
-
diff --git a/test/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests.csproj b/test/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests.csproj
index 0df0728..d1334ae 100644
--- a/test/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests.csproj
+++ b/test/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests.csproj
@@ -1,18 +1,7 @@
-
-
-
- netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0
-
-
-
-
-
-
-
diff --git a/test/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests/YesNoBooleanJsonConverter.cs b/test/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests/YesNoBooleanJsonConverter.cs
index fcd76d2..028cd46 100644
--- a/test/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests/YesNoBooleanJsonConverter.cs
+++ b/test/FluentAssertions.Web.Serializers.NewtonsoftJson.Tests/YesNoBooleanJsonConverter.cs
@@ -6,9 +6,9 @@ public class YesNoBooleanJsonConverter : JsonConverter
{
public override bool CanConvert(Type objectType) => objectType == typeof(bool);
- public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{
- var value = reader.Value.ToString();
+ var value = reader.Value?.ToString();
if (value != null && value.Equals("yes", StringComparison.OrdinalIgnoreCase))
{
@@ -23,7 +23,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
return new JsonSerializer().Deserialize(reader, objectType);
}
- public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
throw new NotImplementedException();
}
diff --git a/test/FluentAssertions.Web.Tests/DeserializationExceptionTests.cs b/test/FluentAssertions.Web.Tests/DeserializationExceptionTests.cs
index 5fcdc71..bc81292 100644
--- a/test/FluentAssertions.Web.Tests/DeserializationExceptionTests.cs
+++ b/test/FluentAssertions.Web.Tests/DeserializationExceptionTests.cs
@@ -32,6 +32,7 @@ public void Ctor_WhenInnerException_DoesNotThrow()
act.Should().NotThrow();
}
+#if !NET8_0_OR_GREATER
[Fact]
public void Exception_ShouldBeBinarySerializable()
{
@@ -41,4 +42,5 @@ public void Exception_ShouldBeBinarySerializable()
// Assert
sut.Should().BeBinarySerializable();
}
+#endif
}
diff --git a/test/FluentAssertions.Web.Tests/FluentAssertions.Web.Tests.csproj b/test/FluentAssertions.Web.Tests/FluentAssertions.Web.Tests.csproj
index 4efcd10..fe23b7f 100644
--- a/test/FluentAssertions.Web.Tests/FluentAssertions.Web.Tests.csproj
+++ b/test/FluentAssertions.Web.Tests/FluentAssertions.Web.Tests.csproj
@@ -1,19 +1,8 @@
-
-
-
- netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0
-
-
-
-
-
-
-
diff --git a/samples/Sample.Api.Tests/CommentsControllerTests.cs b/test/Sample.Api.Tests/CommentsControllerTests.cs
similarity index 100%
rename from samples/Sample.Api.Tests/CommentsControllerTests.cs
rename to test/Sample.Api.Tests/CommentsControllerTests.cs
diff --git a/samples/Sample.Api.Tests/CustomStartupConfigurationsTests.cs b/test/Sample.Api.Tests/CustomStartupConfigurationsTests.cs
similarity index 100%
rename from samples/Sample.Api.Tests/CustomStartupConfigurationsTests.cs
rename to test/Sample.Api.Tests/CustomStartupConfigurationsTests.cs
diff --git a/samples/Sample.Api.Tests/FilesControllerTests.cs b/test/Sample.Api.Tests/FilesControllerTests.cs
similarity index 100%
rename from samples/Sample.Api.Tests/FilesControllerTests.cs
rename to test/Sample.Api.Tests/FilesControllerTests.cs
diff --git a/samples/Sample.Api.Tests/Sample.Api.Tests.csproj b/test/Sample.Api.Tests/Sample.Api.Tests.csproj
similarity index 57%
rename from samples/Sample.Api.Tests/Sample.Api.Tests.csproj
rename to test/Sample.Api.Tests/Sample.Api.Tests.csproj
index 12cbbe2..50ed167 100644
--- a/samples/Sample.Api.Tests/Sample.Api.Tests.csproj
+++ b/test/Sample.Api.Tests/Sample.Api.Tests.csproj
@@ -1,28 +1,27 @@
-
-
-
- net5.0;net6.0;net7.0
+
+ net6.0;net7.0;net8.0
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
diff --git a/samples/Sample.Api.Tests/ValuesControllerTests.cs b/test/Sample.Api.Tests/ValuesControllerTests.cs
similarity index 100%
rename from samples/Sample.Api.Tests/ValuesControllerTests.cs
rename to test/Sample.Api.Tests/ValuesControllerTests.cs