Example #1
0
        public void ThrowNotFoundExceptionWhenProvidedNonExistingAccountId()
        {
            // Arrange
            UpdateAccountTypeCommand command = new UpdateAccountTypeCommand()
            {
                Id       = 100,
                Type     = "Account Payable",
                IsTypeOf = 12
            };
            UpdateAccountTypeCommandHandler handler = new UpdateAccountTypeCommandHandler(_Database);

            Assert.ThrowsAsync <NotFoundException> (() => handler.Handle(command, CancellationToken.None));

            // Assert
        }
Example #2
0
        public async Task UpdateAccountTypeSuccessfuly()
        {
            // Arrange
            UpdateAccountTypeCommand command = new UpdateAccountTypeCommand()
            {
                Id       = 6,
                Type     = "Account Payable",
                IsTypeOf = 12
            };
            UpdateAccountTypeCommandHandler handler = new UpdateAccountTypeCommandHandler(_Database);
            // Act
            var result = await handler.Handle(command, CancellationToken.None);

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