示例#1
0
        public void PatchStreamWithoutContentWithoutBaseTest()
        {
            WebServiceDriver client = new WebServiceDriver(new Uri(url));
            var result = client.PatchWithResponse("/api/String/Patch/1", "text/plain", "Test", Encoding.UTF8, "text/plain", false, true);

            Assert.AreEqual(HttpStatusCode.OK, result.StatusCode);
        }
示例#2
0
        public void PatchJSONWithoutBaseTest()
        {
            WebServiceDriver client = new WebServiceDriver(new Uri(url));
            ProductJson      p      = new ProductJson();

            p.Category = "ff";
            p.Id       = 4;
            p.Name     = "ff";
            p.Price    = 3.25f;
            var content = WebServiceUtils.MakeStringContent <ProductJson>(p, Encoding.UTF8, "application/json");
            var result  = client.PatchWithResponse("/api/XML_JSON/Patch/1", "application/json", content, true);

            Assert.AreEqual(HttpStatusCode.OK, result.StatusCode);
        }