Skip to content

Commit 58cde10

Browse files
committed
Switch to Particular.Approvals
1 parent 280e96c commit 58cde10

File tree

4 files changed

+8
-40
lines changed

4 files changed

+8
-40
lines changed
Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,15 @@
1-
#if NET452
2-
using System;
3-
using System.IO;
4-
using System.Linq;
5-
using System.Reflection;
6-
using System.Runtime.CompilerServices;
7-
using ApprovalTests;
1+
using NServiceBus.Testing;
82
using NUnit.Framework;
3+
using Particular.Approvals;
94
using PublicApiGenerator;
105

116
[TestFixture]
127
public class APIApprovals
138
{
149
[Test]
15-
[MethodImpl(MethodImplOptions.NoInlining)]
1610
public void Approve()
1711
{
18-
var combine = Path.Combine(TestContext.CurrentContext.TestDirectory, "NServiceBus.Testing.dll");
19-
var assembly = Assembly.LoadFile(combine);
20-
var publicApi = Filter(ApiGenerator.GeneratePublicApi(assembly));
21-
Approvals.Verify(publicApi);
22-
23-
}
24-
25-
string Filter(string text)
26-
{
27-
return string.Join(Environment.NewLine, text.Split(new[]
28-
{
29-
Environment.NewLine
30-
}, StringSplitOptions.RemoveEmptyEntries)
31-
.Where(l => !string.IsNullOrWhiteSpace(l))
32-
);
12+
var publicApi = ApiGenerator.GeneratePublicApi(typeof(Test).Assembly, excludeAttributes: new[] { "System.Runtime.Versioning.TargetFrameworkAttribute" });
13+
Approver.Verify(publicApi);
3314
}
34-
}
35-
#endif
15+
}

src/NServiceBus.Testing.Tests/APIApprovals.Approve.approved.txt renamed to src/NServiceBus.Testing.Tests/ApprovalFiles/APIApprovals.Approve.approved.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
[assembly: System.CLSCompliantAttribute(true)]
1+
[assembly: System.CLSCompliantAttribute(true)]
22
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
3-
[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.2", FrameworkDisplayName=".NET Framework 4.5.2")]
43
namespace NServiceBus.Testing
54
{
65
public class ExpectationException : System.Exception

src/NServiceBus.Testing.Tests/ApprovalTestConfig.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/NServiceBus.Testing.Tests/NServiceBus.Testing.Tests.csproj

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>net452;netcoreapp2.0</TargetFrameworks>
5-
<Optimize>False</Optimize>
65
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
76
</PropertyGroup>
87

@@ -11,16 +10,12 @@
1110
</ItemGroup>
1211

1312
<ItemGroup>
14-
<PackageReference Include="ApprovalTests" Version="3.0.13" NoWarn="NU1701" />
15-
<PackageReference Include="ApprovalUtilities" Version="3.0.13" NoWarn="NU1701" />
1613
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
1714
<PackageReference Include="NServiceBus" Version="7.0.0" />
1815
<PackageReference Include="NUnit" Version="3.11.0" />
1916
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
20-
</ItemGroup>
21-
22-
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
23-
<PackageReference Include="PublicApiGenerator" Version="6.4.0" />
17+
<PackageReference Include="Particular.Approvals" Version="0.2.0" />
18+
<PackageReference Include="PublicApiGenerator" Version="8.1.0" />
2419
</ItemGroup>
2520

2621
</Project>

0 commit comments

Comments
 (0)