Example #1
0
        public void Course_StudentIsExcluded()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student bratPit = new Student("Brat Pit", 10002);
            Student fracescoTotti = new Student("Francesco Totti", 10003);
            Student jessicaAlba = new Student("Jessica Alba", 10004);

            mathCourse[0] = bratPit;
            mathCourse[1] = fracescoTotti;
            mathCourse[2] = jessicaAlba;

            mathCourse.ExcludeParticipant(fracescoTotti);

            bool actual = true;
            for (int index = 0; index < 3; index++)
            {
                if (mathCourse[index] == fracescoTotti)
                {
                    actual = false;
                    break;
                }
            }

            Assert.IsTrue(actual,"Student is not removed from the course.");
        }
Example #2
0
        public void Course_ArragneOfArrayIsRight()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student bratPit = new Student("Brat Pit", 10005);
            Student fracescoTotti = new Student("Francesco Totti", 10006);
            Student jessicaAlba = new Student("Jessica Alba", 10007);

            mathCourse[0] = bratPit;
            mathCourse[1] = fracescoTotti;
            mathCourse[2] = jessicaAlba;

            mathCourse.ExcludeParticipant(bratPit);
            mathCourse.ExcludeParticipant(fracescoTotti);

            Assert.AreEqual(jessicaAlba,mathCourse[0],"mathCourse[0] is not set to the right Object. Probably Course->ExcludeParticipant->Sorting logic problem.");
            Assert.AreEqual(null,mathCourse[1], "mathCourse[1] is not set to null. Probably Course->ExcludeParticipant->Sorting logic problem.");
            Assert.AreEqual(null, mathCourse[2],"mathCourse[2] is not set to null. Probably Course->ExcludeParticipant->Sorting logic problem.");
        }