예제 #1
0
 public void SchoolShouldThrowExceptionWhenAddingExistingStudent()
 {
     var school = new School("Telerik Academy");
     var student = new Student("Daniel Popov", 10000);
     school.AddStudent(student);
     school.AddStudent(student);
 }
 public void TestSchoolAddingNewCourseShouldProperlyUpdateList()
 {
     School school = new School("OMG");
     school.AddCourse(new Course("JS-OOP"));
     school.AddCourse(new Course("JS-Basic"));
     Assert.AreEqual(2, school.Courses.Count, "List of courses is icorrect");
 }
 public void TestSchoolAddingCourseWithSameNameToThrow()
 {
     School school = new School("OMG");
     Course js = new Course("JS-OOP");
     school.AddCourse(js);
     school.AddCourse(js);
 }
예제 #4
0
 public void SchoolShouldRemoveStudentCorrectly()
 {
     var school = new School("Telerik Academy");
     var student = new Student("Daniel Popov", 10000);
     school.AddStudent(student);
     school.RemoveStudent(student);
     Assert.AreEqual(0, school.Students.Count);
 }
예제 #5
0
 public void SchoolShouldRemoveCourseCorrectly()
 {
     var school = new School("Telerik Academy");
     var course = new Course("High Quality Code");
     school.AddCourse(course);
     school.RemoveCourse(course);
     Assert.AreEqual(0, school.Courses.Count);
 }
 public void AddCourseShouldAddTheCourse()
 {
     List<Course> courses = new List<Course>();
     List<Student> students = new List<Student>();
     School IodaSchool = new School(courses);
     string name = "Math";
     Course newCourse = new Course(students, name);
     IodaSchool.AddCourse(newCourse);
 }
 public void RemoveCourseShouldRemoveCourseThatAlreadyExist()
 {
     string name = "English";
     List<Student> students = new List<Student>();
     Course newCourse = new Course(students,name);
     List<Course> courses = new List<Course>();
     School IodaSchool = new School(courses);
     IodaSchool.AddCourse(newCourse);
     IodaSchool.RemoveCourse(newCourse);
 }
 public void RemoveCourseShouldThrowErrorIfCourseDoesNotExist()
 {
     string name = "English";
     List<Student> students = new List<Student>();
     Course newCourse = new Course(students, name);
     Course newCourse2 = new Course(students, name + 2);
     List<Course> courses = new List<Course>();
     School IodaSchool = new School(courses);
     IodaSchool.AddCourse(newCourse);
     IodaSchool.RemoveCourse(newCourse2);
 }
 public void AddCoursesShouldThrowErrorIfCoursesAreMoreThanMaxCourses()
 {
     List<Course> courses = new List<Course>();
     School IodaSchool = new School(courses);
     List<Student> students = new List<Student>();
     
     for (int i = 0; i < 35; i++)
     {
         Course newCourse = new Course(students, ("English"+i));
         IodaSchool.AddCourse(newCourse);
     }
 }
예제 #10
0
        public void TestCoursesAndStudents()
        {
            School academy = new School();
            string[] letters = new string[] { "s", "a", "e", "ela", "ina", "ka", "ona", };

            for (int i = 0; i < 5; i++)
            {
                Course pesho = new Course("Course #" + i);

                for (int j = 0; j < 30; j++)
                {
                    Student thisStudent = new Student("Ivan" + letters[i % letters.Length], (10344 * (i + 1)) + j);
                    pesho.AddStudent(thisStudent);
                    academy.AddStudentToSchool(thisStudent);
                }

                academy.AddCourseToSchool(pesho);
            }

            Assert.AreEqual(this.RetutnInfo(150, 5), academy.ShowInformationAboutSchool());
        }
예제 #11
0
 public void SchoolShouldThrowExceptionWhenNullCourseAdded()
 {
     var school = new School("Telerik Academy");
     var course = new Course(null);
     school.AddCourse(course);
 }
예제 #12
0
 public void SchoolShouldThrowWhenRemovingNotExistingCourse()
 {
     var school = new School("Telerik Academy");
     var course = new Course("High Quality Code");
     school.RemoveCourse(course);
 }
예제 #13
0
 public void SchoolShouldReturnNameCorrectly()
 {
     var school = new School("Telerik Academy");
     Assert.AreEqual("Telerik Academy", school.Name);
 }
예제 #14
0
 public void SchoolShouldNotThrowException()
 {
     var school = new School("Telerik Academy");
 }
예제 #15
0
 public void SchoolShouldAddStudentCorrectly()
 {
     var school = new School("Telerik Academy");
     var student = new Student("Daniel Popov", 10000);
     school.AddStudent(student);
 }
예제 #16
0
 public void SchoolShoudThrowWhenNullStudentAdded()
 {
     var school = new School("Telerik Academy");
     Student student = null;
     school.AddStudent(student);
 }
예제 #17
0
 public void StudentShouldAddCourseCorrectly()
 {
     var school = new School("Telerik Academy");
     var course = new Course("High Quality Code");
     school.AddCourse(course);
     Assert.AreSame(course, school.Courses.First());
 }
 public void TestSchoolAddingCourseToBeValid()
 {
     School school = new School("OMG");
     school.AddCourse(new Course("JS"));
 }
 public void TestSchoolAddingCoursetWithNull()
 {
     School school = new School("OMG");
     school.AddCourse(null);
 }
 public void TestSchoolCreateNewToBeValid()
 {
     School school = new School("OMG");
 }
 public void TestSchoolNameIsNull()
 {
     School school = new School(null);
 }
예제 #22
0
 public void SchoolShouldThrowExceptionWhenRemovingNullCourse()
 {
     var school = new School("Telerik Academy");
     Course course = null;
     school.RemoveCourse(course);
 }
 public void TestSchoolNameIsEmptyString()
 {
     School school = new School(string.Empty);
 }
예제 #24
0
 public void SchoolShouldThrowExceptionWhenExistingCourseAdded()
 {
     var school = new School("Telerik Academy");
     var course = new Course("High Quality Code");
     school.AddCourse(course);
     school.AddCourse(course);
 }
 public void TestSchoolNameToBeSameAsArgument()
 {
     School school = new School("OMG");
     Assert.AreEqual("OMG", school.SchoolName);
 }
예제 #26
0
 public void SchoolShouldThrowExceptionWhenNameIsEmpty()
 {
     var school = new School(string.Empty);
 }
예제 #27
0
 public void TestSchool()
 {
     School academy = new School();
     Assert.AreEqual(this.RetutnInfo(0, 0), academy.ShowInformationAboutSchool());
 }
예제 #28
0
 public void SchoolShouldThrowExceptionWhenNameIsNull()
 {
     var school = new School(null);
 }