public async Task Command_ShouldBeCalledOnce() { var command = new TestAsyncCommand(); await mediator.ExecuteAsync(command); command.EngineInvocationCount.ShouldBe(1); }
public void CancellationToken_ShouldReturnCorrectValue( ) { //arrange var source = new CancellationTokenSource(); var sut = new TestAsyncCommand(source.Token); //act source.Cancel(); //assert sut.CancellationToken.IsCancellationRequested.Should().BeTrue(); }
public async Task Finds_And_Executed_Async_Handler_For_Command() { // Given var command = new TestAsyncCommand { HasBeenCalled = false }; // When await _broker.ProcessCommandAsync(command); // Then command.HasBeenCalled.ShouldBeTrue(); }