public void PostContentTypeTestLastId() { // arrange RestClient client = RestOperations.ReturnRestClient(baseURL); RestRequest request = RestOperations.ReturnPostRequest(postsEndPoint, lastId); // act IRestResponse response = RestOperations.ExecuteRequest(client, request); // assert Assert.That(response.ContentType, Is.EqualTo(contentType)); }
public void StatusCodeTest(string id, HttpStatusCode expectedHttpStatusCode) { // arrange RestClient client = RestOperations.ReturnRestClient(baseURL); RestRequest request = RestOperations.ReturnPostRequest(postsEndPoint, int.Parse(id)); // act IRestResponse response = RestOperations.ExecuteRequest(client, request); // assert Assert.That(response.StatusCode, Is.EqualTo(expectedHttpStatusCode)); }
public void PostsEndPointDeserializationTest() { // arrange RestClient client = RestOperations.ReturnRestClient(baseURL); RestRequest request = RestOperations.ReturnPostRequest(postsEndPoint, firstId); // act IRestResponse response = RestOperations.ExecuteRequest(client, request); PostsResponse postResponse = DesrializationOperation.PostDeserialize(response); // assert Assert.That(postResponse.ID, Is.EqualTo(firstId)); }
public void PostStatusCodeTestMultipleIds() { for (int idCheck = 1; idCheck <= 100; idCheck = idCheck + 10) { // arrange RestClient client = RestOperations.ReturnRestClient(baseURL); RestRequest request = RestOperations.ReturnPostRequest(postsEndPoint, idCheck); // act IRestResponse response = RestOperations.ExecuteRequest(client, request); // assert Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); } }