public void DeepCopyTest() { var deep = new ADeepClass(); deep.DeepList.Add(new List <string>(new[] { "A" })); deep.DeepList.Add(new List <string>(new[] { "B", "C" })); var copy = deep.DeepCopy(); CollectionAssert.AreEqual(new[] { "A" }, copy.DeepList[0]); CollectionAssert.AreEqual(new[] { "B", "C" }, copy.DeepList[1]); }
public void DeepCompareTest() { var deep = new ADeepClass(); deep.DeepList.Add(new List <string>(new[] { "A" })); deep.DeepList.Add(new List <string>(new[] { "B", "C" })); var copy = new ADeepClass(); copy.DeepList.Add(new List <string>(new[] { "A" })); copy.DeepList.Add(new List <string>(new[] { "B", "D" })); Assert.AreEqual(true, deep.DeepList[0].DeepCompare(copy.DeepList[0])); Assert.AreEqual(false, deep.DeepList[1].DeepCompare(copy.DeepList[1])); }