public void ThenUsersInfoIsReceived()
        {
            Url usersPageUrl = ApiUrl.usersUrl.SetQueryParam("page", _pages.Page);

            RestRequest restRequest = new RestRequest(usersPageUrl);

            restRequest.AddHeader("Accept", "application/json");
            restRequest.RequestFormat = DataFormat.Json;

            _response = _restClient.Execute(restRequest);

            MultiplyJsonResponce deserialize = JsonConvert.DeserializeObject <MultiplyJsonResponce>(_response.Content);

            Assert.IsNotNull(deserialize.Page);
            Assert.IsNotNull(deserialize.PerPage);
            Assert.IsNotNull(deserialize.Total);
            Assert.IsNotNull(deserialize.TotalPages);
        }
示例#2
0
        public void ThenResourcesIsReceived()
        {
            RestRequest restRequest = new RestRequest(ApiUrl.resourceUrl);

            restRequest.AddHeader("Accept", "application/json");
            restRequest.RequestFormat = DataFormat.Json;
            _response = _restClient.Execute(restRequest);

            Assert.AreEqual(HttpStatusCode.OK, _response.StatusCode);

            MultiplyJsonResponce deserialize = JsonConvert.DeserializeObject <MultiplyJsonResponce>(_response.Content);

            Assert.IsNotNull(deserialize.Page);
            Assert.IsNotNull(deserialize.PerPage);
            Assert.IsNotNull(deserialize.Total);
            Assert.IsNotNull(deserialize.TotalPages);

            Assert.IsNotNull(deserialize.Data);
            Assert.IsTrue(deserialize.Data.Any());

            UserInfoDataResponce resource = deserialize.Data.FirstOrDefault();

            Assert.IsNotNull(resource.Id);
        }