Ejemplo n.º 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
        }
Ejemplo n.º 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);
        }