Beispiel #1
0
        static void Main(string[] args)
        {
            Course math = new Course("Math");
            for (int i = 0; i < 30; i++)
            {
               math.AddStudent(new Student("Test Student : " + i));
            }

            Console.WriteLine(math);

            math.RemoveStudentByID(10000);
            math.RemoveStudentByID(10001);
            math.RemoveStudentByID(10002);

            Console.WriteLine(math);

            //throw exception
            //math.RemoveStudentByID(9);

            SchoolDem PMG = new SchoolDem("PMG");
            PMG.AddCourse(math);

            //throwing exceptions
            //PMG.AddCourse(math);
            //PMG.AddCourse(null);
            Console.WriteLine(PMG);

            var school = new SchoolDem("Banichka");
            var course = new Course("Alg");

            school.AddCourse(course);

            Console.WriteLine(school);
        }
Beispiel #2
0
 public void RemoveStudenFromEmptyList_ThrowException()
 {
     var spirt = new Course("Spirt");
     spirt.RemoveStudentByID(99);
 }
Beispiel #3
0
 public void RemoveStudenByIncorrectID_ThrowException()
 {
     var spirt = new Course("Spirt");
     spirt.AddStudent(new Student("sad"));
     spirt.RemoveStudentByID(99);
 }
Beispiel #4
0
        public void RemovingStudentThatDoesNotExistInTheList()
        {
            var bakery = new Course("Bakery");
            var student = new Student("Fhilip");

            bakery.AddStudent(student);
            bakery.RemoveStudentByID(20000);
        }
Beispiel #5
0
        public void RemovingCorrectlyStudent_TrueIfRemovedCorrectly()
        {
            var spirt = new Course("Spirt");
            var student = new Student("sad");

            spirt.AddStudent(student);
            spirt.RemoveStudentByID(student.UniqueID);

            var index = spirt.ToString().IndexOf(student.ToString());
            Assert.IsTrue(index < 0);
        }