public void StudentToString_TestWithOneNameAndID() { School telerikAcademy = new School(); Student nakov = new Student("Svetlin Nakov", 12345, telerikAcademy); string expected = "Student name: Svetlin Nakov; Student ID: 12345"; Assert.AreEqual(expected, nakov.ToString(), "Student method ToString() does not work correct."); }
public void JoinToCourse(Student student) { if (this.courseStudents.Count >= 30) { throw new ArgumentException("Course cannot contains more from 30 students."); } this.courseStudents.Add(student); }
public void JoinToCourse_ExceptionAddMoreFrom30Students() { School telerikAcademy = new School(); Student nakov = new Student("Svetlin Nakov", 12345, telerikAcademy); Course html = new Course(); for (int i = 0; i < 31; i++) { html.JoinToCourse(nakov); } }
public void JoinToCourse_AddThreeStudents() { School telerikAcademy = new School(); Student nakov = new Student("Svetlin Nakov", 12345, telerikAcademy); Student doncho = new Student("Doncho Minkov", 23456, telerikAcademy); Student niki = new Student("Nikolay Kostov", 34567, telerikAcademy); Course oop = new Course(); oop.JoinToCourse(nakov); oop.JoinToCourse(doncho); oop.JoinToCourse(niki); Assert.AreEqual(3, oop.CourseStudents.Count, "Wrong number of students in studentsList"); }
public void LeaveCourse_TestAddThreeStudentsAndLeaveOne() { School telerikAcademy = new School(); Student nakov = new Student("Svetlin Nakov", 12345, telerikAcademy); Student doncho = new Student("Doncho Minkov", 23456, telerikAcademy); Student niki = new Student("Nikolay Kostov", 34567, telerikAcademy); Course qpc = new Course(); qpc.JoinToCourse(nakov); qpc.JoinToCourse(doncho); qpc.JoinToCourse(niki); qpc.LeaveCourse(nakov); Assert.AreEqual(2, qpc.CourseStudents.Count, "Wrong number of students in studentsList"); }
public void StudentSetID_DuplicatedStudentsIDException() { School telerikAcademy = new School(); Student firstStudent = new Student("First Student", 12345, telerikAcademy); Student secondStudent = new Student("Second Student", 12345, telerikAcademy); }
public void StudentSetID_ExceptionIncorectIDWith4Digits() { School telerikAcademy = new School(); Student someStudent = new Student("Student Name", 1234, telerikAcademy); }
public void StudentSetName_ExceptionEmptyName() { School telerikAcademy = new School(); Student someStudent = new Student(string.Empty, 12345, telerikAcademy); }
public void LeaveCourse(Student student) { this.courseStudents.Remove(student); }