public async Task ThrowsNotFoundException() { // Arrange DeleteAccountCategoryCommandHandler handler = new DeleteAccountCategoryCommandHandler(_Database); // Act await Assert.ThrowsAsync <NotFoundException> (() => handler.Handle(new DeleteAccountCategoryCommand() { Id = 2 }, CancellationToken.None)); // Assert }
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); }