Exemplo n.º 1
0
        public void CreatingSchoolShouldSucceedWhenProvidedValidData()
        {
            var school = new School("Valid");

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