コード例 #1
0
ファイル: DeepCopyTest.cs プロジェクト: ChrisBDFA/fitsharp
 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
ファイル: DeepCopyTest.cs プロジェクト: ChrisBDFA/fitsharp
 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
ファイル: DeepCopyTest.cs プロジェクト: PinetNicolas/fitsharp
        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
ファイル: DeepCopyTest.cs プロジェクト: PinetNicolas/fitsharp
        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));
        }