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()); }
public void Test_0011_And_null() { KiiClause.And( KiiClause.Equals("name", "kii"), null, KiiClause.GreaterThan("score", 100), null ); }
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()); }
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")); }
public void Test_0002_And_0() { KiiClause.And(); }