Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 5
0
 public void AddCourse(Course course)
 {
     Courses.Add(course);
 }
Exemplo n.º 6
0
 public void Course_DeletingNonPresentStudent()
 {
     var course = new Course("Math");
     var student = new Student("Pesho", 19872);
     course.RemoveStudent(student);
 }
Exemplo n.º 7
0
 public void Course_CreatingCourse()
 {
     var course = new Course("Math");
     var isCreateadCorrect = course is Course;
     Assert.IsTrue(isCreateadCorrect);
 }