示例#1
0
        public void CreatingSchoolShouldSucceedWhenProvidedValidData()
        {
            var school = new School("Valid");

            Assert.IsInstanceOfType(school, typeof(ISchool),
                "Creating new School failed with valid data.");
        }
示例#2
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.");
        }
示例#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.");
        }
示例#4
0
 private School GetValidSchool()
 {
     var school = new School("Valid");
     return school;
 }
示例#5
0
 public void CreatingStudentShouldThrowArgumentOutOfRangeExceptionWhenGivenTooLongName()
 {
     var school = new School("FELS");
     var tooLongName = new string('a', 101);
     var student = new Student(tooLongName, school);
 }
示例#6
0
 public void CreatingSchoolShouldThrowArgumentOutOfRangeExceptionWhenProvidedTooLongName()
 {
     var tooLongName = new string('a', 101);
     var school = new School(tooLongName);
 }
示例#7
0
 public void CreatingSchoolShouldThrowArgumentExceptionWhenProvidedNameWithValueNull()
 {
     var school = new School(null);
 }
示例#8
0
 public void CreatingSchoolShouldThrowArgumentExceptionWhenProvidedEmptyName()
 {
     var school = new School(string.Empty);
 }