Skip to content

Commit d9bee5f

Browse files
authored
Update ApprovalTests nuget package and remove extern alias workaround (#2611)
* Reapply "Update ApprovalTests to 7.0.0 and revert workaround " (#2610) This reverts commit 6465818. * Update System.Memory version in test to avoid NuGet downgrade error
1 parent 6465818 commit d9bee5f

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<!-- Runtime dependencies -->
1414
<PackageVersion Include="Microsoft.Bcl.Memory" Version="9.0.6" />
1515
<!-- external dependencies -->
16-
<PackageVersion Include="ApprovalTests" Version="7.0.0-beta.3" />
16+
<PackageVersion Include="ApprovalTests" Version="7.0.0" />
1717
<PackageVersion Include="BenchmarkDotNet" Version="0.13.1" />
1818
<PackageVersion Include="AwesomeAssertions" Version="8.1.0" />
1919
<PackageVersion Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
// Alias workaround for https://github.com/approvals/ApprovalTests.Net/issues/768
2-
extern alias ApprovalTests;
3-
4-
using ApprovalTests.ApprovalTests.Reporters;
5-
using ApprovalTests.ApprovalTests.Reporters.TestFrameworks;
1+
using ApprovalTests.Reporters;
2+
using ApprovalTests.Reporters.TestFrameworks;
63

74
// Use globally defined Reporter for ApprovalTests. Please see
85
// https://github.com/approvals/ApprovalTests.Net/blob/master/docs/ApprovalTests/Reporters.md
96

107
[assembly: UseReporter(typeof(FrameworkAssertReporter))]
11-
12-
[assembly: ApprovalTests.ApprovalTests.Namers.UseApprovalSubdirectory("Approvals")]
8+
[assembly: ApprovalTests.Namers.UseApprovalSubdirectory("Approvals")]

src/System.CommandLine.Tests/Help/HelpBuilderTests.Approval.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
// Copyright (c) .NET Foundation and contributors. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
// Alias workaround for https://github.com/approvals/ApprovalTests.Net/issues/768
5-
extern alias ApprovalTests;
6-
74
using Xunit;
85
using System.IO;
9-
using ApprovalTests.ApprovalTests;
10-
using ApprovalTests.ApprovalTests.Reporters;
6+
using ApprovalTests;
7+
using ApprovalTests.Reporters;
118

129
namespace System.CommandLine.Tests.Help
1310
{

src/System.CommandLine.Tests/System.CommandLine.Tests.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
</ItemGroup>
3131

3232
<ItemGroup>
33-
<!-- Alias workaround for https://github.com/approvals/ApprovalTests.Net/issues/768 -->
34-
<PackageReference Include="ApprovalTests" Aliases="ApprovalTests" />
33+
<PackageReference Include="ApprovalTests" />
3534
<PackageReference Include="AwesomeAssertions" />
3635
<PackageReference Include="Newtonsoft.Json" />
3736
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" />
@@ -42,6 +41,8 @@
4241
</ItemGroup>
4342

4443
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
44+
<!-- TODO: Remove System.Memory explicit package reference when the repo's version got updated to 4.6.3. -->
45+
<PackageReference Include="System.Memory" VersionOverride="4.6.3" />
4546
<PackageReference Include="Microsoft.Bcl.Memory" />
4647
<Reference Include="Microsoft.CSharp" />
4748
</ItemGroup>

0 commit comments

Comments
 (0)