public void GetUserTest() { var controller = new UserManagementController(); controller.Request = new HttpRequestMessage(); controller.Configuration = new HttpConfiguration(); var response = controller.Get(1); Assert.AreEqual(response.UserID, 1); Assert.AreEqual("Riyaz", response.FirstName); }
public void GetAllUsersTest() { var controller = new UserManagementController(); controller.Request = new HttpRequestMessage(); controller.Configuration = new HttpConfiguration(); var response = controller.Get(); Assert.IsNotEmpty(response); }
public void UpdateUserTest() { var controller = new UserManagementController(); controller.Request = new HttpRequestMessage(); controller.Configuration = new HttpConfiguration(); var user = controller.Get(1); user.EmployeeID = 456789; string result = controller.Put(user); Assert.AreEqual("Record updated Successfully", result); }