public void API_GET_Test() { String endpoint = "/api/v1/employee/2"; Rest rest = new Rest(baseUrl); HTTP_RESPONSE resp = rest.GET(endpoint); Assert.AreEqual(HttpStatusCode.OK, resp.StatusCode, $"Expected Status Code {HttpStatusCode.OK}, Received {resp.StatusCode}"); //We should probably do some more assertions here on the response to check that our GET request was successful. }
public void CreateUser_Password_Less_Than_8_Negative() { String endpoint = "/api/v1/QATest/CreateUser/"; User user = new User(); user.UserName = "******"; user.Password = ConfigurationManager.AppSettings["Password"]; Rest rest = new Rest(baseUrl); HTTP_RESPONSE resp = rest.GET(endpoint); //Need some assertions here to check the response. }
public void CreateUser_Positive() { String endpoint = "/api/v1/QATest/CreateUser/"; User user = new User(); user.UserName = ""; //We should probably make this random somehow so that this test will always pass. If the user name stays the same, this test will only work once. user.Password = ""; Rest rest = new Rest(baseUrl); HTTP_RESPONSE resp = rest.GET(endpoint); Assert.AreEqual(HttpStatusCode.OK, resp.StatusCode, $"Expected Status Code {HttpStatusCode.OK}, Received {resp.StatusCode}"); //We should probably do some more assertions here on the response to check that our GET request was successful. }