Exemple #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));
 }
Exemple #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));
 }
        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));
        }
        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));
        }