Skip to content

Commit d228efd

Browse files
committed
Udate from netcoreapp2.0 to netcoreapp2.1
1 parent a3ed519 commit d228efd

File tree

10 files changed

+43
-199
lines changed

10 files changed

+43
-199
lines changed

samples/FluentAssertions.AspNetCore.Mvc.Sample.Tests/FluentAssertions.AspNetCore.Mvc.Sample.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.0;netcoreapp3.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

samples/FluentAssertions.AspNetCore.Mvc.Sample/FluentAssertions.AspNetCore.Mvc.Sample.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.0;netcoreapp3.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
55
</PropertyGroup>
66

7-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
8-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
7+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
8+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0" />
99
</ItemGroup>
1010

1111
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">

samples/FluentAssertions.AspNetCore.Mvc.Sample/Startup.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
4444
if (env.IsDevelopment())
4545
{
4646
app.UseDeveloperExceptionPage();
47-
#if NETCOREAPP2_0
47+
#if NETCOREAPP2_1
4848
app.UseBrowserLink();
4949
#endif
5050
}
5151
else
5252
{
5353
app.UseExceptionHandler("/Home/Error");
5454
}
55-
#if NETCOREAPP2_0
55+
#if NETCOREAPP2_1
5656
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
5757
loggerFactory.AddDebug();
5858
#endif

src/FluentAssertions.AspNetCore.Mvc/FluentAssertions.AspNetCore.Mvc.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Fluent Assertions extensions for ASP.NET Core MVC.</Description>
@@ -7,7 +7,7 @@
77
<Title>Fluent Assertions for ASP.NET Core MVC</Title>
88
<VersionPrefix>2.4.0</VersionPrefix>
99
<Authors>Casey Burns;Kevin Kuszyk</Authors>
10-
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
10+
<TargetFrameworks>netstandard2.0;netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
1111
<AssemblyName>FluentAssertions.AspNetCore.Mvc</AssemblyName>
1212
<PackageId>FluentAssertions.AspNetCore.Mvc</PackageId>
1313
<PackageTags>TDD;TDD;Fluent;Mvc;AspNetMvc;aspnetcore;aspnetcoremvc</PackageTags>
@@ -30,8 +30,8 @@
3030
<PackageReference Include="FluentAssertions" Version="5.0.0" />
3131
</ItemGroup>
3232

33-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
34-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
33+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netcoreapp2.1'">
34+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0" />
3535
</ItemGroup>
3636

3737
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">

tests/FluentAssertions.AspNetCore.Mvc.Tests/ChallengeResultAssertions_Tests.cs

+1-47
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,7 @@ public void WithAuthenticationProperties_GivenUnexpected_ShouldFail()
3030
var actualAuthenticationProperties = new AuthenticationProperties();
3131
var expectedAuthenticationProperties = new AuthenticationProperties();
3232
ActionResult result = new ChallengeResult(actualAuthenticationProperties);
33-
#if NETCOREAPP3_0
34-
var failureMessage = @"Expected ChallengeResult.AuthenticationProperties to be
35-
36-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
37-
{
38-
AllowRefresh = <null>
39-
ExpiresUtc = <null>
40-
IsPersistent = False
41-
IssuedUtc = <null>
42-
Items = {empty}
43-
Parameters = {empty}
44-
RedirectUri = <null>
45-
} because it is 10 but found
46-
47-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
48-
{
49-
AllowRefresh = <null>
50-
ExpiresUtc = <null>
51-
IsPersistent = False
52-
IssuedUtc = <null>
53-
Items = {empty}
54-
Parameters = {empty}
55-
RedirectUri = <null>
56-
}.";
57-
#else
58-
var failureMessage = @"Expected ChallengeResult.AuthenticationProperties to be
59-
60-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
61-
{
62-
AllowRefresh = <null>
63-
ExpiresUtc = <null>
64-
IsPersistent = False
65-
IssuedUtc = <null>
66-
Items = {empty}
67-
RedirectUri = <null>
68-
} because it is 10 but found
69-
70-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
71-
{
72-
AllowRefresh = <null>
73-
ExpiresUtc = <null>
74-
IsPersistent = False
75-
IssuedUtc = <null>
76-
Items = {empty}
77-
RedirectUri = <null>
78-
}.";
79-
#endif
33+
var failureMessage = FailureMessageHelper.AuthenticationPropertiesExpectations(result);
8034

