示例#1
0
        public void GetComparisonString_NotEqualsNull_ShouldReturnIsNot()
        {
            WhereCondition whereCondition = new WhereCondition("ColumnName", null, Comparison.NotEquals);

            string result = whereCondition.GetComparisonString();

            Assert.AreEqual("IS NOT", result);
        }
示例#2
0
        public void GetComparisonString_Equals_ShouldReturnEquals()
        {
            WhereCondition whereCondition = new WhereCondition("ColumeName", "Value");

            string result = whereCondition.GetComparisonString();

            Assert.AreEqual("=", result);
        }
示例#3
0
        public void GetComparisonString_LessThanOrEqual_ShouldReturnLessThanOrEqual()
        {
            WhereCondition whereCondition = new WhereCondition("ColumnName", "Value", Comparison.LessThanOrEqual);

            string result = whereCondition.GetComparisonString();

            Assert.AreEqual("<=", result);
        }
示例#4
0
        public void GetComparisonString_GreaterTHAN_ShouldReturnGreaterThan()
        {
            WhereCondition whereCondition = new WhereCondition("ColumnName", "Value", Comparison.GreaterThan);

            string result = whereCondition.GetComparisonString();

            Assert.AreEqual(">", result);
        }
示例#5
0
        public void GetComparisonString_NotEquals_ShouldReturnSqlNotEquals()
        {
            WhereCondition whereCondition = new WhereCondition("ColumnName", "Value", Comparison.NotEquals);

            string result = whereCondition.GetComparisonString();

            Assert.AreEqual("<>", result);
        }
示例#6
0
        public void GetComparisonString_Like_ShouldReturnLike()
        {
            WhereCondition whereCondition1 = new WhereCondition("ColumnName", "Value", Comparison.LikeBothSidesWildcard);
            WhereCondition whereCondition2 = new WhereCondition("ColumnName", "Value", Comparison.LikeLeftSideWildcard);
            WhereCondition whereCondition3 = new WhereCondition("ColumnName", "Value", Comparison.LikeRightSideWildcard);

            string result1 = whereCondition1.GetComparisonString();
            string result2 = whereCondition2.GetComparisonString();
            string result3 = whereCondition3.GetComparisonString();

            Assert.AreEqual("LIKE", result1);
            Assert.AreEqual("LIKE", result2);
            Assert.AreEqual("LIKE", result3);
        }