diff --git a/appveyor.yml b/appveyor.yml index 17d8c78..e387c74 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: '{build}' -image: Visual Studio 2019 +image: Visual Studio 2022 configuration: Release before_build: diff --git a/global.json b/global.json index 80d84a2..f3cb0dc 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "msbuild-sdks": { - "MSBuild.Sdk.Extras": "2.0.54" + "MSBuild.Sdk.Extras": "3.0.44" } } \ No newline at end of file diff --git a/samples/FluentAssertions.AspNetCore.Mvc.Sample.Tests/FluentAssertions.AspNetCore.Mvc.Sample.Tests.csproj b/samples/FluentAssertions.AspNetCore.Mvc.Sample.Tests/FluentAssertions.AspNetCore.Mvc.Sample.Tests.csproj index 5779acc..e62cd9e 100644 --- a/samples/FluentAssertions.AspNetCore.Mvc.Sample.Tests/FluentAssertions.AspNetCore.Mvc.Sample.Tests.csproj +++ b/samples/FluentAssertions.AspNetCore.Mvc.Sample.Tests/FluentAssertions.AspNetCore.Mvc.Sample.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp2.1;netcoreapp3.0 + netcoreapp2.1;netcoreapp3.0;net6.0 false diff --git a/samples/FluentAssertions.AspNetCore.Mvc.Sample/FluentAssertions.AspNetCore.Mvc.Sample.csproj b/samples/FluentAssertions.AspNetCore.Mvc.Sample/FluentAssertions.AspNetCore.Mvc.Sample.csproj index 05343b2..b028c67 100644 --- a/samples/FluentAssertions.AspNetCore.Mvc.Sample/FluentAssertions.AspNetCore.Mvc.Sample.csproj +++ b/samples/FluentAssertions.AspNetCore.Mvc.Sample/FluentAssertions.AspNetCore.Mvc.Sample.csproj @@ -1,11 +1,11 @@ - + - netcoreapp2.1;netcoreapp3.0 + netcoreapp2.1;netcoreapp3.0;net6.0 - + diff --git a/samples/FluentAssertions.AspNetCore.Mvc.Sample/Startup.cs b/samples/FluentAssertions.AspNetCore.Mvc.Sample/Startup.cs index 4f7d319..16b17b0 100644 --- a/samples/FluentAssertions.AspNetCore.Mvc.Sample/Startup.cs +++ b/samples/FluentAssertions.AspNetCore.Mvc.Sample/Startup.cs @@ -3,12 +3,21 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +#if NETCOREAPP3_0_OR_GREATER +using Microsoft.Extensions.Hosting; +#endif namespace FluentAssertions.AspNetCore.Mvc.Sample { public class Startup { - public Startup(IHostingEnvironment env) + public Startup( +#if NETCOREAPP3_0_OR_GREATER + IWebHostEnvironment env +#else + IHostingEnvironment env +#endif + ) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) @@ -39,7 +48,13 @@ public void ConfigureServices(IServiceCollection services) } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, +#if NETCOREAPP3_0_OR_GREATER + IWebHostEnvironment env, +#else + IHostingEnvironment env, +#endif + ILoggerFactory loggerFactory) { if (env.IsDevelopment()) { diff --git a/src/FluentAssertions.AspNetCore.Mvc.Ref/FluentAssertions.AspNetCore.Mvc.Ref.csproj b/src/FluentAssertions.AspNetCore.Mvc.Ref/FluentAssertions.AspNetCore.Mvc.Ref.csproj index 586a918..3fdaf52 100644 --- a/src/FluentAssertions.AspNetCore.Mvc.Ref/FluentAssertions.AspNetCore.Mvc.Ref.csproj +++ b/src/FluentAssertions.AspNetCore.Mvc.Ref/FluentAssertions.AspNetCore.Mvc.Ref.csproj @@ -1,18 +1,21 @@ - netstandard2.0;netcoreapp3.0 + netstandard2.0;netcoreapp3.0;net6.0 - - - + + + + + + diff --git a/src/FluentAssertions.AspNetCore.Mvc/FluentAssertions.AspNetCore.Mvc.csproj b/src/FluentAssertions.AspNetCore.Mvc/FluentAssertions.AspNetCore.Mvc.csproj index 1a5b037..23c8dbd 100644 --- a/src/FluentAssertions.AspNetCore.Mvc/FluentAssertions.AspNetCore.Mvc.csproj +++ b/src/FluentAssertions.AspNetCore.Mvc/FluentAssertions.AspNetCore.Mvc.csproj @@ -5,9 +5,9 @@ Copyright 2018 Fluent Assertions extensions for ASP.NET Core MVC Fluent Assertions for ASP.NET Core MVC - 4.2.0 + 4.3.0 Casey Burns;Kevin Kuszyk - netstandard2.0;netcoreapp3.0 + netstandard2.0;netcoreapp3.0;net6.0 FluentAssertions.AspNetCore.Mvc FluentAssertions.AspNetCore.Mvc TDD;Fluent;Mvc;AspNetMvc;aspnetcore;aspnetcoremvc @@ -23,15 +23,18 @@ bin\$(Configuration)\$(TargetFramework)\ - - - + + + + + + diff --git a/src/FluentAssertions.AspNetCore.Mvc/JsonResultAssertions.cs b/src/FluentAssertions.AspNetCore.Mvc/JsonResultAssertions.cs index 95b83e1..5a0a226 100644 --- a/src/FluentAssertions.AspNetCore.Mvc/JsonResultAssertions.cs +++ b/src/FluentAssertions.AspNetCore.Mvc/JsonResultAssertions.cs @@ -30,7 +30,7 @@ public JsonResultAssertions(JsonResult subject) : base(subject) /// /// The on the tested subject. /// -#if NETCOREAPP3_0 +#if NETCOREAPP3_0_OR_GREATER public object SerializerSettings => JsonResultSubject.SerializerSettings; #else public Newtonsoft.Json.JsonSerializerSettings SerializerSettings => JsonResultSubject.SerializerSettings; diff --git a/tests/FluentAssertions.AspNetCore.Mvc.Tests/ConvertToActionResultAssertions_Tests.cs b/tests/FluentAssertions.AspNetCore.Mvc.Tests/ConvertToActionResultAssertions_Tests.cs index c1d55cd..e7031ea 100644 --- a/tests/FluentAssertions.AspNetCore.Mvc.Tests/ConvertToActionResultAssertions_Tests.cs +++ b/tests/FluentAssertions.AspNetCore.Mvc.Tests/ConvertToActionResultAssertions_Tests.cs @@ -29,7 +29,7 @@ public void BeActionResult_GivenActionResultOfTValue_ShouldReturnActionResultAss var result = subject.Should().BeActionResult(); - result.Should().BeOfType>(); + Assert.IsType>(result); } [Fact] diff --git a/tests/FluentAssertions.AspNetCore.Mvc.Tests/FluentAssertions.AspNetCore.Mvc.Tests.csproj b/tests/FluentAssertions.AspNetCore.Mvc.Tests/FluentAssertions.AspNetCore.Mvc.Tests.csproj index b79c1c7..8ae0cd9 100644 --- a/tests/FluentAssertions.AspNetCore.Mvc.Tests/FluentAssertions.AspNetCore.Mvc.Tests.csproj +++ b/tests/FluentAssertions.AspNetCore.Mvc.Tests/FluentAssertions.AspNetCore.Mvc.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp2.1;netcoreapp3.0 + netcoreapp2.1;netcoreapp3.0;net6.0 false