Esempio n. 1
0
        public void ConstructMethodTestPut()
        {
            const String EXPECTED = "method=PUT";

            IList<String> expected = new List<String>();
            expected.Add(EXPECTED);

            IStretchrRequest target = new StretchrRequest<String>(new StretchrClient(), response => { }, (request, statusCode, exception) => { });

            target.UseHttpMethod(System.Net.Http.HttpMethod.Put);

            PrivateObject privateTarget = new PrivateObject(target);

            privateTarget.Invoke("ConstructMethod");

            IList<String> actual = (IList<String>)privateTarget.GetField("_queryStringFieldValuesList");

            Assert.IsNotNull(actual);
            Assert.AreEqual(expected.Count, actual.Count);
            Assert.AreEqual(expected[0], actual[0]);
        }
Esempio n. 2
0
        public void UseHttpMethodTest()
        {
            System.Net.Http.HttpMethod expectedHttpMethod = System.Net.Http.HttpMethod.Get;

            StretchrRequest<String> target = new StretchrRequest<String>(new StretchrClient(), response => { }, (request, statusCode, exception) => { });
            target.UseHttpMethod(expectedHttpMethod);

            System.Net.Http.HttpMethod actual = target.HttpMethodOverride;

            Assert.AreEqual(expectedHttpMethod, actual);
        }