8135
Action a = () => result.Should().BeChallengeResult().WithAuthenticationProperties(expectedAuthenticationProperties, Reason, ReasonArgs);
8236

tests/FluentAssertions.AspNetCore.Mvc.Tests/FluentAssertions.AspNetCore.Mvc.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.0;netcoreapp3.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

tests/FluentAssertions.AspNetCore.Mvc.Tests/ForbidResultAssertions_Tests.cs

+1-47
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,7 @@ public void WithAuthenticationProperties_GivenUnexpected_ShouldFail()
3030
var actualAuthenticationProperties = new AuthenticationProperties();
3131
var expectedAuthenticationProperties = new AuthenticationProperties();
3232
ActionResult result = new ForbidResult(actualAuthenticationProperties);
33-
#if NETCOREAPP3_0
34-
var failureMessage = @"Expected ForbidResult.AuthenticationProperties to be
35-
36-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
37-
{
38-
AllowRefresh = <null>
39-
ExpiresUtc = <null>
40-
IsPersistent = False
41-
IssuedUtc = <null>
42-
Items = {empty}
43-
Parameters = {empty}
44-
RedirectUri = <null>
45-
} because it is 10 but found
46-
47-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
48-
{
49-
AllowRefresh = <null>
50-
ExpiresUtc = <null>
51-
IsPersistent = False
52-
IssuedUtc = <null>
53-
Items = {empty}
54-
Parameters = {empty}
55-
RedirectUri = <null>
56-
}.";
57-
#else
58-
var failureMessage = @"Expected ForbidResult.AuthenticationProperties to be
59-
60-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
61-
{
62-
AllowRefresh = <null>
63-
ExpiresUtc = <null>
64-
IsPersistent = False
65-
IssuedUtc = <null>
66-
Items = {empty}
67-
RedirectUri = <null>
68-
} because it is 10 but found
69-
70-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
71-
{
72-
AllowRefresh = <null>
73-
ExpiresUtc = <null>
74-
IsPersistent = False
75-
IssuedUtc = <null>
76-
Items = {empty}
77-
RedirectUri = <null>
78-
}.";
79-
#endif
33+
var failureMessage = FailureMessageHelper.AuthenticationPropertiesExpectations(result);
8034

8135
Action a = () => result.Should().BeForbidResult().WithAuthenticationProperties(expectedAuthenticationProperties, Reason, ReasonArgs);
8236

tests/FluentAssertions.AspNetCore.Mvc.Tests/Helpers/FailureMessageHelper.cs

+28
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,33 @@ internal static string ExpectedContextContainValueAtKeyButKeyNotFound(string con
107107
? new DateTimeOffset?(result)
108108
: new DateTimeOffset?();
109109
}
110+
111+
public static string AuthenticationPropertiesExpectations(object containingObject)
112+
{
113+
var failureMessage = @"Expected " + containingObject.GetType().Name + @".AuthenticationProperties to be
114+
115+
Microsoft.AspNetCore.Authentication.AuthenticationProperties
116+
{
117+
AllowRefresh = <null>
118+
ExpiresUtc = <null>
119+
IsPersistent = False
120+
IssuedUtc = <null>
121+
Items = {empty}
122+
Parameters = {empty}
123+
RedirectUri = <null>
124+
} because it is 10 but found
125+
126+
Microsoft.AspNetCore.Authentication.AuthenticationProperties
127+
{
128+
AllowRefresh = <null>
129+
ExpiresUtc = <null>
130+
IsPersistent = False
131+
IssuedUtc = <null>
132+
Items = {empty}
133+
Parameters = {empty}
134+
RedirectUri = <null>
135+
}.";
136+
return failureMessage;
137+
}
110138
}
111139
}

tests/FluentAssertions.AspNetCore.Mvc.Tests/SignInResultAssertions_Tests.cs

