Beispiel #1
0
        public void HasStudent_Test()
        {
            Course course = new Course(".NET");

            course.AddNewStudent(new Student("Pesho"));
            course.AddNewStudent(new Student("Ivan"));
            course.AddNewStudent(new Student("Garo"));

            bool isFound = course.HasStudent("Ivan");
            bool notFound = !course.HasStudent("Ivannn");

            Assert.AreEqual(isFound, true);
            Assert.AreEqual(notFound, true);
        }
Beispiel #2
0
        public void HasStudent_Test()
        {
            Course course = new Course(".NET");

            course.AddNewStudent(new Student("Pesho"));
            course.AddNewStudent(new Student("Ivan"));
            course.AddNewStudent(new Student("Garo"));

            bool isFound = course.HasStudent(Student.NextID - 2);
            bool notFound = !course.HasStudent(Student.NextID - 4);

            Assert.AreEqual(true, isFound);
            Assert.AreEqual(true, notFound);
        }
Beispiel #3
0
        public void AddStudent_ThrowsExceptionWhenMaxReached()
        {
            Course course = new Course(".NET");

            for (int i = 0; i < Course.MaxStudentCount + 1; i++)
            {
                course.AddNewStudent(new Student("Student" + i));
            }
        }
Beispiel #4
0
        public void AddStudent_ExecutesCorrectlyWith10Students()
        {
            Course course = new Course(".NET");

            for (int i = 0; i < 10; i++)
            {
                course.AddNewStudent(new Student("Student" + i));
            }
        }
Beispiel #5
0
        public void RemoveStudent_ExecutesCorrectlyOnRemove()
        {
            Course course = new Course(".NET");

            for (int i = 0; i < 10; i++)
            {
                course.AddNewStudent(new Student("Student" + i));
            }

            course.RemoveStudent(Student.NextID - 5);
        }
Beispiel #6
0
        public void StudentID_HasCorrectValue()
        {
            Course course = new Course(".NET");

            for (int i = 0; i < 5; i++)
            {
                course.AddNewStudent(new Student("Student" + i));
            }

            int lastStudentID = course.Students[4].UniqueID;

            Assert.AreEqual(Student.NextID - 1, lastStudentID);
        }