コード例 #1
0
        public async Task TestDescribeGlobalWithUnAuthenticatedClient()
        {
            RestResponse response =
                await _unauthenticatedRestClient.SendAsync(RestRequest.GetRequestForDescribeGlobal(TestCredentials.API_VERSION));

            Assert.AreEqual(response.StatusCode.ToString().ToLower(), HttpStatusCode.Unauthorized.ToString().ToLower());
        }
コード例 #2
0
        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);
        }
コード例 #3
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");
        }
コード例 #4
0
        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");
        }
コード例 #5
0
        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");
        }