예제 #1
0
        public void Test_0001_And_1()
        {
            KiiClause c = KiiClause.And(
                KiiClause.Equals("name", "kii")
                );

            Assert.AreEqual("{\"type\":\"eq\",\"field\":\"name\",\"value\":\"kii\"}", c.ToJson().ToString());
        }
예제 #2
0
 public void Test_0011_And_null()
 {
     KiiClause.And(
         KiiClause.Equals("name", "kii"),
         null,
         KiiClause.GreaterThan("score", 100),
         null
         );
 }
예제 #3
0
        public void Test_0000_And()
        {
            KiiClause c = KiiClause.And(
                KiiClause.Equals("name", "kii"),
                KiiClause.GreaterThan("score", 100)
                );

            Assert.AreEqual("{\"type\":\"and\",\"clauses\":[" +
                            "{\"type\":\"eq\",\"field\":\"name\",\"value\":\"kii\"}," +
                            "{\"type\":\"range\",\"field\":\"score\",\"lowerLimit\":100,\"lowerIncluded\":false}]}", c.ToJson().ToString());
        }
예제 #4
0
        public void NotAndTest()
        {
            KiiBucket bucket = KiiUser.CurrentUser.Bucket("my_bucket");
            KiiObject obj1   = bucket.NewKiiObject();

            obj1["name"] = "foo";
            obj1["age"]  = 20;
            obj1.Save();
            KiiObject obj2 = bucket.NewKiiObject();

            obj2["name"] = "foo";
            obj2["age"]  = 33;
            obj2.Save();

            KiiQuery query = new KiiQuery(KiiClause.Not(KiiClause.And(KiiClause.Equals("name", "foo"), KiiClause.LessThan("age", 30))));

            query.SortByAsc("name");

            KiiQueryResult <KiiObject> results = bucket.Query(query);

            Assert.AreEqual(1, results.Count);
            Assert.AreEqual(33, results[0].GetInt("age"));
        }
예제 #5
0
 public void Test_0002_And_0()
 {
     KiiClause.And();
 }