예제 #1
0
        public void TestGetRequestForUpsert()
        {
            RestRequest request = RestRequest.GetRequestForUpsert(TEST_API_VERSION, TEST_OBJECT_TYPE, TEST_EXTERNAL_ID_FIELD, TEST_EXTERNAL_ID, TEST_FIELDS);

            Assert.AreEqual(RestMethod.PATCH, request.Method, "Wrong method");
            Assert.AreEqual(ContentType.JSON, request.ContentType, "Wrong content type");
            Assert.AreEqual("/services/data/" + TEST_API_VERSION + "/sobjects/" + TEST_OBJECT_TYPE + "/" + TEST_EXTERNAL_ID_FIELD + "/" + TEST_EXTERNAL_ID, request.Path, "Wrong path");
            Assert.AreEqual(TEST_FIELDS_string, request.Body, "Wrong request body");
            Assert.IsNull(request.AdditionalHeaders, "Wrong additional headers");
        }