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