public void TestJoinCourseSuccessfully() { Course course = new Course(); Student student = new Student("Valia", 34567); string result = course.JoinCourse(student); Assert.AreEqual("Done!", result); }
public void TestCourseWithZeroStudents() { List<Student> students = new List<Student>(); Course newCourse = new Course(students); Assert.AreEqual(0, newCourse.StudentsInCourse.Count); }
public void CourseShouldAddStudent() { var course = new Course("Maths"); var student = new Student("unnamed", Student.MinValidId); student.JoinCourse(course); Assert.AreEqual(1, course.Students.Count); }
public void AddingTheSameCourseMoreThanOnce_ThrowException() { var school = new SchoolDem("Filipovo"); var course = new Course("Alg"); school.AddCourse(course); school.AddCourse(course); }
public void CourseShouldThrowIfStudentAlreadyAdded() { var course = new Course("Maths"); var student = new Student("unnamed", Student.MinValidId); student.JoinCourse(course); student.JoinCourse(course); }
public void TestRemoveNotExistingStudent() { Course css = new Course("CSS", students); Student koko = new Student("Kaloyan", 88823); css.RemoveStudent(koko); }
public void AddStudentTwiseTest() { Course course = new Course("Math"); Student student = new Student("Gosho", "Ivanov", 12345); course.AddStudent(student); course.AddStudent(student); }
public void CourseCanNotRemoveAStudentThatItDoesntHave() { var course = new Course("math"); var student = new Student("Pesho", 12345); course.RemoveStudent(student); }
public void StudentGroupShouldAddCourse() { var myClass = new StudentGroup("TelerikAcad"); var course = new Course("HQC"); myClass.AddCourse(course); Assert.AreEqual(1, myClass.Courses.Count); }
public void StudentShouldNotThrowWhenLeavingCourse() { var course = new Course("testCourse"); var st = new Student("Pesho", 15000); st.JoinCourse(course); st.LeaveCourse(course); }
public void NameTest() { string name = "JavaScript"; Course target = new Course(name); string actual = target.Name; Assert.AreEqual(name, actual); }
void ValidateCourse(Course course) { if (course == null) { throw new ArgumentNullException("This course is missed."); } }
public void AddingTheSameStudentMoreThanOnce_ThrowException() { var spirt = new Course("Spirt"); var student = new Student("Peter"); spirt.AddStudent(student); spirt.AddStudent(student); }
public void AddStudentAtsCourseMethodTest() { Course course = new Course("Math"); Student student = new Student("Gosho", "Ivanov", 12345); course.AddStudent(student); Assert.AreEqual(student.ID, course.ListOfStudents[0].ID); }
public void RemoveStudentInCourse() { Course course = new Course("lala"); course.AddStudent(new Student("lol", 10000)); course.RemoveStudentByUID(10000); course.AddStudent(new Student("lol", 10000)); }
public void TestAddCourse1() { School school = new School("Telerik"); Course course = new Course("JavaScript"); school.AddCourse(course); Assert.AreEqual(1, school.Courses.Count, "Course was not added successfully."); }
public void TestMaxStudents() { Course c = new Course("Math"); for (int i = 0; i <= 30; i++) { c.AddStudent(new Student("Johny", 20000 + i)); } }
public void CourseCanNotContain30OrMoreStudents() { var course = new Course("math"); for (int i = 0; i < 30; i++) { course.AddStudent(new Student(i.ToString(), 10000 + i)); } }
public void CourseRemovingInvalidStudentShouldThrow() { var course = new Course("course"); Student student = null; course.AddStudent(new Student("Captain Nemo", 12000)); course.RemoveStudent(student); }
public void CourseAddingAnAlreadyExistingStudentShouldThrow() { var course = new Course("Just a course"); var student = new Student("Captain Nemo", 12000); course.AddStudent(student); course.AddStudent(student); }
public void MoreThan30Students() { Course course = new Course("lala"); for (int i = 0; i < 35; i++) { course.AddStudent(new Student(i.ToString(), 10000 + i)); } }
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 RemoveCourse(Course courseToRemove) { if (courseToRemove == null) { throw new ArgumentNullException("You are trying to remove null value from courses list"); } this.courses.Remove(courseToRemove); }
public void CourseShouldAddStudentCorrectly() { var course = new Course("Intermediate Pirate Speech"); var student = new Student("Captain Blackbeard", 55764); course.AddStudent(student); Assert.IsTrue(course.Students.Any(stud => stud.Name == student.Name && stud.Id == student.Id)); }
public void TestGetStudentsPropertyShouldReturnDifferentObjectEachCall() { var testCourse = new Course("testCourseName"); var testStudent = new Student(10001, "Test Student Name"); testCourse.InsertStudent(testStudent); Assert.AreNotSame(testCourse.Students, testCourse.Students, "Student list property returns same object, but should be copy."); }
public void TestAddStudent3() { Course course = new Course("Telerik Academy"); Student misho = new Student("Misho Ivanov"); course.AddStudent(misho); Assert.AreEqual(1, course.ListOfStudents.Count, "Student was not added successfully."); }
public void TestGetStudentsPropertyShouldReturnDeepCopyOfTheList() { var testCourse = new Course("testCourseName"); var testStudent = new Student(10001, "Test Student Name"); testCourse.InsertStudent(testStudent); Assert.AreNotSame(testCourse.Students[0], testCourse.Students[0], "Student list property returns same student as first member, but should be copy."); }
public void CourseCanNotContainAStudentMoreThanOnce() { var course = new Course("math"); var student = new Student("Pesho", 12345); course.AddStudent(student); course.AddStudent(student); }
public void CourseOverflowTest() { var course = new Course("C# HQC"); for (int i = 10100; i < 10135; i++) { course.AddStudent(new Student("Pesho", i)); } }
public void AddingCourseShouldIncreazeNumberOfCourses() { var school = new School(); var course = new Course("pesho"); school.AddCourse(course); Assert.AreEqual(1, school.CoursesCount, "Courses adding does not increaze count"); }
public bool JoinCourse(Course course) { course.AddStudent(this); return(true); }
public bool LeaveCourse(Course course) { course.RemoveStudent(this); return(true); }