Exemplo n.º 1
0
 public void TestJoinTheSameStudentId()
 {
     string name = "Crocheting";
     Student student = new Student("Ivan Ivanov", 12233);
     Course course = new Course(name);
     course.Join(student);
     course.Join(student);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
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));
     }
 }
Exemplo n.º 5
0
 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);
 }