public void RemoveNodeShouldHaveNoReferencesToTheOriginalTreeNodes() { // Arrange var charNodeA = new CharacterNode('a'); var charNodeB = new CharacterNode('b'); var childNodes = new List <RegexNode> { charNodeA, charNodeB }; var target = new TestRegexNode(childNodes); // Act RegexNode result = target.RemoveNode(charNodeA); // Assert result.ShouldNotBe(target); result.ChildNodes.ShouldNotContain(charNodeA); result.ChildNodes.ShouldNotContain(charNodeB); }