Skip to content

Commit

Permalink
test: fixing broken AsyncDelegateCommand test
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Nov 14, 2023
1 parent 132b134 commit 7492350
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<TaskCanceledException>(ex =>
{
taskCancelled = true;
});

async Task Execute(CancellationToken token)
{
Expand All @@ -116,6 +121,7 @@ async Task Execute(CancellationToken token)
// Assert
Assert.True(executionStarted);
Assert.False(executed);
Assert.True(taskCancelled);
}

[Fact]
Expand Down

0 comments on commit 7492350

Please sign in to comment.