Exemplo n.º 1
0
        public void ThrowNotFoundException()
        {
            // Arrange
            handler = new DeleteLedgerEntryCommandHandler(_Database);
            DeleteLedgerEntryCommand command = new DeleteLedgerEntryCommand()
            {
                Id = 2
            };

            // Assert
            Assert.ThrowsAsync <NotFoundException> (() => handler.Handle(command, CancellationToken.None));
        }
Exemplo n.º 2
0
        public async Task DeleteLedgerEntrySuccessfuly()
        {
            // Arrange
            handler = new DeleteLedgerEntryCommandHandler(_Database);
            DeleteLedgerEntryCommand command = new DeleteLedgerEntryCommand()
            {
                Id = 10
            };
            // Act
            var result = await handler.Handle(command, CancellationToken.None);

            // Assert
            Assert.Equal(Unit.Value, result);
        }