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

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

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

            int accountingNumber             = _fixture.Create <int>();
            IDeleteAccountingCommand command = CreateCommandMock(accountingNumber).Object;
            await sut.ExecuteAsync(command);

            _accountingRepositoryMock.Verify(m => m.DeleteAccountingAsync(It.Is <int>(value => value == accountingNumber)), Times.Once);
        }