Esempio n. 1
0
        public void VerifyHTTPResponseBody()
        {
            var    json        = RestAPIUtil.GetResponseBody(Config.UrlToJSON);
            JArray jsonObjects = JArray.Parse(json);

            Assert.IsTrue(jsonObjects.Count == int.Parse(Config.CountOfUsers), Resource.IncorectCountofUserInJSON);
        }
Esempio n. 2
0
        public void VerifyHTTPResponseHeader()
        {
            var response = RestAPIUtil.GetResponse(Config.UrlToJSON);

            var contentTypeOfResponse = response.GetResponseHeader("Content-Type");

            var softAssert = new SoftAssertions();

            softAssert.That(!string.IsNullOrWhiteSpace(contentTypeOfResponse), Resource.ContentTypeIsNull);
            softAssert.That(contentTypeOfResponse.Equals(Resource.ValueOfContentType, StringComparison.InvariantCultureIgnoreCase), string.Format(Resource.IncorrectContentType, Resource.ValueOfContentType));
            softAssert.AssertAll();
        }
Esempio n. 3
0
        public void VerifyStatusCode()
        {
            var response = RestAPIUtil.GetResponse(Config.UrlToJSON);

            Assert.IsTrue(response.StatusCode == HttpStatusCode.OK, Resource.IncorrectStatusCode);
        }