private static void Main() { try { Student pesho = new Student("Pesho Georgiev"); Student gosho = new Student("Gosho Ivanov"); Student misho = new Student("Misho Cekov"); Student sasho = new Student("Sasho Kostov"); Course telerikAcademy = new Course("Telerik Academy"); Course webProgramming = new Course("Web Programming"); webProgramming.AddStudent(sasho); telerikAcademy.AddStudent(pesho); telerikAcademy.AddStudent(gosho); telerikAcademy.AddStudent(misho); telerikAcademy.RemoveStudent(gosho); Console.WriteLine(gosho.ToString() + " was removed from course."); Console.WriteLine("Courses:"); Console.WriteLine(telerikAcademy); School freeSchool = new School("School of Computer Sciences"); freeSchool.AddCourse(webProgramming); freeSchool.AddCourse(telerikAcademy); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void TestRemoveNotExistingStudent() { Course css = new Course("CSS", students); Student koko = new Student("Kaloyan", 88823); css.RemoveStudent(koko); }
public void CourseCanNotRemoveAStudentThatItDoesntHave() { var course = new Course("math"); var student = new Student("Pesho", 12345); course.RemoveStudent(student); }
public void CourseRemovingAStudentWhoHasntEnrolledInTheCourseShouldThrow() { var course = new Course("course"); var student = new Student("Captain Blackbeard", 10000); course.AddStudent(student); course.RemoveStudent(new Student("Captain Nemo", 12000)); }
public void CourseRemovingInvalidStudentShouldThrow() { var course = new Course("course"); Student student = null; course.AddStudent(new Student("Captain Nemo", 12000)); course.RemoveStudent(student); }
public void UnsubscribeCourse(Course course) { if (course == null) { throw new InvalidOperationException("Course can not be null."); } course.RemoveStudent(this); }
public void RemovingNonAddedStudentShouldReturnFalse() { var student = new Student("Pesho"); var course = new Course(); var isStudentRemoved = course.RemoveStudent(student); Assert.IsFalse(isStudentRemoved); }
public void LeaveCourse(Course course) { if (course == null) { throw new ArgumentNullException("course", "Course cannot be null."); } course.RemoveStudent(this); }
public void LeaveCourse(Course course) { if (course == null) { throw new ArgumentNullException("The course for removing a student should not be null"); } course.RemoveStudent(this); }
public void LeaveCourse(Course course) { if (course == null) { throw new NullReferenceException("Course cannot be null"); } course.RemoveStudent(this); }
public void AddingAndRemovingAStudentShouldMakeStudentCountEqualToZero() { var student = new Student("Pesho"); var course = new Course(); course.AddStudent(student); course.RemoveStudent(student); Assert.AreEqual(0, course.StudentsCount); }
public void RemovingSomeAddedStudentShouldReturnTrue() { var student = new Student("Pesho"); var course = new Course(); course.AddStudent(student); var isStudentRemoved = course.RemoveStudent(student); Assert.IsTrue(isStudentRemoved); }
public void TestRemoveExistingStudent() { Course cSharp = new Course("C#", students); Student mincho = new Student("Mincho", 23111); cSharp.AddStudent(mincho); mincho.Name = "isdsds"; cSharp.RemoveStudent(mincho); Assert.AreEqual(students, cSharp.Students); }
public void TestRemoveStudentsMethodShouldWorkProperly() { var testCourse = new Course("testCourseName"); var testStudent = new Student(10001, "Test Student Name"); testCourse.InsertStudent(testStudent); testCourse.RemoveStudent(testStudent); Assert.IsTrue( testCourse.Students.Count == 0, "Students list count is not equal to zero" ); }
public void CourseRemoveStudentTest() { var course = new Course("Javascript"); var pesho = new Student("Pesho", 10131); var gosho = new Student("Gosho", 10132); course.AddStudent(pesho); course.AddStudent(gosho); course.RemoveStudent(gosho); var actual = course.ToString(); var expected = "Course name: Javascript\nStudent name is: Pesho, with id: 10131\n"; Assert.AreEqual(expected, actual); }
public void Test_CourseStudentsRemoveStudentShouldBeCorect() { var firstName = "Jhon"; var lastName = "Minkov"; var studentNumber = 19999; var student = new Student(firstName, lastName, studentNumber); var course = new Course("CSharp"); course.AddStudent(student); course.RemoveStudent(student); Assert.AreEqual(0, course.Students.Count); }
public void UnsignCourse(Course course) { if (course == null) { throw new ArgumentNullException("Course cannot be null"); } this.courses.Remove(course); if (course.Students.Contains(this)) { course.RemoveStudent(this); } }
public void UnsignCourse(Course course) { if (course == null) { throw new ArgumentNullException("Course can't be null!"); } if (course.StudentsList.Contains(this)) { course.RemoveStudent(this); this.courses.Remove(course); } else { throw new ArgumentException("You are not signed for this course!"); } }
public static void Main() { Student pesho = new Student("Pesho", "Peshev"); Student gosho = new Student("Gosho", "Goshev"); Console.WriteLine("Pesho number: {0}; Gosho number: {1}", pesho.UniqueNumber, gosho.UniqueNumber); Console.WriteLine("{0}; {1}", pesho.Name, gosho.Name); Course math = new Course("Math"); math.AddStudent(pesho); math.AddStudent(gosho); Console.WriteLine("Students list count after adding 2 students: " + math.StudentsList.Count); math.RemoveStudent(pesho); Console.WriteLine("Students list count after removing 1 student: " + math.StudentsList.Count); Console.WriteLine(gosho.Courses.Count); }
public void RemoveMissingStudentTest() { Course course = new Course("Math"); Student student = new Student("Gosho", "Ivanov", 12345); course.RemoveStudent(student); }
public void RemoveCourse(Course course) { if (course == null || !this.attendingCourse.Contains(course)) { throw new NullReferenceException("Student is not registered to this course"); } this.attendingCourse.Remove(course); course.RemoveStudent(this); }
public void RemovingStudentRemovesHimFromCourse() { var course = new Course("math"); var student = new Student("Pesho", 12345); course.AddStudent(student); course.RemoveStudent(student); Assert.IsFalse(course.Students.Contains(student), "Student remove is not right"); }
public void LeaveCourse(Course course) { Validator.ValidateIfNotNull(course, "course"); course.RemoveStudent(this); }
public void LeaveCourse(Course course) { Validator.CheckIfNull(course, "Course to leave"); course.RemoveStudent(this); }
public void CourseShouldRemoveStudentCorrectly() { var course = new Course("course"); var student = new Student("Captain Blackbeard", 10000); course.AddStudent(student); course.RemoveStudent(student); }
public void LeaveCourse(Course course) { course.RemoveStudent(this); }
public void RemovingStudentReducesNumberOfStudentsInCourse() { var course = new Course("math"); var student = new Student("Pesho", 12345); course.AddStudent(student); course.RemoveStudent(student); Assert.IsTrue(course.Students.Count == 0, "Student count when removing is not right"); }
public void RemoveStudentFromCourseMethodTest() { Course course = new Course("Math"); int studentsInCourse = course.ListOfStudents.Count; Student student = new Student("Gosho", "Ivanov", 12345); course.AddStudent(student); course.RemoveStudent(student); Assert.AreEqual(studentsInCourse, course.ListOfStudents.Count); }
public void TestRemoveStudent2() { Course course = new Course("Telerik Academy"); Student misho = new Student("Misho Ivanov"); course.AddStudent(misho); course.RemoveStudent(new Student("Pesho Ivanov")); Assert.AreEqual(1, course.ListOfStudents.Count, "Non-existent student was removed."); }
public void TestRemoveStudent3() { Course course = new Course("Telerik Academy"); course.RemoveStudent(null); }
public void TestRemoveStudent1() { Course course = new Course("Telerik Academy"); Student misho = new Student("Misho Ivanov"); course.AddStudent(misho); course.RemoveStudent(misho); Assert.AreEqual(0, course.ListOfStudents.Count, "Student was not removed successfully."); }
public void TestRemoveMissingStudent() { Course c = new Course("Math"); Student s1 = new Student("George", 13451); Student s2 = new Student("Asya", 66451); c.AddStudent(s1); c.AddStudent(s2); Student removed = c.RemoveStudent(10101); Assert.AreEqual(null, removed); }
public void TestRemoveStudent() { Course c = new Course("Math"); Student s1 = new Student("George", 13451); Student s2 = new Student("Asya", 66451); c.AddStudent(s1); c.AddStudent(s2); c.RemoveStudent(13451); Assert.AreEqual(1, c.Students.Count); }
public bool LeaveCourse(Course course) { course.RemoveStudent(this); return(true); }