@Test public void ColoursAfterInsertion() { RBT<Integer, String> T = buildTree(); RBTUtils<Integer, String> utils = new RBTUtils<Integer, String>(); Integer EIGHTEEN = new Integer(18); String sEIGHTEEN = new String("eighteen"); T.insert(EIGHTEEN, sEIGHTEEN); assertTrue(utils.RBTColours(T)); }
@Test public void CheckContents4() { RBT<Integer, String> T = buildTree(); RBTUtils<Integer, String> utils = new RBTUtils<Integer, String>(); Integer EIGHTEEN = new Integer(18); String sEIGHTEEN = new String("eighteen"); T.insert(EIGHTEEN, sEIGHTEEN); assertTrue(sEIGHTEEN.equals(T.get(EIGHTEEN))); }
@Test public void SizeAfterInsertion() { RBT<Integer, String> T = buildTree(); RBTUtils<Integer, String> utils = new RBTUtils<Integer, String>(); Integer EIGHTEEN = new Integer(18); String sEIGHTEEN = new String("eighteen"); T.insert(EIGHTEEN, sEIGHTEEN); assertTrue(T.size() == 4); }
@Test public void SanityCheck() { RBT<Integer, String> T = buildTree(); RBTUtils<Integer, String> utils = new RBTUtils<Integer, String>(); assertTrue(utils.RBTShape(T)); assertTrue(utils.RBTKeyOrder(T.root())); assertTrue(utils.RBTColours(T)); assertTrue(utils.RBTSizes(T.root())); assertTrue(utils.RBTBlackHeights(T.root())); }