Пример #1
0
        public void ThrowNotFoundExceptionWhenProvidedInvalidId()
        {
            // Arrange
            handler = new UpdateLedgerStatusCommandHandler(_Database);
            UpdateLedgerStatusCommand command = new UpdateLedgerStatusCommand()
            {
                Id     = 2,
                Posted = 1
            };

            // Assert
            Assert.ThrowsAsync <NotFoundException> (() => handler.Handle(command, CancellationToken.None));
        }
Пример #2
0
        public async Task UpdateLedgerEntryStatusSuccessfuly()
        {
            // Arrange
            handler = new UpdateLedgerStatusCommandHandler(_Database);
            UpdateLedgerStatusCommand command = new UpdateLedgerStatusCommand()
            {
                Id     = 10,
                Posted = 1
            };
            // Act
            var result = await handler.Handle(command, CancellationToken.None);

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