public async Task TestDescribeWithUnAuthenticatedClient() { RestResponse response = await _unauthenticatedRestClient.SendAsync(RestRequest.GetRequestForDescribe(TestCredentials.API_VERSION, "account")); Assert.AreEqual(response.StatusCode.ToString().ToLower(), HttpStatusCode.Unauthorized.ToString().ToLower()); }
public void TestDescribe() { RestResponse response = _restClient.SendSync(RestRequest.GetRequestForDescribe(TestCredentials.API_VERSION, "account")); CheckResponse(response, HttpStatusCode.OK, false); JObject jsonResponse = response.AsJObject; CheckKeys(jsonResponse, "name", "fields", "urls", "label"); Assert.AreEqual("Account", jsonResponse["name"], "Wrong object name"); }
public void TestGetRequestForDescribe() { RestRequest request = RestRequest.GetRequestForDescribe(TEST_API_VERSION, TEST_OBJECT_TYPE); 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/" + TEST_OBJECT_TYPE + "/describe/", request.Path, "Wrong path"); Assert.IsNull(request.Body, "Wrong request body"); Assert.IsNull(request.AdditionalHeaders, "Wrong additional headers"); }
public void TestGetRequestForDescribe() { RestRequest request = RestRequest.GetRequestForDescribe(TEST_API_VERSION, TEST_OBJECT_TYPE); 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/" + TEST_OBJECT_TYPE + "/describe/", request.Path, "Wrong path"); Assert.IsNull(request.RequestBody, "Wrong request body"); Assert.AreEqual(request.AdditionalHeaders.Count, 0); }
public async Task TestDescribe() { var response = await _restClient.SendAsync(RestRequest.GetRequestForDescribe(new TestCredentials().ApiVersion, "account")); CheckResponse(response, HttpStatusCode.OK, false); JObject jsonResponse = response.AsJObject; CheckKeys(jsonResponse, "name", "fields", "urls", "label"); Assert.AreEqual("Account", jsonResponse["name"], "Wrong object name"); }