예제 #1
0
 public async Task ThrowNotFoundExceptionForIdNotExists()
 {
     // Arrange
     DeleteAccountTypeCommand command = new DeleteAccountTypeCommand()
     {
         Id = 100
     };
     DeleteAccountTypeCommandHandler handler = new DeleteAccountTypeCommandHandler(_Database);
     // Act
     await Assert.ThrowsAsync <NotFoundException> (() => handler.Handle(command, CancellationToken.None));
 }
예제 #2
0
 public async Task ThrowsValidationExceptionWhenDeleteingSystemType()
 {
     // Arrange
     DeleteAccountTypeCommand command = new DeleteAccountTypeCommand()
     {
         Id = 10
     };
     DeleteAccountTypeCommandHandler handler = new DeleteAccountTypeCommandHandler(_Database);
     // Act
     await Assert.ThrowsAsync <ValidationException> (() => handler.Handle(command, CancellationToken.None));
 }
예제 #3
0
        public async Task DeleteAccountTypeSuccessfuly()
        {
            // Arrange
            DeleteAccountTypeCommand command = new DeleteAccountTypeCommand()
            {
                Id = 6
            };
            DeleteAccountTypeCommandHandler handler = new DeleteAccountTypeCommandHandler(_Database);
            // Act
            var result = await handler.Handle(command, CancellationToken.None);

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