public void Case4() { var any = 0; var a = any; var b = any; var c = any; var d = any; void ColorDepends(RedBlackTree.Color color) { var nd = new RedBlackTree.Node() { Color = color, Value = a, Left = new RedBlackTree.Node() { Value = b, Color = RedBlackTree.Color.Black, Left = new RedBlackTree.Node() { Value = d, Color = RedBlackTree.Color.Black }, Right = new RedBlackTree.Node() { Color = RedBlackTree.Color.Red, Value = c } } }; var tree = new RedBlackTree(nd); tree.Case4(nd.Right, nd.Right.Sibling()); var expected = new RedBlackTree.Node() { Color = color, Value = a, Left = new RedBlackTree.Node() { Value = c, Color = RedBlackTree.Color.Black, Left = new RedBlackTree.Node() { Value = b, Color = RedBlackTree.Color.Red, Left = new RedBlackTree.Node() { Color = RedBlackTree.Color.Black, Value = d } } } }; Assert.Equal(expected, tree._root, RedBlackTree.NodeEqualityComparer.Comparer); } ColorDepends(RedBlackTree.Color.Red); ColorDepends(RedBlackTree.Color.Black); }