public void ThreadedBinaryTreeDummyNodeTest() { ThreadedBinaryTreeNode <int> root = new ThreadedBinaryTreeNode <int>(1); ThreadedBinaryTreeDummyNode <int> dummy = new ThreadedBinaryTreeDummyNode <int>(root); Assert.AreEqual(0, dummy.Value); Assert.AreSame(root, dummy.Left); Assert.AreSame(dummy, dummy.Right); }
public void ThreadedBinaryTreeNodeTest() { ThreadedBinaryTreeNode <int> n = new ThreadedBinaryTreeNode <int>(2, new ThreadedBinaryTreeNode <int>(3), new ThreadedBinaryTreeNode <int>(4)); Assert.AreEqual(2, n.Value); Assert.IsFalse(n.IsThreaded); Assert.IsNotNull(n.Left); Assert.IsNotNull(n.Right); Assert.AreEqual(3, n.Left.Value); Assert.AreEqual(4, n.Right.Value); }
public void ThreadedBinaryTreeNodeSimpleTest() { ThreadedBinaryTreeNode <int> n = new ThreadedBinaryTreeNode <int>(1); Assert.AreEqual(1, n.Value); Assert.IsNull(n.Left); Assert.IsNull(n.Right); Assert.IsFalse(n.IsLeftThreaded); Assert.IsFalse(n.IsRightThreaded); Assert.IsFalse(n.IsThreaded); }