def test_is_enrolled(self): table = EnrollTable(35) student = StudentNode("999670", "ART", "Tosin", "Kuye") student1 = StudentNode("999635", "SCI", "Satoshi", "Nakamoto") student2 = StudentNode("999600", "ART", "Levi", "Ackermann") student3 = StudentNode("999599", "ART", "Tosin", "Kuye") student4 = StudentNode("555555", "SCI", "Satoshi", "Nakamoto") student5 = StudentNode("534125", "SCI", "Satoshi", "Monkery") student6 = StudentNode("211122", "SCI", "Satoshi", "Masaaas") table.insert(student) table.insert(student1) table.insert(student2) table.insert(student3) table.insert(student4) table.insert(student5) table.insert(student6) self.assertTrue(table.isEnrolled(student.getID())) self.assertTrue(table.isEnrolled(student1.getID())) self.assertTrue(table.isEnrolled(student2.getID())) self.assertTrue(table.isEnrolled(student3.getID())) self.assertTrue(table.isEnrolled(student4.getID())) self.assertTrue(table.isEnrolled(student5.getID())) table.remove(student.getID()) table.remove(student1.getID()) self.assertFalse(table.isEnrolled(student.getID())) self.assertFalse(table.isEnrolled(student1.getID())) self.assertEqual(table.size(), 5)
def test_enroll_student(self): queue = PriorityQueue() table = None for i in range(1, 51): table = EnrollTable(i) with open("input.txt") as f: enrollStudentData(f, table, queue) f.close() self.pc.printout(queue, color="WHITE") self.pc.printout(table, color="WHITE") self.assertEqual(table.size(), 50)