|
@@ -2,49 +2,49 @@
|
|
|
// The .NET Foundation licenses this file to you under the MIT License.
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
-using ApprovalTests;
|
|
|
-using ApprovalTests.Reporters;
|
|
|
using PublicApiGenerator;
|
|
|
using System;
|
|
|
using System.Linq;
|
|
|
using System.Reflection;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using Verify;
|
|
|
+using VerifyXunit;
|
|
|
using Xunit;
|
|
|
using Xunit.Abstractions;
|
|
|
|
|
|
namespace ReactiveTests.Tests.Api
|
|
|
{
|
|
|
-#if DEBUG
|
|
|
- [UseReporter(typeof(DiffReporter))]
|
|
|
-#else
|
|
|
- [UseReporter(typeof(DiffPlexReporter))]
|
|
|
-#endif
|
|
|
- [IgnoreLineEndings(true)]
|
|
|
- public class ApiApprovalTests
|
|
|
+ public class ApiApprovalTests :
|
|
|
+ VerifyBase
|
|
|
{
|
|
|
- public ApiApprovalTests(ITestOutputHelper output)
|
|
|
+ private VerifySettings verifySettings;
|
|
|
+
|
|
|
+ public ApiApprovalTests(ITestOutputHelper output) :
|
|
|
+ base(output)
|
|
|
{
|
|
|
- DiffPlexReporter.INSTANCE.Output = output;
|
|
|
+ verifySettings = new VerifySettings();
|
|
|
+ verifySettings.UseExtension("cs");
|
|
|
}
|
|
|
|
|
|
[Fact]
|
|
|
- public void Core()
|
|
|
+ public Task Core()
|
|
|
{
|
|
|
var publicApi = GeneratePublicApi(typeof(System.Reactive.Unit).Assembly);
|
|
|
- Approvals.Verify(new ApprovalTextWriter(publicApi, "cs"));
|
|
|
+ return Verify(publicApi, verifySettings);
|
|
|
}
|
|
|
|
|
|
[Fact]
|
|
|
- public void Aliases()
|
|
|
+ public Task Aliases()
|
|
|
{
|
|
|
var publicApi = GeneratePublicApi(typeof(System.Reactive.Observable.Aliases.QueryLanguage).Assembly);
|
|
|
- Approvals.Verify(new ApprovalTextWriter(publicApi, "cs"));
|
|
|
+ return Verify(publicApi, verifySettings);
|
|
|
}
|
|
|
|
|
|
[Fact]
|
|
|
- public void Testing()
|
|
|
+ public Task Testing()
|
|
|
{
|
|
|
var publicApi = GeneratePublicApi(typeof(Microsoft.Reactive.Testing.TestScheduler).Assembly);
|
|
|
- Approvals.Verify(new ApprovalTextWriter(publicApi, "cs"));
|
|
|
+ return Verify(publicApi, verifySettings);
|
|
|
}
|
|
|
|
|
|
private string GeneratePublicApi(Assembly assembly)
|