Example #1
0
 public void School_AddNewCourse()
 {
     var school = new School();
     var course = new Course("Math");
     school.AddCourse(course);
     bool isCourseAdded = school.CheckIfCourseExists(course);
     Assert.IsTrue(isCourseAdded);
 }
Example #2
0
 public void Course_DeletingPresentStudent()
 {
     var course = new Course("Math");
     var student = new Student("Pesho", 19834);
     course.AddStudent(student);
     course.RemoveStudent(student);
     bool studentIsRemoved = course.CheckIfStudentExists(student);
     Assert.IsFalse(studentIsRemoved);
 }
Example #3
0
        public void Course_CreatingCourseWithExtraStudents()
        {
            var course = new Course("Math");

            for (int i = 1; i < 50; i++)
            {
                var student = new Student(i.ToString(), 10000 + i);
                course.AddStudent(student);
            }
        }
Example #4
0
        public bool CheckIfCourseExists(Course subject)
        {
            bool isCourseExists = false;

            foreach (var course in Courses)
            {
                if (subject.CourseName == course.CourseName)
                {
                    isCourseExists = true;
                    break;
                }
            }
            return isCourseExists;
        }
Example #5
0
 public void AddCourse(Course course)
 {
     Courses.Add(course);
 }
Example #6
0
 public void Course_DeletingNonPresentStudent()
 {
     var course = new Course("Math");
     var student = new Student("Pesho", 19872);
     course.RemoveStudent(student);
 }
Example #7
0
 public void Course_CreatingCourse()
 {
     var course = new Course("Math");
     var isCreateadCorrect = course is Course;
     Assert.IsTrue(isCreateadCorrect);
 }