예제 #1
0
        public void Clone()
        {
            var item = new WhereItem("field1", "a string");
            var clone = item.Clone();

            Assert.AreEqual(item, clone);
            clone.Value = "something-else";
            Assert.AreNotEqual(item, clone);
            clone.Value = "a string";
            Assert.AreEqual(item, clone);

            var parm = new QueryParameter("someparm", "testvalue");
            var item2 = new WhereString("field2=@someparm or field3='value'", parm);

            var clause = new WhereClause(JoinType.And,item, item2);
            var clone2 = clause.Clone();
            Assert.AreEqual(clause, clone2);
            parm.Value = "testvalue2";
            Assert.AreNotEqual(clause, clone2);
            parm.Value = "testvalue";
            Assert.AreEqual(clause, clone2);

            item.Value = "n";
            Assert.AreNotEqual(clause, clone2);
            item.Value = "a string";
            Assert.AreEqual(clause, clone2);
        }
예제 #2
0
파일: WhereItem.cs 프로젝트: jamietre/IQMap
        public void Clone()
        {
            var item = new WhereItem("field1","a string");
            var clone = item.Clone();

            Assert.AreEqual(item,clone);
            clone.Value="something-else";
            Assert.AreNotEqual(item,clone);
            clone.Value = "a string";
            Assert.AreEqual(item,clone);
        }