Example #1
0
 public void StudentGroupShouldAddCourse()
 {
     var myClass = new StudentGroup("TelerikAcad");
     var course = new Course("HQC");
     myClass.AddCourse(course);
     Assert.AreEqual(1, myClass.Courses.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 StudentGroupShouldThrowIfCourseIsAlreadyAdded()
 {
     var myClass = new StudentGroup("TelerikAcad");
     var course = new Course("HQC");
     myClass.AddCourse(course);
     myClass.AddCourse(course);
 }
Example #4
0
 public void StudentGroupShouldThrowOnNullCOurseAdd()
 {
     var myClass = new StudentGroup("TelerikAcad");
     myClass.AddCourse(null);
 }