Example #1
0
 public void StudentGroupShouldAddStudent()
 {
     var myClass = new StudentGroup("TelerikAcad");
     var student = new Student("Pe6o Ubaveca", Student.MinValidId);
     myClass.AddStudent(student);
     Assert.AreEqual(1, myClass.Students.Count);
 }
Example #2
0
        public void StudentGroupShouldAddOnlyNewNotAlreadyAddedStudentsFromNewCourseOnNewCourseAdd()
        {
            var myClass = new StudentGroup("TelerikAcad");
            var newCourse = new Course("HQC");
            var existingStudent = new Student("Existing Guy", Student.MinValidId);
            var newStudent = new Student("New Guy", Student.MinValidId+1);
            newStudent.JoinCourse(newCourse);
            myClass.AddStudent(existingStudent);

            myClass.AddCourse(newCourse);

            Assert.AreEqual(2, myClass.Students.Count);
        }
Example #3
0
 public void StudentGroupShouldThrowOnNullStudentAdd()
 {
     var myClass = new StudentGroup("TelerikAcad");
     myClass.AddStudent(null);
 }
Example #4
0
 public void StudentGroupShouldThrowIfStudentWithSameIdAlreadyAdded()
 {
     var myClass = new StudentGroup("TelerikAcad");
     var student = new Student("Pe6o Ubaveca", Student.MinValidId);
     var student2 = new Student("Pe6o Ubaveca2", Student.MinValidId);
     myClass.AddStudent(student);
     myClass.AddStudent(student2);
 }