public void TestJoinTheSameStudentId() { string name = "Crocheting"; Student student = new Student("Ivan Ivanov", 12233); Course course = new Course(name); course.Join(student); course.Join(student); }
public void TestJoinStudentId() { string name = "Crocheting"; Student student = new Student("Ivan Ivanov", 12233); Course course = new Course(name); course.Join(student); Assert.AreEqual(student.StudentId, course.StudentsList[0].StudentId); }
public void TestLeaveStudent() { string name = "Crocheting"; Student student = new Student("Ivan Ivanov", 12233); Course course = new Course(name); course.Join(student); course.Leave(student); Assert.IsTrue(course.StudentsList.Count == 0); }
public void TestJoinMoreThan30Students() { string name = "Crocheting"; string studentName = "Ivan Ivanov"; int studentId = 12233; Course course = new Course(name); for (int i = 0; i <= Course.MaxNumberOfStudentsInCourse + 2; i++) { studentId++; course.Join(new Student(studentName, studentId)); } }
public void TestLeaveNotJoinedStudent() { string name = "Crocheting"; Student student = new Student("Ivan Ivanov", 12233); Course course = new Course(name); course.Leave(student); }
public void TestNewCourseConstructorEmptyName() { string name = string.Empty; Course course = new Course(name); }
public void TestNewCourseConstructorNullName() { string name = null; Course course = new Course(name); }
public void TestStudentToString() { string name = "Crocheting"; Course course = new Course(name); Student student = new Student("Ivan Ivanov", 12233); course.Join(student); string expected = string.Format("Course: Crocheting{0}Subscribed students{0}12233 Ivan Ivanov{0}", Environment.NewLine); string actual = course.ToString(); Assert.AreEqual(expected, actual); }
public void TestNewCourseConstructorName() { string name = "Crocheting"; Course course = new Course(name); Assert.AreEqual(course.Name, name); }