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