Skip to content

Commit ea1c08a

Browse files
Update test packages
1 parent deb50c7 commit ea1c08a

File tree

5 files changed

+40
-18
lines changed

5 files changed

+40
-18
lines changed

ApiVersioning.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0987757E-4
1414
test\.editorconfig = test\.editorconfig
1515
test\acceptance.xunit.runner.json = test\acceptance.xunit.runner.json
1616
test\Directory.Build.props = test\Directory.Build.props
17+
test\Directory.Build.targets = test\Directory.Build.targets
1718
test\xunit.runner.json = test\xunit.runner.json
1819
EndProjectSection
1920
EndProject

test/Directory.Build.props

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,4 @@
1414
<None Include="$(MSBuildThisFileDirectory)$(AcceptanceTestPrefix)xunit.runner.json" Link="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" Visible="false" />
1515
</ItemGroup>
1616

17-
<ItemGroup Condition=" '$(MSBuildProjectExtension)' != '.shproj' ">
18-
<PackageReference Include="FluentAssertions" Version="5.10.3" />
19-
<PackageReference Include="Moq" Version="4.17.2" />
20-
<PackageReference Include="xunit" Version="2.4.1" />
21-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
22-
</ItemGroup>
23-
24-
<ItemGroup Condition=" '$(IsAspNetCore)' == 'true' ">
25-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
26-
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.23-*" />
27-
</ItemGroup>
28-
2917
</Project>

test/Directory.Build.targets

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<PropertyGroup>
5+
<FluentAssertionsVersion>6.7.0</FluentAssertionsVersion>
6+
<MoqVersion>4.18.2</MoqVersion>
7+
<XunitRunnerVersion>2.4.5</XunitRunnerVersion>
8+
<TestHostVersion>5.0.17-*</TestHostVersion>
9+
</PropertyGroup>
10+
11+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net472' ">
12+
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
13+
<MoqVersion>4.17.2</MoqVersion>
14+
<XunitRunnerVersion>2.4.3</XunitRunnerVersion>
15+
</PropertyGroup>
16+
17+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
18+
<TestHostVersion>3.1.28</TestHostVersion>
19+
</PropertyGroup>
20+
21+
<ItemGroup Condition=" '$(MSBuildProjectExtension)' != '.shproj' ">
22+
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
23+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
24+
<PackageReference Include="Moq" Version="$(MoqVersion)" />
25+
<PackageReference Include="xunit" Version="2.4.2" />
26+
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitRunnerVersion)" />
27+
</ItemGroup>
28+
29+
<ItemGroup Condition=" '$(IsAspNetCore)' == 'true' ">
30+
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="$(TestHostVersion)" />
31+
</ItemGroup>
32+
33+
</Project>

test/Microsoft.AspNetCore.Mvc.Acceptance.Tests/Mvc/Basic/given a versioned Controller/when two route templates overlap.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ public async Task then_the_higher_precedence_route_should_result_in_ambiguous_ac
5454
var result1 = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync();
5555

5656
// act
57-
Func<Task> act = async () => await GetAsync( "api/v1/values/42/ambiguous" );
57+
Func<Task> act = () => GetAsync( "api/v1/values/42/ambiguous" );
5858

5959
// assert
6060
result1.Should().Be( "{\"id\":42,\"childId\":\"abc\"}" );
6161

6262
if ( UsingEndpointRouting )
6363
{
64-
act.Should().Throw<Exception>().And.GetType().Name.Should().Be( "AmbiguousMatchException" );
64+
( await act.Should().ThrowAsync<Exception>() ).And.GetType().Name.Should().Be( "AmbiguousMatchException" );
6565
}
6666
else
6767
{
68-
act.Should().Throw<AmbiguousActionException>();
68+
await act.Should().ThrowAsync<AmbiguousActionException>();
6969
}
7070
}
7171

test/Microsoft.AspNetCore.OData.Versioning.ApiExplorer.Tests/AspNet.OData/DefaultModelTypeBuilderTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ public void substituted_type_should_have_renamed_with_attribute_properties_from_
447447
// assert
448448
substitutedType.Should().HaveProperty<string>( nameof( Contact.FirstName ) );
449449
substitutedType.GetRuntimeProperty( nameof( Contact.FirstName ) ).Should().NotBeNull();
450-
substitutedType.GetRuntimeProperty( nameof( Contact.FirstName ) ).IsDecoratedWith<DataMemberAttribute>();
450+
substitutedType.GetRuntimeProperty( nameof( Contact.FirstName ) ).GetCustomAttribute<DataMemberAttribute>().Should().NotBeNull();
451451
}
452452

453453
[Fact]
@@ -465,7 +465,7 @@ public void substituted_type_should_keep_custom_attributes_on_dependency_propert
465465

466466
// assert
467467
substitutedType.GetRuntimeProperty( nameof( Contact.Email ) ).Should().NotBeNull();
468-
substitutedType.GetRuntimeProperty( nameof( Contact.Email ) ).IsDecoratedWith<DataMemberAttribute>();
468+
substitutedType.GetRuntimeProperty( nameof( Contact.Email ) ).GetCustomAttribute<DataMemberAttribute>().Should().NotBeNull();
469469
}
470470

471471
[Fact]
@@ -483,7 +483,7 @@ public void substituted_type_should_keep_custom_attributes_on_collection_depende
483483

484484
// assert
485485
substitutedType.GetRuntimeProperty( nameof( Contact.Addresses ) ).Should().NotBeNull();
486-
substitutedType.GetRuntimeProperty( nameof( Contact.Addresses ) ).IsDecoratedWith<DataMemberAttribute>();
486+
substitutedType.GetRuntimeProperty( nameof( Contact.Addresses ) ).GetCustomAttribute<DataMemberAttribute>().Should().NotBeNull();
487487
}
488488

489489
public static IEnumerable<object[]> SubstitutionNotRequiredData

0 commit comments

Comments
 (0)