+1-47
Original file line numberDiff line numberDiff line change
@@ -33,53 +33,7 @@ public void WithAuthenticationProperties_GivenUnexpected_ShouldFail()
3333
var actualAuthenticationProperties = new AuthenticationProperties();
3434
var expectedAuthenticationProperties = new AuthenticationProperties();
3535
ActionResult result = new SignInResult(TestAuthenticationScheme, TestClaimsPrincipal, actualAuthenticationProperties);
36-
#if NETCOREAPP3_0
37-
var failureMessage = @"Expected SignInResult.AuthenticationProperties to be
38-
39-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
40-
{
41-
AllowRefresh = <null>
42-
ExpiresUtc = <null>
43-
IsPersistent = False
44-
IssuedUtc = <null>
45-
Items = {empty}
46-
Parameters = {empty}
47-
RedirectUri = <null>
48-
} because it is 10 but found
49-
50-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
51-
{
52-
AllowRefresh = <null>
53-
ExpiresUtc = <null>
54-
IsPersistent = False
55-
IssuedUtc = <null>
56-
Items = {empty}
57-
Parameters = {empty}
58-
RedirectUri = <null>
59-
}.";
60-
#else
61-
var failureMessage = @"Expected SignInResult.AuthenticationProperties to be
62-
63-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
64-
{
65-
AllowRefresh = <null>
66-
ExpiresUtc = <null>
67-
IsPersistent = False
68-
IssuedUtc = <null>
69-
Items = {empty}
70-
RedirectUri = <null>
71-
} because it is 10 but found
72-
73-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
74-
{
75-
AllowRefresh = <null>
76-
ExpiresUtc = <null>
77-
IsPersistent = False
78-
IssuedUtc = <null>
79-
Items = {empty}
80-
RedirectUri = <null>
81-
}.";
82-
#endif
36+
var failureMessage = FailureMessageHelper.AuthenticationPropertiesExpectations(result);
8337

8438
Action a = () => result.Should().BeSignInResult().WithAuthenticationProperties(expectedAuthenticationProperties, Reason, ReasonArgs);
8539

tests/FluentAssertions.AspNetCore.Mvc.Tests/SignOutResultAssertions_Tests.cs

+1-47
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,7 @@ public void WithAuthenticationProperties_GivenUnexpected_ShouldFail()
3030
var actualAuthenticationProperties = new AuthenticationProperties();
3131
var expectedAuthenticationProperties = new AuthenticationProperties();
3232
ActionResult result = new SignOutResult(TestAuthenticationSchemes, actualAuthenticationProperties);
33-
#if NETCOREAPP3_0
34-
var failureMessage = @"Expected SignOutResult.AuthenticationProperties to be
35-
36-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
37-
{
38-
AllowRefresh = <null>
39-
ExpiresUtc = <null>
40-
IsPersistent = False
41-
IssuedUtc = <null>
42-
Items = {empty}
43-
Parameters = {empty}
44-
RedirectUri = <null>
45-
} because it is 10 but found
46-
47-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
48-
{
49-
AllowRefresh = <null>
50-
ExpiresUtc = <null>
51-
IsPersistent = False
52-
IssuedUtc = <null>
53-
Items = {empty}
54-
Parameters = {empty}
55-
RedirectUri = <null>
56-
}.";
57-
#else
58-
var failureMessage = @"Expected SignOutResult.AuthenticationProperties to be
59-
60-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
61-
{
62-
AllowRefresh = <null>
63-
ExpiresUtc = <null>
64-
IsPersistent = False
65-
IssuedUtc = <null>
66-
Items = {empty}
67-
RedirectUri = <null>
68-
} because it is 10 but found
69-
70-
Microsoft.AspNetCore.Authentication.AuthenticationProperties
71-
{
72-
AllowRefresh = <null>
73-
ExpiresUtc = <null>
74-
IsPersistent = False
75-
IssuedUtc = <null>
76-
Items = {empty}
77-
RedirectUri = <null>
78-
}.";
79-
#endif
33+
var failureMessage = FailureMessageHelper.AuthenticationPropertiesExpectations(result);
8034

8135
Action a = () => result.Should().BeSignOutResult().WithAuthenticationProperties(expectedAuthenticationProperties, Reason, ReasonArgs);
8236

0 commit comments

Comments
 (0)