Example #1
0
        public void testCloneIsDeepClone()
        {
            TreeFilter a = new AlwaysCloneTreeFilter();

            Assert.AreNotSame(a, a.Clone());
            TreeFilter n = NotTreeFilter.create(a);

            Assert.AreNotSame(n, n.Clone());
        }
Example #2
0
        public void testCloneIsSparseWhenPossible()
        {
            TreeFilter a = TreeFilter.ALL;

            Assert.AreSame(a, a.Clone());
            TreeFilter n = NotTreeFilter.create(a);

            Assert.AreSame(n, n.Clone());
        }
Example #3
0
        public override TreeFilter Clone()
        {
            TreeFilter n = a.Clone();

            return(n == a ? this : new NotTreeFilter(n));
        }