Example #1
0
 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.");
 }
Example #2
0
 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);
     }
 }
Example #3
0
        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");
        }
Example #4
0
        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");
        }
Example #5
0
 public Student(string name, int studentID, School school)
 {
     this.School = school;
     this.Name = name;
     this.StudentID = studentID;
 }
Example #6
0
 public void StudentSetID_DuplicatedStudentsIDException()
 {
     School telerikAcademy = new School();
     Student firstStudent = new Student("First Student", 12345, telerikAcademy);
     Student secondStudent = new Student("Second Student", 12345, telerikAcademy);
 }
Example #7
0
 public void StudentSetID_ExceptionIncorectIDWith4Digits()
 {
     School telerikAcademy = new School();
     Student someStudent = new Student("Student Name", 1234, telerikAcademy);
 }
Example #8
0
 public void StudentSetName_ExceptionEmptyName()
 {
     School telerikAcademy = new School();
     Student someStudent = new Student(string.Empty, 12345, telerikAcademy);
 }