public async Task ExecuteAsync_WhenCalled_AssertToDomainWasCalledOnCommand() { CommandHandler sut = CreateSut(); Mock <ICreateLetterHeadCommand> commandMock = CreateCommandMock(); await sut.ExecuteAsync(commandMock.Object); commandMock.Verify(m => m.ToDomain(), Times.Once); }
public async Task ExecuteAsync_WhenCalled_AssertCreateLetterHeadAsyncWasCalledOnCommonRepository() { CommandHandler sut = CreateSut(); ILetterHead letterHead = _fixture.BuildLetterHeadMock().Object; ICreateLetterHeadCommand command = CreateCommandMock(letterHead).Object; await sut.ExecuteAsync(command); _commonRepositoryMock.Verify(m => m.CreateLetterHeadAsync(It.Is <ILetterHead>(value => value == letterHead)), Times.Once); }