コード例 #1
0
ファイル: SchoolTest.cs プロジェクト: cvet-/Telerik_Academy
        public void CreatingSchoolShouldSucceedWhenProvidedValidData()
        {
            var school = new School("Valid");

            Assert.IsInstanceOfType(school, typeof(ISchool),
                "Creating new School failed with valid data.");
        }
コード例 #2
0
ファイル: StudentTest.cs プロジェクト: cvet-/Telerik_Academy
        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
ファイル: StudentTest.cs プロジェクト: cvet-/Telerik_Academy
        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
ファイル: CourseTest.cs プロジェクト: cvet-/Telerik_Academy
 private School GetValidSchool()
 {
     var school = new School("Valid");
     return school;
 }
コード例 #5
0
ファイル: StudentTest.cs プロジェクト: cvet-/Telerik_Academy
 public void CreatingStudentShouldThrowArgumentOutOfRangeExceptionWhenGivenTooLongName()
 {
     var school = new School("FELS");
     var tooLongName = new string('a', 101);
     var student = new Student(tooLongName, school);
 }
コード例 #6
0
ファイル: SchoolTest.cs プロジェクト: cvet-/Telerik_Academy
 public void CreatingSchoolShouldThrowArgumentOutOfRangeExceptionWhenProvidedTooLongName()
 {
     var tooLongName = new string('a', 101);
     var school = new School(tooLongName);
 }
コード例 #7
0
ファイル: SchoolTest.cs プロジェクト: cvet-/Telerik_Academy
 public void CreatingSchoolShouldThrowArgumentExceptionWhenProvidedNameWithValueNull()
 {
     var school = new School(null);
 }
コード例 #8
0
ファイル: SchoolTest.cs プロジェクト: cvet-/Telerik_Academy
 public void CreatingSchoolShouldThrowArgumentExceptionWhenProvidedEmptyName()
 {
     var school = new School(string.Empty);
 }