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

            Assert.AreEqual("\"Patched\"", result);
        }
示例#2
0
        public void PatchStringWithoutBaseTest()
        {
            WebServiceDriver client = new WebServiceDriver(new Uri(url));
            var content             = WebServiceUtils.MakeStringContent("Test", Encoding.UTF8, "text/plain");
            var result = client.Patch("/api/String/Patch/1", "text/plain", content, true);

            Assert.AreEqual("\"Patched\"", result);
        }
示例#3
0
        public void PatchJSONWithTypeWithoutBaseTest()
        {
            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.Patch <ProductJson>("/api/XML_JSON/Patch/1", "application/json", content, true);

            Assert.AreEqual(p.Category, result.Category);
            Assert.AreEqual(p.Id, result.Id);
            Assert.AreEqual(p.Name, result.Name);
            Assert.AreEqual(p.Price, result.Price);
        }