コード例 #1
0
        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"));
        }
コード例 #2
0
        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(""));
        }