public void TestAddStudentExceptionWhenAlreadyAdded() { School school = new School("GLFL Simeon Radev"); Course course = new Course("There is such course in the school!"); school.AddCourse(course); school.AddCourse(course); }
public void TestAddStudentExceptionWhenAlreadyAdded() { Course course = new Course("Math"); Student student = new Student("Pesho"); course.AddStudent(student); course.AddStudent(student); }
public void RemoveNonExistingCourseTest() { List<Course> courses = new List<Course>(); School school = new School(); Course javascript = new Course("Javascript"); school.RemoveCourse(javascript); }
public void TestRemoveStudentExceptionWhenNotExisting() { School school = new School("GLFL Simeon Radev"); Course courseOne = new Course("Math"); Course courseTwo = new Course("Physics"); school.AddCourse(courseOne); school.RemoveCourse(courseTwo); }
public void TestRemoveStudentExceptionWhenNotExisting() { Course course = new Course("Math"); Student studentOne = new Student("Pesho"); Student studentTwo = new Student("Gosho"); course.AddStudent(studentOne); course.RemoveStudent(studentTwo); }
public void TestAddStudentExceptionWhenStudentsTooMuch() { Course course = new Course("Math"); for (int i = 0; i <= 30; i++) { course.AddStudent(new Student("Pesho")); } }
public void AddCourseTest() { List<Course> courses = new List<Course>(); Course javascript = new Course("Javascript"); School school = new School(); school.AddCourse(javascript); Assert.AreEqual(javascript.Name, school.Courses[0].Name); }
public void AddStudentTestOneStudent() { string name = "Javascript"; IList<Student> students = new List<Student>(); Course course = new Course(name); Student maria = new Student("Maria Petrova", 12345); course.AddStudent(maria); Assert.IsTrue(course.Students.Count == 1); }
public void AddStudentTestSameStudentTwoTimes() { string name = "Javascript"; IList<Student> students = new List<Student>(); Course course = new Course(name); Student maria = new Student("Maria Petrova", 12345); course.AddStudent(maria); course.AddStudent(maria); }
public void RemoveCourseTest() { List<Course> courses = new List<Course>(); School school = new School(); Course javascript = new Course("Javascript"); school.AddCourse(javascript); school.RemoveCourse(javascript); Assert.IsTrue(school.Courses.Count == 0); }
public void RemoveCourse(Course course) { bool isCourseFound = this.FindCourse(course); if (!isCourseFound) { throw new ArgumentException("The course is not in the school!"); } this.Courses.Remove(course); }
public void AddStudentTestTwoStudents() { string name = "Javascript"; IList<Student> students = new List<Student>(); Course course = new Course(name); Student maria = new Student("Maria Petrova", 12345); Student petar = new Student("Petar Marinov", 23445); course.AddStudent(maria); course.AddStudent(petar); Assert.IsTrue(course.Students.Count == 2); }
public void AddCourse(Course course) { if (course == null) { throw new ArgumentNullException("Course name cannot be null!"); } if (HasCourse(course.Name)) { throw new InvalidOperationException("There is such course in the school!"); } this.courses.Add(course); }
private bool FindCourse(Course course) { bool isFound = false; for (int i = 0; i < this.Courses.Count; i++) { if (this.Courses[i].Name == course.Name) { isFound = true; } } return isFound; }
public void RemoveCourse(Course course) { if (!HasCourse(course.Name)) { throw new KeyNotFoundException("Course with this name doesn't exist in the school!"); } for (int i = 0; i < this.courses.Count; i++) { if (course.Name == this.courses[i].Name) { this.courses.RemoveAt(i); } } }
public void TestAddStudentRemoveStudent() { Course course = new Course("Math"); Student student = new Student("Pesho"); course.AddStudent(new Student("Gosho")); Assert.AreEqual(course.Students.Count, 1); course.AddStudent(student); Assert.AreEqual(course.Students.Count, 2); Assert.AreEqual(course.Students[1].Name, "Pesho"); course.RemoveStudent(student); Assert.AreEqual(course.Students.Count, 1); Assert.AreEqual(course.Students[0].Name, "Gosho"); }
public void TestAddCourseRemoveCourse() { School school = new School("GLFL Simeon Radev"); Course course = new Course("Math"); school.AddCourse(new Course("Physics")); Assert.AreEqual(school.Courses.Count, 1); school.AddCourse(course); Assert.AreEqual(school.Courses.Count, 2); Assert.AreEqual(school.Courses[1].Name, "Math"); school.RemoveCourse(course); Assert.AreEqual(school.Courses.Count, 1); Assert.AreEqual(school.Courses[0].Name, "Physics"); }
public void AddStudentTestMoreThanMaximumStudents() { string name = "Javascript"; IList<Student> students = new List<Student>(); Course course = new Course(name); course.AddStudent(new Student("Maria Petrova", 12345)); course.AddStudent(new Student("Maria Petrova", 12346)); course.AddStudent(new Student("Maria Gocheva", 12347)); course.AddStudent(new Student("Maria Mihaylova", 12348)); course.AddStudent(new Student("Maria Grozeva", 12349)); course.AddStudent(new Student("Maria Toneva", 12350)); course.AddStudent(new Student("Maria Gecheva", 12351)); course.AddStudent(new Student("Maria Gacheva", 12352)); course.AddStudent(new Student("Maria Donkova", 12353)); course.AddStudent(new Student("Maria Vrankova", 12354)); course.AddStudent(new Student("Maria Drakonova", 12355)); course.AddStudent(new Student("Maria Bobeva", 12356)); course.AddStudent(new Student("Maria Kateva", 12357)); course.AddStudent(new Student("Maria Bonkova", 12358)); course.AddStudent(new Student("Maria Kolova", 12359)); course.AddStudent(new Student("Maria Simova", 12360)); course.AddStudent(new Student("Maria Koleva", 12361)); course.AddStudent(new Student("Maria Popova", 12362)); course.AddStudent(new Student("Maria Tsolova", 12363)); course.AddStudent(new Student("Maria Doneva", 12364)); course.AddStudent(new Student("Maria Dakova", 12365)); course.AddStudent(new Student("Maria Makova", 12366)); course.AddStudent(new Student("Maria Petkova", 12367)); course.AddStudent(new Student("Maria Kamenova", 12368)); course.AddStudent(new Student("Maria Vuchkova", 12369)); course.AddStudent(new Student("Maria Komnina", 12370)); course.AddStudent(new Student("Maria Burdina", 12371)); course.AddStudent(new Student("Maria Hristova", 12372)); course.AddStudent(new Student("Petar Marinov", 23445)); course.AddStudent(new Student("Petar Krastev", 23446)); }
public void NameTestEmptyString() { string name = string.Empty; Course newCourse = new Course(name); }
public void TestConstructor() { Course course = new Course("Math"); Assert.AreEqual(course.Name, "Math"); }
public void TestAddStudentExceptionWhenNull() { Course course = new Course("Math"); course.AddStudent(null); }
public void CourseConstructorTestListStudents() { string name = "Javascript"; Student maria = new Student("Maria Petrova", 12345); IList<Student> students = new List<Student>(); Course course = new Course(name); course.AddStudent(maria); Assert.IsTrue(course.Students.Contains(maria)); }
public void CourseConstructorTestName() { string name = "Javascript"; Course course = new Course(name); Assert.AreEqual(course.Name, "Javascript"); }
public void ToStringTestTwoStudents() { string name = "Javascript"; Student maria = new Student("Maria Petrova", 12345); Student petar = new Student("Petar Marinov", 23445); IList<Student> students = new List<Student>(); Course javascript = new Course(name); javascript.AddStudent(maria); javascript.AddStudent(petar); string expected = "Course name Javascript; Student Maria Petrova, ID 12345; Student Petar Marinov, ID 23445; "; string actual; actual = javascript.ToString(); Assert.AreEqual(expected, actual); }
public void TestNameExceptionWhenNull() { Course course = new Course(null); }
public void AddCourse(Course course) { this.Courses.Add(course); }
public void NameTestNullValue() { string name = null; Course newCourse = new Course(name); }
public void RemoveNonExistingStudentTest() { string name = "Javascript"; IList<Student> students = new List<Student>(); Course course = new Course(name); Student maria = new Student("Maria Petrova", 12345); course.RemoveStudent(maria); }
public void TestNameExceptionWhenEmpty() { Course course = new Course(""); }