예제 #1
0
        public void TestBatchDeleteAttributes()
        {
            List<ReplaceableAttribute> list = new List<ReplaceableAttribute> ();
            list.Add (new ReplaceableAttribute ("Test", "Test", true));

            List<ReplaceableItem> items = new List<ReplaceableItem> ();
            ReplaceableItem item0 = new ReplaceableItem ("0", list);
            items.Add (item0);
            ReplaceableItem item1 = new ReplaceableItem ("1", list);
            items.Add (item1);

            BatchPutAttributesRequest request = new BatchPutAttributesRequest ("Test", items);
            BatchPutAttributesResponse response = Client.BatchPutAttributes (request).Result;
            Assert.AreEqual (HttpStatusCode.OK, response.HttpStatusCode);

            List<Attribute> list2 = new List<Attribute> ();
            list2.Add (new Attribute ("Test", "Test"));
            List<Item> items2 = new List<Item> ();
            items2.Add (new Item ("0", list2.ToArray ()));
            items2.Add (new Item ("1", list2.ToArray ()));

            BatchDeleteAttributesRequest request2 = new BatchDeleteAttributesRequest ("Test", items2);
            BatchDeleteAttributesResponse response2 = Client.BatchDeleteAttributes (request2).Result;
            Assert.AreEqual (HttpStatusCode.OK, response2.HttpStatusCode);
        }
예제 #2
0
        public void TestSelectRequest()
        {
            List<ReplaceableAttribute> list = new List<ReplaceableAttribute> ();
            list.Add (new ReplaceableAttribute ("Test", "true", true));

            List<ReplaceableItem> items = new List<ReplaceableItem> ();
            ReplaceableItem item0 = new ReplaceableItem ("0", list);
            items.Add (item0);
            ReplaceableItem item1 = new ReplaceableItem ("1", list);
            items.Add (item1);
            BatchPutAttributesRequest request = new BatchPutAttributesRequest ("Test", items);
            BatchPutAttributesResponse response = Client.BatchPutAttributes (request).Result;
            Assert.AreEqual (HttpStatusCode.OK, response.HttpStatusCode);

            SelectRequest request2 = new SelectRequest ("select * from Test where Test = 'true'", true);
            SelectResponse response2 = Client.Select (request2).Result;

            Assert.AreEqual ("Test", response2.SelectResult.Item [0].Attribute [0].Name);
            Assert.AreEqual ("true", response2.SelectResult.Item [0].Attribute [0].Value);
            Assert.AreEqual ("Test", response2.SelectResult.Item [1].Attribute [0].Name);
            Assert.AreEqual ("true", response2.SelectResult.Item [1].Attribute [0].Value);
            Assert.AreEqual (HttpStatusCode.OK, response2.HttpStatusCode);
        }