diff --git a/tests/Prism.Core.Tests/Commands/AsyncDelegateCommandFixture.cs b/tests/Prism.Core.Tests/Commands/AsyncDelegateCommandFixture.cs index da4a5ad2d7..3db702283b 100644 --- a/tests/Prism.Core.Tests/Commands/AsyncDelegateCommandFixture.cs +++ b/tests/Prism.Core.Tests/Commands/AsyncDelegateCommandFixture.cs @@ -97,7 +97,12 @@ public async Task ExecuteAsync_WithCancellationToken_ShouldExecuteCommandAsynchr // Arrange bool executionStarted = false; bool executed = false; - var command = new AsyncDelegateCommand(Execute); + bool taskCancelled = false; + var command = new AsyncDelegateCommand(Execute) + .Catch(ex => + { + taskCancelled = true; + }); async Task Execute(CancellationToken token) { @@ -116,6 +121,7 @@ async Task Execute(CancellationToken token) // Assert Assert.True(executionStarted); Assert.False(executed); + Assert.True(taskCancelled); } [Fact]