Exemple #1
0
        public void afterAddingWhere_HasAddedConstraint_WhereAddedWithBooleanValue()
        {
            DbStringBuilder builder = new DbStringBuilder();
            string          key     = "Id";
            bool            value   = true;

            builder.AddWhere(key, value);

            string expected = "Id = 1";

            Assert.IsTrue(builder.HasWhere(expected));
        }
Exemple #2
0
        public void afterAddingWhere_HasAddedConstraint_WhereAddedWithDoubleValue()
        {
            DbStringBuilder builder = new DbStringBuilder();
            string          key     = "Id";
            double          value   = 1.234567;

            builder.AddWhere(key, value);

            string expected = "Id = 1.23457";

            Assert.IsTrue(builder.HasWhere(expected));
        }
Exemple #3
0
        public void afterAddingWhere_HasAddedConstraint_WhereAddedWithDateValue()
        {
            DbStringBuilder builder = new DbStringBuilder();
            string          key     = "Id";
            DateTime        value   = new DateTime(2017, 4, 21);

            builder.AddWhere(key, value);

            string expected = "Id = '2017-04-21 00:00:00'";

            Assert.IsTrue(builder.HasWhere(expected));
        }
Exemple #4
0
        public void afterAddingWhere_HasAddedConstraint_WhereAddedWithStringValue()
        {
            DbStringBuilder builder = new DbStringBuilder();
            string          key     = "Id";
            string          value   = "abc";

            builder.AddWhere(key, value);

            string expected = "Id = 'abc'";

            Assert.IsTrue(builder.HasWhere(expected));
        }