示例#1
0
        public void getValue_returnEmptyString_ForNonexistingItem()
        {
            DbStringBuilder builder = new DbStringBuilder();
            string          key     = "a";
            string          actual  = builder.getValue(key);

            Assert.IsNull(actual);
        }
示例#2
0
        public void afterAddingElementByKeyAndDatetimeValue_DictionaryHasThisElement()
        {
            DbStringBuilder builder  = new DbStringBuilder();
            string          key      = "key";
            DateTime        added    = new DateTime(2017, 4, 21);
            string          expected = "'2017-04-21 00:00:00'";

            builder.Add(key, added);
            string value = builder.getValue(key);

            Assert.AreEqual(expected, value);
        }
示例#3
0
        public void afterAddingElementByKeyAndBooleanValue_DictionaryHasThisElement()
        {
            DbStringBuilder builder  = new DbStringBuilder();
            string          key      = "key";
            bool            added    = true;
            string          expected = "1";

            builder.Add(key, added);
            string value = builder.getValue(key);

            Assert.AreEqual(expected, value);
        }
示例#4
0
        public void afterAddingElementByKeyAndDoubleValue_DictionaryHasThisElement()
        {
            DbStringBuilder builder  = new DbStringBuilder();
            string          key      = "key";
            double          added    = 1.23456789;
            string          expected = "1.23457";

            builder.Add(key, added);
            string value = builder.getValue(key);

            Assert.AreEqual(expected, value);
        }
示例#5
0
        public void afterAddingElementByKeyAndExpression_DictionaryHasThisElement()
        {
            DbStringBuilder builder    = new DbStringBuilder();
            string          key        = "key";
            string          expression = "NOW()";
            string          expected   = "NOW()";

            builder.AddExpression(key, expression);
            string value = builder.getValue(key);

            Assert.AreEqual(expected, value);
        }
示例#6
0
        public void getValue_returnProperValue_ForExistingItem()
        {
            DbStringBuilder builder  = new DbStringBuilder();
            string          key      = "a";
            int             value    = 1;
            string          expected = "1";

            builder.Add(key, value);
            string actual = builder.getValue(key);

            Assert.AreEqual(expected, actual);
        }