public void Equals_BothEqualTreeNodeInstancesCompared_ReturnTrue() { // ARRANGE TreeNode treeNode = new TreeNode("aaa") { TreeNodes = Enumerable.Empty<TreeNode>().ToList() }; // ACT var actual = treeNode.Equals(treeNode.DeepCopy()); // ASSERT Assert.IsTrue(actual, "Instances are equal."); }
public void Equals_NonEqualTreeNodeInstancesCompared_ReturnFalse() { // ARRANGE TreeNode treeNode1 = new TreeNode("aaa") { TreeNodes = Enumerable.Empty<TreeNode>().ToList() }; TreeNode treeNode2 = treeNode1.DeepCopy(); treeNode2.TreeNodes.Add(new TreeNode("bbb")); // ACT var actual = treeNode1.Equals(treeNode2); // ASSERT Assert.IsFalse(actual, "Instances are not equal."); }