コード例 #1
0
        public void XmlWebServicePostJsonGetJsonHelloWorld()
        {
            Uri    uri  = NormalizeUri("TestWebService.asmx/HelloWorld");
            string json = HttpRequestHelper.AjaxApp(uri, null, null);

            Assert.AreEqual("{\"d\":\"Hello World\"}", json);
        }
コード例 #2
0
        public void XmlWebServicePostJsonGetJsonHelloWorldWithArgsInOut()
        {
            Uri uri = NormalizeUri("TestWebService.asmx/HelloWorldWithArgsInOut");
            Dictionary <string, object> postData = new Dictionary <string, object>();

            postData.Add("args", new { Message = "HI!" });
            string json = HttpRequestHelper.AjaxApp(uri, postData, null);

            Assert.AreEqual("{\"d\":{\"__type\":\"CassiniDev.FixtureExamples.TestWeb.HelloWorldArgs\",\"Message\":\"you said: HI!\"}}", json);
        }