コード例 #1
0
        public void CanNotAddDifferentStudentsWithSameId()
        {
            var school = new School();
            var student1 = new Student("pesho", 22222);
            var student2 = new Student("gosho", 22222);

            school.AddStudent(student1);
            school.AddStudent(student2);
        }
コード例 #2
0
 static void CreateStudentsIntoSchool(School school, int studentCount)
 {
     for (int j = 0; j < studentCount; j++)
     {
         school.AddStudent(CreateStudent());
     }
 }
コード例 #3
0
        public void AddingStudentShouldIncreazeNumberOfStudents()
        {
            var school = new School();
            var student = new Student("pesho", 22222);
            school.AddStudent(student);

            Assert.AreEqual(1, school.StudentsCount, "Student adding does not increaze count");
        }
コード例 #4
0
        private static void Main()
        {
            var firstDiscipline  = new Discipline("Mathematic", 20, 3, "Some comment for math...");
            var secondDiscipline = new Discipline("Physics", 22, 4);
            var firstTeacher     = new Teacher("Georgi Gerogiev", "Some comment for the teacher...");
            var secondTeacher    = new Teacher("Ivan Ivanov");

            firstTeacher.AddDiscipline(null);

            firstTeacher.GetDisciplines().ForEach(x => System.Console.WriteLine(x.Name));
            firstTeacher.AddDiscipline(secondDiscipline);
            secondTeacher.AddDiscipline(firstDiscipline);
            secondTeacher.AddDiscipline(secondDiscipline);
            var firstStudent       = new Student("Pesho Peshov", 112, "Some comment about the student...");
            var secondStudent      = new Student("Gosho Goshov", 113);
            var exampleSchoolClass = new School("Some unique ID", "Some comment...");

            exampleSchoolClass.AddStudent(firstStudent);
            exampleSchoolClass.AddStudent(secondStudent);
            exampleSchoolClass.AddTeacher(firstTeacher);
            exampleSchoolClass.AddTeacher(secondTeacher);
        }
コード例 #5
0
 public void AddDuplicateIDStudent()
 {
     var school = new School();
     school.AddStudent(ValidName, ValidUid);
     school.AddStudent(ValidName, ValidUid);
 }
コード例 #6
0
 public void AddStudent()
 {
     var testSchool = new School();
     testSchool.AddStudent(ValidName, ValidUid);
     Assert.AreEqual(ValidName, testSchool.GetStudentByUID(ValidUid).Name);
 }
コード例 #7
0
 public void AddStudent()
 {
     School school = new School();
     school.AddStudent("lala", 10000);
     Assert.AreEqual("lala", school.GetStudentByUID(10000).Name);
 }
コード例 #8
0
 public void AddDuplicatedIDStudent()
 {
     School school = new School();
     school.AddStudent("lala", 10000);
     school.AddStudent("2222", 10000);
 }
コード例 #9
0
 public void AddBadIDStudentLow()
 {
     School school = new School();
     school.AddStudent("lala", 9999);
 }
コード例 #10
0
 public void AddBadIDStudentHigh()
 {
     School school = new School();
     school.AddStudent("lala", 100000);
 }