Пример #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);
        }