public async Task Handle_InvalidDeleteUserByIdRequest_ReturnsNull() { var request = new DeleteUserByIdRequest { Id = 100 }; var response = await Mediator.HandleAsync(request); Assert.IsFalse(response.HasErrors); Assert.IsFalse(Context.Set <User>().First().IsDeleted); Assert.IsNull(response.Data); }
public async Task Handle_DeleteUserByIdRequest_DeletesUser() { var request = new DeleteUserByIdRequest { Id = _user.Id }; var response = await Mediator.HandleAsync(request); Assert.IsFalse(response.HasErrors); Assert.IsNotNull(response.Data); Assert.IsTrue(response.Data.IsDeleted); }