Exemplo n.º 1
0
        public void RenderPatternPredicate()
        {
            Column             column             = new Column("Column1");
            StringLiteralValue stringLiteralValue = new StringLiteralValue("%Value1%");
            PatternPredicate   patternPredicate   = new PatternPredicate(column, stringLiteralValue);

            Assert.AreEqual("[Column1] LIKE '%Value1%'", sqlClientRenderer.Render(patternPredicate));
        }
Exemplo n.º 2
0
        public void CreatePatternPredicate()
        {
            Column             column             = new Column("Column1");
            StringLiteralValue stringLiteralValue = new StringLiteralValue("Value1");
            PatternPredicate   patternPredicate   = new PatternPredicate(column, stringLiteralValue);

            Assert.AreEqual(column, patternPredicate.Expression);
            Assert.IsNull(patternPredicate.NotModifier);
            Assert.AreEqual(stringLiteralValue, patternPredicate.Pattern);
        }
Exemplo n.º 3
0
        public override string Render(PatternPredicate patternPredicate)
        {
            StringBuilder text = new StringBuilder();

            text.AppendFormat("{0} ", patternPredicate.Expression.Render(this));

            if (patternPredicate.NotModifier != null)
            {
                text.AppendFormat("{0} ", patternPredicate.NotModifier.Render(this));
            }

            text.AppendFormat("LIKE {0} ", patternPredicate.Pattern.Render(this));

            return(text.ToString().Trim());
        }
Exemplo n.º 4
0
 public abstract string Render(PatternPredicate patternPredicate);