public void Case6() { 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.Black, Value = c } } }; var tree = new RedBlackTree(nd); tree.Case6(nd.Right, nd.Right.Sibling()); var expected = new RedBlackTree.Node() { Color = RedBlackTree.Color.Black, Value = a, Left = new RedBlackTree.Node() { Value = b, Color = RedBlackTree.Color.Red, Right = new RedBlackTree.Node() { Value = c, Color = RedBlackTree.Color.Black }, Left = new RedBlackTree.Node() { Value = d, Color = RedBlackTree.Color.Black, } } }; Assert.Equal(expected, tree._root, RedBlackTree.NodeEqualityComparer.Comparer); } ColorDepends(RedBlackTree.Color.Red); ColorDepends(RedBlackTree.Color.Black); }