Skip to content

Commit

Permalink
Merge pull request #33 from faddiv/master
Browse files Browse the repository at this point in the history
Update project to .net 6
  • Loading branch information
faddiv committed Nov 13, 2022
2 parents 941cc03 + bbf4d62 commit 7b2cbf4
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 20 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: '{build}'
image: Visual Studio 2019
image: Visual Studio 2022
configuration: Release

before_build:
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "2.0.54"
"MSBuild.Sdk.Extras": "3.0.44"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0;net6.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0;net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.4" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.34" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
Expand Down
19 changes: 17 additions & 2 deletions samples/FluentAssertions.AspNetCore.Mvc.Sample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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())
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="FluentAssertions" Version="6.6.0" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="FluentAssertions" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="FluentAssertions" Version="6.0.0" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<Copyright>Copyright 2018</Copyright>
<AssemblyTitle>Fluent Assertions extensions for ASP.NET Core MVC</AssemblyTitle>
<Title>Fluent Assertions for ASP.NET Core MVC</Title>
<VersionPrefix>4.2.0</VersionPrefix>
<VersionPrefix>4.3.0</VersionPrefix>
<Authors>Casey Burns;Kevin Kuszyk</Authors>
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net6.0</TargetFrameworks>
<AssemblyName>FluentAssertions.AspNetCore.Mvc</AssemblyName>
<PackageId>FluentAssertions.AspNetCore.Mvc</PackageId>
<PackageTags>TDD;Fluent;Mvc;AspNetMvc;aspnetcore;aspnetcoremvc</PackageTags>
Expand All @@ -23,15 +23,18 @@
<OutputPath>bin\$(Configuration)\$(TargetFramework)\</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="FluentAssertions" Version="6.6.0" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="FluentAssertions" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="FluentAssertions" Version="6.0.0" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public JsonResultAssertions(JsonResult subject) : base(subject)
/// <summary>
/// The <see cref="JsonResult.SerializerSettings"/> on the tested subject.
/// </summary>
#if NETCOREAPP3_0
#if NETCOREAPP3_0_OR_GREATER
public object SerializerSettings => JsonResultSubject.SerializerSettings;
#else
public Newtonsoft.Json.JsonSerializerSettings SerializerSettings => JsonResultSubject.SerializerSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void BeActionResult_GivenActionResultOfTValue_ShouldReturnActionResultAss

var result = subject.Should().BeActionResult<object>();

result.Should().BeOfType<ActionResultAssertions<object>>();
Assert.IsType<ActionResultAssertions<object>>(result);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0;net6.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down

0 comments on commit 7b2cbf4

Please sign in to comment.