public async Task ExecuteAsync_WhenCalled_AssertToDomainWasCalledOnCommand() { CommandHandler sut = CreateSut(); Mock <IUpdateCountryCommand> commandMock = CreateCommandMock(); await sut.ExecuteAsync(commandMock.Object); commandMock.Verify(m => m.ToDomain(), Times.Once); }
public async Task ExecuteAsync_WhenCalled_AssertUpdateCountryAsyncWasCalledOnContactRepository() { CommandHandler sut = CreateSut(); ICountry country = _fixture.BuildCountryMock().Object; IUpdateCountryCommand command = CreateCommandMock(country).Object; await sut.ExecuteAsync(command); _contactRepositoryMock.Verify(m => m.UpdateCountryAsync(It.Is <ICountry>(value => value == country)), Times.Once); }