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

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

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

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

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