public UserControllerTest() { _dbContext = new Mock <DatabaseContext>(); _controller = new TestUserController(); _dbContext.Setup(i => i.GetUserResponse(It.IsAny <int>())).Returns(GetValidUserResponse()); _controller.DBContext = _dbContext.Object; }
public bool DeleteUser(User userToDelete) { bool status = false; TestUserController controller = new TestUserController(); _db.Remove(userToDelete); if (SaveChanges()) { status = true; } return(status); }