示例#1
0
 public void CopiesBranches()
 {
     var source = new CellTreeLeaf("root");
     source.AddBranchValue(new CellTreeLeaf("leafa"));
     source.AddBranchValue(new CellTreeLeaf("leafb"));
     var result = copy.Make(source);
     source.Branches[0].Add(new CellTreeLeaf("extra"));
     Assert.AreEqual("root[leafa[];leafb[]]", Write(result));
 }
示例#2
0
 public void DoesNotSubstituteWithinSubstitutes()
 {
     var source = new CellTreeLeaf("root");
     source.AddBranchValue(new CellTreeLeaf("leafa"));
     source.AddBranchValue(new CellTreeLeaf("leafb"));
     var result = copy.Make(source, original => original.Value != null && original.Value.Text == "leafa"
         ? new CellTree("new", "leafa")
         : null);
     source.Branches[0].Add(new CellTreeLeaf("extra"));
     Assert.AreEqual("root[null[new[];leafa[]];leafb[]]", Write(result));
 }
示例#3
0
        public void CopiesBranches()
        {
            var source = new CellTreeLeaf("root");

            source.AddBranchValue(new CellTreeLeaf("leafa"));
            source.AddBranchValue(new CellTreeLeaf("leafb"));
            var result = copy.Make(source);

            source.Branches[0].Add(new CellTreeLeaf("extra"));
            Assert.AreEqual("root[leafa[];leafb[]]", Write(result));
        }
示例#4
0
        public void DoesNotSubstituteWithinSubstitutes()
        {
            var source = new CellTreeLeaf("root");

            source.AddBranchValue(new CellTreeLeaf("leafa"));
            source.AddBranchValue(new CellTreeLeaf("leafb"));
            var result = copy.Make(source, original => original.Value != null && original.Value.Text == "leafa"
                ? new CellTree("new", "leafa")
                : null);

            source.Branches[0].Add(new CellTreeLeaf("extra"));
            Assert.AreEqual("root[null[new[];leafa[]];leafb[]]", Write(result));
        }