예제 #1
0
        public async Task ThrowsNotFoundException()
        {
            // Arrange

            DeleteAccountCategoryCommandHandler handler = new DeleteAccountCategoryCommandHandler(_Database);
            // Act
            await Assert.ThrowsAsync <NotFoundException> (() => handler.Handle(new DeleteAccountCategoryCommand()
            {
                Id = 2
            }, CancellationToken.None));

            // Assert
        }
예제 #2
0
        public async Task DeleteAccountSuccessfully()
        {
            //Given
            DeleteAccountCategoryCommandHandler handler = new DeleteAccountCategoryCommandHandler(_Database);

            //When
            var result = await handler.Handle(new DeleteAccountCategoryCommand()
            {
                Id = 10
            }, CancellationToken.None);

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