Example #1
0
        public void StudentsShouldHaveDifferentIDsIfInOneSchool()
        {
            var school = new School("FELS");

            var firstStudent = new Student("John", school);
            var secondStudent = new Student("Marry", school);

            Assert.AreNotEqual(firstStudent.ID, secondStudent.ID,
                "Students in one school cannot have same ID.");
        }
Example #2
0
        public void AddStudentShouldThrowArgumentOutOfRangeExceptionWhenProvidedMoreThanThirty()
        {
            var course = GetValidCourse();
            School school = GetValidSchool();

            for (int i = 0; i < 31; i++)
            {
                var currStudent = new Student("KTX-" + i, school);
                course.AddStudent(currStudent);
            }
        }
Example #3
0
        public void StudentsCanHaveSameIDIfInDifferentSchools()
        {
            var firstSchool = new School("FELS");
            var secondSchool = new School("FGLS");

            var studentInFirstSchool = new Student("Sophie", firstSchool);
            var studentInSecondSchool = new Student("Leonardo", secondSchool);

            Assert.AreEqual(studentInFirstSchool.ID, studentInSecondSchool.ID,
                "Adding first students in different schools should give them same ID.");
        }
Example #4
0
        private Student GetValidStudent()
        {
            var school = GetValidSchool();
            var student = new Student("Valid", school);

            return student;
        }
Example #5
0
 public void CreatingStudentShouldTrowArgumentExceptionWhenGivenNameWithNullValue()
 {
     var school = GetValidSchool();
     var student = new Student(null, school);
 }
Example #6
0
 public void CreatingStudentShouldThrowArgumentOutOfRangeExceptionWhenGivenTooLongName()
 {
     var school = new School("FELS");
     var tooLongName = new string('a', 101);
     var student = new Student(tooLongName, school);
 }
Example #7
0
 public void CreatingStudentShouldThrowArgumentNullExceptionWhenGivenSchoolWithNullValue()
 {
     var student = new Student("Marry", null);
 }
Example #8
0
 public void CreatingStudentShouldThrowArgumentExceptionWhenGivenEmptyName()
 {
     var school = GetValidSchool();
     var student = new Student(string.Empty, school);
 }