Example #1
0
        public void KeyOptions_Should_Produce_Squirley_Brackets_for_CouchValueMax2()
        {
            var arry   = new KeyOptions(CouchValue.MaxValue, 1);
            var result = arry.ToString();

            Assert.AreEqual("[{},1]", result);
        }
Example #2
0
 public void KeyOptions_Should_Produce_Single_Value_For_A_Single_Array()
 {
     var arry = new KeyOptions();
     arry.Add(1);
     var result = arry.ToString();
     Assert.AreEqual("1", result);
 }
Example #3
0
 public void KeyOptions_Should_Produce_Squirley_Brackets_for_CouchValueMax()
 {
     var arry = new KeyOptions();
     arry.Add(CouchValue.MaxValue);
     arry.Add(1);
     var result = arry.ToString();
     Assert.AreEqual("[{},1]", result);
 }
Example #4
0
 public void KeyOptions_Should_Produce_IsoTime()
 {
     var arry = new KeyOptions();
     arry.Add(CouchValue.MinValue);
     arry.Add(new DateTime(2011,1,1));
     var result = arry.ToString();
     Assert.AreEqual("[null,%222011-01-01T00%3a00%3a00%22]", result);
 }
Example #5
0
 public void KeyOptions_Should_Produce_A_Complex_Array_For_Multiple_Values()
 {
     var arry = new KeyOptions();
     arry.Add(1);
     arry.Add(new DateTime(2011,1,1));
     var result = arry.ToString();
     Assert.AreEqual("[1,%222011-01-01T00%3a00%3a00%22]", result);
 }
Example #6
0
        public void MultipleValues()
        {
            KeyOptions keyOptions = new KeyOptions("somevalue", 1);

            Assert.IsTrue(keyOptions.HasValues);
            Assert.AreEqual(2, keyOptions.Count);
            Assert.AreEqual("[\"somevalue\",1]", keyOptions.ToString());
        }
Example #7
0
        public void SingleStringValue()
        {
            KeyOptions keyOptions = new KeyOptions("somevalue");

            Assert.IsTrue(keyOptions.HasValues);
            Assert.AreEqual(1, keyOptions.Count);
            Assert.AreEqual("\"somevalue\"", keyOptions.ToString());
        }
Example #8
0
        public void EmptyKeyOptionsTest()
        {
            KeyOptions keyOptions = new KeyOptions();

            Assert.IsFalse(keyOptions.HasValues);
            Assert.IsTrue(keyOptions.Count == 0);
            Assert.AreEqual(String.Empty, keyOptions.ToString());
        }
Example #9
0
 public void KeyOptions_Should_Produce_IsoTime()
 {
     var arry = new KeyOptions();
     arry.Add(CouchValue.Empty);
     arry.Add(new DateTime(2011,1,1));
     var result = arry.ToString();
     Assert.AreEqual("[{},\"2011-01-01T00:00:00\"]", result);
 }
Example #10
0
        public void KeyOptions_Should_Produce_Single_Value_For_A_Single_Array()
        {
            var arry = new KeyOptions();

            arry.Add(1);
            var result = arry.ToString();

            Assert.AreEqual("1", result);
        }
Example #11
0
        public void KeyOptions_Should_Produce_IsoTime()
        {
            var arry = new KeyOptions();

            arry.Add(CouchValue.MinValue);
            arry.Add(new DateTime(2011, 1, 1));
            var result = arry.ToString();

            Assert.AreEqual("[null,%222011-01-01T00%3a00%3a00%22]", result);
        }
Example #12
0
        public void KeyOptions_Should_Produce_A_Complex_Array_For_Multiple_Values()
        {
            var arry = new KeyOptions();

            arry.Add(1);
            arry.Add(new DateTime(2011, 1, 1));
            var result = arry.ToString();

            Assert.AreEqual("[1,%222011-01-01T00%3a00%3a00%22]", result);
        }
Example #13
0
 public void KeyOptions_Constructor_Fails()
 {
     var arry   = new KeyOptions(CouchValue.MinValue);
     var result = arry.ToString();
 }
Example #14
0
        public void EmptyObjectTest()
        {
            KeyOptions keyOptions = new KeyOptions("somevalue", new JObject());

            Assert.AreEqual("[\"somevalue\",{}]", keyOptions.ToString());
        }
Example #15
0
        public void SubArrayTest()
        {
            KeyOptions keyOptions = new KeyOptions("somevalue", new JArray(1, 2, 3));

            Assert.AreEqual("[\"somevalue\",[1,2,3]]", keyOptions.ToString());
        }
Example #16
0
 public void KeyOptions_Constructor_Fails()
 {
     var arry = new KeyOptions(CouchValue.MinValue);
     var result = arry.ToString();
 }