public async Task TestDescribeGlobalWithUnAuthenticatedClient() { RestResponse response = await _unauthenticatedRestClient.SendAsync(RestRequest.GetRequestForDescribeGlobal(TestCredentials.API_VERSION)); Assert.AreEqual(response.StatusCode.ToString().ToLower(), HttpStatusCode.Unauthorized.ToString().ToLower()); }
public void TestGetRequestForDescribeGlobal() { RestRequest request = RestRequest.GetRequestForDescribeGlobal(TEST_API_VERSION); Assert.AreEqual(HttpMethod.Get, request.Method, "Wrong method"); Assert.AreEqual(ContentTypeValues.None, request.ContentType, "Wrong content type"); Assert.AreEqual("/services/data/" + TEST_API_VERSION + "/sobjects/", request.Path, "Wrong path"); Assert.IsNull(request.RequestBody, "Wrong request body"); Assert.AreEqual(request.AdditionalHeaders.Count, 0); }
public void TestDescribeGlobal() { RestResponse response = _restClient.SendSync(RestRequest.GetRequestForDescribeGlobal(TestCredentials.API_VERSION)); CheckResponse(response, HttpStatusCode.OK, false); JObject jsonResponse = response.AsJObject; CheckKeys(jsonResponse, "encoding", "maxBatchSize", "sobjects"); CheckKeys((JObject)((JArray)jsonResponse["sobjects"])[0], "name", "label", "custom", "keyPrefix"); }
public void TestGetRequestForDescribeGlobal() { RestRequest request = RestRequest.GetRequestForDescribeGlobal(TEST_API_VERSION); Assert.AreEqual(RestMethod.GET, request.Method, "Wrong method"); Assert.AreEqual(ContentType.NONE, request.ContentType, "Wrong content type"); Assert.AreEqual("/services/data/" + TEST_API_VERSION + "/sobjects/", request.Path, "Wrong path"); Assert.IsNull(request.Body, "Wrong request body"); Assert.IsNull(request.AdditionalHeaders, "Wrong additional headers"); }
public async Task TestDescribeGlobal() { var response = await _restClient.SendAsync(RestRequest.GetRequestForDescribeGlobal(new TestCredentials().ApiVersion)); CheckResponse(response, HttpStatusCode.OK, false); JObject jsonResponse = response.AsJObject; CheckKeys(jsonResponse, "encoding", "maxBatchSize", "sobjects"); CheckKeys((JObject)((JArray)jsonResponse["sobjects"])[0], "name", "label", "custom", "keyPrefix"); }