Example #1
0
        public void Test_0140_NotEqual_string()
        {
            KiiClause c = KiiClause.NotEquals("name", "kii");

            Assert.AreEqual("{\"type\":\"not\",\"clause\":{\"type\":\"eq\",\"field\":\"name\",\"value\":\"kii\"}}", c.ToJson().ToString());
        }
Example #2
0
        public void Test_0120_NotEqual_double()
        {
            KiiClause c = KiiClause.NotEquals("score", 1.234);

            Assert.AreEqual("{\"type\":\"not\",\"clause\":{\"type\":\"eq\",\"field\":\"score\",\"value\":1.234}}", c.ToJson().ToString());
        }
Example #3
0
        public void Test_0131_NotEqual_bool_false()
        {
            KiiClause c = KiiClause.NotEquals("enable", false);

            Assert.AreEqual("{\"type\":\"not\",\"clause\":{\"type\":\"eq\",\"field\":\"enable\",\"value\":false}}", c.ToJson().ToString());
        }
Example #4
0
        public void Test_0110_NotEqual_long()
        {
            KiiClause c = KiiClause.NotEquals("score", (long)1234567890123);

            Assert.AreEqual("{\"type\":\"not\",\"clause\":{\"type\":\"eq\",\"field\":\"score\",\"value\":1234567890123}}", c.ToJson().ToString());
        }
Example #5
0
        public void Test_0000_Equal_int()
        {
            KiiClause c = KiiClause.Equals("score", 10);

            Assert.AreEqual("{\"type\":\"eq\",\"field\":\"score\",\"value\":10}", c.ToJson().ToString());
        }
Example #6
0
        public void Test_0204_In_int_array()
        {
            int[]     values = { 1, 2, 3 };
            KiiClause c      = KiiClause.InWithIntValue("score", values);

            Assert.AreEqual("{\"type\":\"in\",\"field\":\"score\",\"values\":[1,2,3]}", c.ToJson().ToString());
        }
Example #7
0
        public void Test_0100_Or()
        {
            KiiClause c = KiiClause.Or(
                KiiClause.Equals("name", "kii"),
                KiiClause.GreaterThan("score", 100)
                );

            Assert.AreEqual("{\"type\":\"or\",\"clauses\":[" +
                            "{\"type\":\"eq\",\"field\":\"name\",\"value\":\"kii\"}," +
                            "{\"type\":\"range\",\"field\":\"score\",\"lowerLimit\":100,\"lowerIncluded\":false}]}", c.ToJson().ToString());
        }
Example #8
0
        public void Test_0501_In_string_1()
        {
            KiiClause c = KiiClause.InWithStringValue("name", "kii");

            Assert.AreEqual("{\"type\":\"in\",\"field\":\"name\",\"values\":[\"kii\"]}", c.ToJson().ToString());
        }
Example #9
0
        public void Test_0504_In_string_array()
        {
            string[]  values = { "kaa", "kii", "kuu" };
            KiiClause c      = KiiClause.InWithStringValue("name", values);

            Assert.AreEqual("{\"type\":\"in\",\"field\":\"name\",\"values\":[\"kaa\",\"kii\",\"kuu\"]}", c.ToJson().ToString());
        }
Example #10
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());
        }
Example #11
0
        public void Test_0404_In_double_array()
        {
            double[]  values = { 1, 23.45, 3 };
            KiiClause c      = KiiClause.InWithDoubleValue("score", values);

            Assert.AreEqual("{\"type\":\"in\",\"field\":\"score\",\"values\":[1,23.45,3]}", c.ToJson().ToString());
        }
Example #12
0
        public void Test_0401_In_double_1()
        {
            KiiClause c = KiiClause.InWithDoubleValue("score", 1);

            Assert.AreEqual("{\"type\":\"in\",\"field\":\"score\",\"values\":[1]}", c.ToJson().ToString());
        }
Example #13
0
        public void Test_0304_In_long_array()
        {
            long[]    values = { 1, 1234567890123, 3 };
            KiiClause c      = KiiClause.InWithLongValue("score", values);

            Assert.AreEqual("{\"type\":\"in\",\"field\":\"score\",\"values\":[1,1234567890123,3]}", c.ToJson().ToString());
        }
Example #14
0
        public void Test_0300_In_long()
        {
            KiiClause c = KiiClause.InWithLongValue("score", 1, (long)1234567890123, 3);

            Assert.AreEqual("{\"type\":\"in\",\"field\":\"score\",\"values\":[1,1234567890123,3]}", c.ToJson().ToString());
        }
Example #15
0
        public void Test_0200_GreaterThan_int()
        {
            KiiClause c = KiiClause.GreaterThan("score", 10);

            Assert.AreEqual("{\"type\":\"range\",\"field\":\"score\",\"lowerLimit\":10,\"lowerIncluded\":false}", c.ToJson().ToString());
        }
Example #16
0
        public void Test_0010_And_array()
        {
            KiiClause[] arr = new KiiClause[] {
                KiiClause.Equals("name", "kii"),
                KiiClause.GreaterThan("score", 100)
            };

            KiiClause c = KiiClause.And(arr);

            Assert.AreEqual("{\"type\":\"and\",\"clauses\":[" +
                            "{\"type\":\"eq\",\"field\":\"name\",\"value\":\"kii\"}," +
                            "{\"type\":\"range\",\"field\":\"score\",\"lowerLimit\":100,\"lowerIncluded\":false}]}", c.ToJson().ToString());
        }
Example #17
0
        public void Test_0210_GreaterThan_long()
        {
            KiiClause c = KiiClause.GreaterThan("score", (long)1234567890123);

            Assert.AreEqual("{\"type\":\"range\",\"field\":\"score\",\"lowerLimit\":1234567890123,\"lowerIncluded\":false}", c.ToJson().ToString());
        }
Example #18
0
        public void Test_0200_In_int()
        {
            KiiClause c = KiiClause.InWithIntValue("score", 1, 2, 3);

            Assert.AreEqual("{\"type\":\"in\",\"field\":\"score\",\"values\":[1,2,3]}", c.ToJson().ToString());
        }