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."); }
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); } }
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."); }
private Student GetValidStudent() { var school = GetValidSchool(); var student = new Student("Valid", school); return student; }
public void CreatingStudentShouldTrowArgumentExceptionWhenGivenNameWithNullValue() { var school = GetValidSchool(); var student = new Student(null, school); }
public void CreatingStudentShouldThrowArgumentOutOfRangeExceptionWhenGivenTooLongName() { var school = new School("FELS"); var tooLongName = new string('a', 101); var student = new Student(tooLongName, school); }
public void CreatingStudentShouldThrowArgumentNullExceptionWhenGivenSchoolWithNullValue() { var student = new Student("Marry", null); }
public void CreatingStudentShouldThrowArgumentExceptionWhenGivenEmptyName() { var school = GetValidSchool(); var student = new Student(string.Empty, school); }