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