public void Clone() { SqlPredicate p; SqlPredicate p1; p = new SqlPredicate("@PH"); p1 = p.Clone(); Assert.That(p.ToString(), Is.EqualTo("@PH")); Assert.That(p1.ToString(), Is.EqualTo("@PH")); p1.Place("PH", "x=1"); Assert.That(p.ToString(), Is.EqualTo("@PH")); Assert.That(p1.ToString(), Is.EqualTo("x=1")); }
public void Empty() { SqlPredicate p = new SqlPredicate(); Assert.That(p.And(p).ToString(), Is.EqualTo("")); Assert.That(p.Clone().ToString(), Is.EqualTo("")); Assert.That(p.GetAllPlaceHolders(), Is.EqualTo(new string[] { })); Assert.That(p.HasUnplacedHolder("T"), Is.False); Assert.That(p.HasUnplacedHolders(), Is.False); Assert.That(p.IsEmpty, Is.True); Assert.That(p.IsPlaceHolderOnly, Is.False); p.Place("PH", "a=1"); Assert.That(p.ToString(), Is.EqualTo("")); }