Esempio n. 1
0
        public async Task ExecuteAsync_WhenCalled_AssertToDomainWasCalledOnCommand()
        {
            CommandHandler sut = CreateSut();

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

            commandMock.Verify(m => m.ToDomain(It.Is <ICommonRepository>(value => value == _commonRepositoryMock.Object)), Times.Once);
        }
Esempio n. 2
0
        public async Task ExecuteAsync_WhenCalled_AssertUpdateAccountingAsyncWasCalledOnAccountingRepository()
        {
            CommandHandler sut = CreateSut();

            IAccounting accounting           = _fixture.BuildAccountingMock().Object;
            IUpdateAccountingCommand command = CreateCommandMock(accounting).Object;
            await sut.ExecuteAsync(command);

            _accountingRepositoryMock.Verify(m => m.UpdateAccountingAsync(It.Is <IAccounting>(value => value == accounting)), Times.Once);
        }