public async Task ExecuteAsync_WhenCalled_AssertToDomainWasCalledOnCommand() { CommandHandler sut = CreateSut(); Mock <ICreateContactGroupCommand> commandMock = CreateCommandMock(); await sut.ExecuteAsync(commandMock.Object); commandMock.Verify(m => m.ToDomain(), Times.Once); }
public async Task ExecuteAsync_WhenCalled_AssertCreateContactGroupAsyncWasCalledOnContactRepository() { CommandHandler sut = CreateSut(); IContactGroup contactGroup = _fixture.BuildContactGroupMock().Object; ICreateContactGroupCommand command = CreateCommandMock(contactGroup).Object; await sut.ExecuteAsync(command); _contactRepositoryMock.Verify(m => m.CreateContactGroupAsync(It.Is <IContactGroup>(value => value == contactGroup)), Times.Once); }