public async Task ExecuteAsync_WhenCalled_AssertToDomainWasCalledOnCommand() { CommandHandler sut = CreateSut(); Mock <ICreateBudgetAccountGroupCommand> commandMock = CreateCommandMock(); await sut.ExecuteAsync(commandMock.Object); commandMock.Verify(m => m.ToDomain(), Times.Once); }
public async Task ExecuteAsync_WhenCalled_AssertCreateBudgetAccountGroupAsyncWasCalledOnAccountingRepository() { CommandHandler sut = CreateSut(); IBudgetAccountGroup budgetAccountGroup = _fixture.BuildBudgetAccountGroupMock().Object; ICreateBudgetAccountGroupCommand command = CreateCommandMock(budgetAccountGroup).Object; await sut.ExecuteAsync(command); _accountingRepositoryMock.Verify(m => m.CreateBudgetAccountGroupAsync(It.Is <IBudgetAccountGroup>(value => value == budgetAccountGroup)), Times.Once); }