Exemple #1
0
        public async Task ExecuteAsync_WhenCalled_AssertToDomainWasCalledOnCommand()
        {
            CommandHandler sut = CreateSut();

            Mock <IUpdatePaymentTermCommand> commandMock = CreateCommandMock();
            await sut.ExecuteAsync(commandMock.Object);

            commandMock.Verify(m => m.ToDomain(), Times.Once);
        }
Exemple #2
0
        public async Task ExecuteAsync_WhenCalled_AssertUpdatePaymentTermAsyncWasCalledOnAccountingRepository()
        {
            CommandHandler sut = CreateSut();

            IPaymentTerm paymentTerm          = _fixture.BuildPaymentTermMock().Object;
            IUpdatePaymentTermCommand command = CreateCommandMock(paymentTerm).Object;
            await sut.ExecuteAsync(command);

            _accountingRepositoryMock.Verify(m => m.UpdatePaymentTermAsync(It.Is <IPaymentTerm>(value => value == paymentTerm)), Times.Once);
        }