diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index b60ae25..6c71bb8 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -21,13 +21,11 @@ - - - + - - - + + + /// Tests DisposeWith returns a disposable. /// - [Fact] + [Test] public void GivenNull_WhenDisposeWith_ThenExceptionThrown() { // Given var sut = Disposable.Create(() => { }); // When - var result = Record.Exception(() => sut.DisposeWith(null!)); + var result = Assert.Catch(() => sut.DisposeWith(null!)); // Then - result - .Should() - .BeOfType(); + Assert.That(result, Is.TypeOf()); } /// /// Tests DisposeWith disposes the underlying disposable. /// - [Fact] + [Test] public void GivenDisposable_WhenDisposeWith_ThenDisposed() { // Given @@ -48,15 +45,13 @@ public void GivenDisposable_WhenDisposeWith_ThenDisposed() compositeDisposable.Dispose(); // Then - sut.IsDisposed - .Should() - .BeTrue(); + Assert.That(sut.IsDisposed, Is.True); } /// /// Tests DisposeWith returns the original disposable. /// - [Fact] + [Test] public void GivenDisposable_WhenDisposeWith_ThenReturnsDisposable() { // Given, When @@ -65,7 +60,6 @@ public void GivenDisposable_WhenDisposeWith_ThenReturnsDisposable() var result = sut.DisposeWith(compositeDisposable); // Then - sut.Should() - .BeEquivalentTo(result); + Assert.That(result, Is.SameAs(sut)); } } diff --git a/src/ReactiveUI.Extensions.Tests/ReactiveExtensionsTests.cs b/src/ReactiveUI.Extensions.Tests/ReactiveExtensionsTests.cs index 6914b8a..cf41aae 100644 --- a/src/ReactiveUI.Extensions.Tests/ReactiveExtensionsTests.cs +++ b/src/ReactiveUI.Extensions.Tests/ReactiveExtensionsTests.cs @@ -8,8 +8,7 @@ using System.Reactive.Subjects; using System.Threading; using System.Threading.Tasks; -using FluentAssertions; -using Xunit; +using NUnit.Framework; namespace ReactiveUI.Extensions.Tests; @@ -21,7 +20,7 @@ public class ReactiveExtensionsTests /// /// Tests the WhereIsNotNull extension. /// - [Fact] + [Test] public void GivenNull_WhenWhereIsNotNull_ThenNoNotification() { // Given, When @@ -29,15 +28,13 @@ public void GivenNull_WhenWhereIsNotNull_ThenNoNotification() using var disposable = Observable.Return(null).WhereIsNotNull().Subscribe(x => result = x); // Then - result - .Should() - .BeNull(); + Assert.That(result, Is.Null); } /// /// Tests the WhereIsNotNull extension. /// - [Fact] + [Test] public void GivenValue_WhenWhereIsNotNull_ThenNotification() { // Given, When @@ -45,15 +42,13 @@ public void GivenValue_WhenWhereIsNotNull_ThenNotification() using var disposable = Observable.Return(false).WhereIsNotNull().Subscribe(x => result = x); // Then - result - .Should() - .BeFalse(); + Assert.That(result, Is.False); } /// /// Tests the AsSignal extension. /// - [Fact] + [Test] public void GivenObservable_WhenAsSignal_ThenNotifiesUnit() { // Given, When @@ -61,15 +56,13 @@ public void GivenObservable_WhenAsSignal_ThenNotifiesUnit() using var disposable = Observable.Return(false).AsSignal().Subscribe(x => result = x); // Then - result - .Should() - .Be(Unit.Default); + Assert.That(result, Is.EqualTo(Unit.Default)); } /// /// Syncronizes the asynchronous runs with asynchronous tasks in subscriptions. /// - [Fact] + [Test] public void SubscribeSynchronus_RunsWithAsyncTasksInSubscriptions() { // Given, When @@ -106,15 +99,13 @@ public void SubscribeSynchronus_RunsWithAsyncTasksInSubscriptions() } // Then - result - .Should() - .Be(0); + Assert.That(result, Is.Zero); } /// /// Syncronizes the asynchronous runs with asynchronous tasks in subscriptions. /// - [Fact] + [Test] public void SyncronizeAsync_RunsWithAsyncTasksInSubscriptions() { // Given, When @@ -153,15 +144,13 @@ public void SyncronizeAsync_RunsWithAsyncTasksInSubscriptions() } // Then - result - .Should() - .Be(0); + Assert.That(result, Is.Zero); } /// /// Syncronizes the asynchronous runs with asynchronous tasks in subscriptions. /// - [Fact] + [Test] public void SynchronizeSynchronous_RunsWithAsyncTasksInSubscriptions() { // Given, When @@ -200,15 +189,13 @@ public void SynchronizeSynchronous_RunsWithAsyncTasksInSubscriptions() } // Then - result - .Should() - .Be(0); + Assert.That(result, Is.Zero); } /// /// Syncronizes the asynchronous runs with asynchronous tasks in subscriptions. /// - [Fact] + [Test] public void SubscribeAsync_RunsWithAsyncTasksInSubscriptions() { // Given, When @@ -245,8 +232,6 @@ public void SubscribeAsync_RunsWithAsyncTasksInSubscriptions() } // Then - result - .Should() - .Be(0); + Assert.That(result, Is.Zero); } } diff --git a/src/ReactiveUI.Extensions.Tests/ReactiveUI.Extensions.Tests.csproj b/src/ReactiveUI.Extensions.Tests/ReactiveUI.Extensions.Tests.csproj index 9f240da..fdc581d 100644 --- a/src/ReactiveUI.Extensions.Tests/ReactiveUI.Extensions.Tests.csproj +++ b/src/ReactiveUI.Extensions.Tests/ReactiveUI.Extensions.Tests.csproj @@ -6,18 +6,13 @@ - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + + + + + diff --git a/tests.runsettings b/tests.runsettings new file mode 100644 index 0000000..e5d4ab7 --- /dev/null +++ b/tests.runsettings @@ -0,0 +1,6 @@ + + + + 4 + +