Beispiel #1
0
        static void TestSingleQuery()
        {
            ISDKClient client = Client.Create(new Uri(apiurl));
            BirdInfo   result = null;


            // test-1
            result = client.GetBirdInfo("40298");
            Assert.NotNull(result);
            Assert.AreEqual <string>(result.BirdId, "B0364");
            Assert.AreEqual <string>(result.BirdNo, "40298");
            Assert.AreEqual <string>(result.CommonName, "灰頭花翼");

            // test-2
            result = client.GetBirdInfo("40294");
            Assert.NotNull(result);
            Assert.AreEqual <string>(result.BirdId, "B0286");
            Assert.AreEqual <string>(result.BirdNo, "40294");
            Assert.AreEqual <string>(result.CommonName, "中杜鵑");

            // test-3
            result = client.GetBirdInfo("39350");
            Assert.NotNull(result);
            Assert.AreEqual <string>(result.BirdId, "B0382");
            Assert.AreEqual <string>(result.BirdNo, "39350");
            Assert.AreEqual <string>(result.CommonName, "烏頭翁");
        }
Beispiel #2
0
        static void ListAll_UseSDK()
        {
            //ISDKClient client = Demo.SDK.Client.Create(new Uri("http://demoapiweb20161103110849.azurewebsites.net/"));
            ISDKClient client = Demo.SDK.Client.Create(new Uri("http://localhost:56648"));

            //foreach (var item in (from x in client.GetBirdInfos() where x.BirdNo == "40250" select x))
            //{
            //    ShowBirdInfo(item);
            //    break;
            //}

            ShowBirdInfo(client.GetBirdInfo("40250"));
        }