예제 #1
0
        public void AddStudents()
        {
            School mySchool = new School();

            mySchool.AddStudent(new Student("Pesho", 10004, mySchool));
            mySchool.AddStudent(new Student("Pesho", 10005, mySchool));
        }
예제 #2
0
        public void AddStudentsWithIdenticalNumbers()
        {
            School mySchool = new School();

            mySchool.AddStudent(new Student("Pesho", 10004, mySchool));
            mySchool.AddStudent(new Student("Pesho", 10004, mySchool));
        }
 public void TestGettingSchoolNameIfEqualToValidInput()
 {
     string testSchoolName = "abcd";
      School mySchool = new School(testSchoolName);
      string gottenSchoolName = mySchool.Name;
      Assert.AreEqual(testSchoolName, gottenSchoolName);
 }
 public void TestChangingSchoolNameIfEqualToValidInput()
 {
     School mySchool = new School("abcd");
     string testSchoolName = "testName";
     mySchool.Name = testSchoolName;
     Assert.AreEqual(testSchoolName, mySchool.Name);
 }
예제 #5
0
        public void InitStudent()
        {
            School mySchool = new School();
            Student pesho = new Student("Pesho", 10001, mySchool);

            Assert.IsTrue(pesho.Name == "Pesho");
            Assert.IsTrue(pesho.Number == 10001);
        }
예제 #6
0
        public void JoinCourseOfNull()
        {
            School mySchool = new School();

            Student pesho = new Student("Pesho", 10000, mySchool);

            pesho.JointCourse(null);
        }
예제 #7
0
        public void AddCourse()
        {
            School mySchool = new School();

            mySchool.AddCourse(new Course());
            mySchool.AddCourse(new Course());

            Assert.IsTrue(mySchool.Courses.Count == 2);
        }
예제 #8
0
        public void MaxNumberStudentsInCourse()
        {
            School mySchool = new School();
            Course math = new Course();

            for (int i = 0; i < 31; i++)
            {
                math.AddStudent(new Student("Pesho", 10000 + i, mySchool));
            }
        }
 public void TestSchoolAddCourseMethodToAddCourses()
 {
     var myCourse = new Course("aa");
     var myAnotherCourse = new Course("aa");
     var mySchool = new School("zz");
     mySchool.AddCourse(myCourse);
     mySchool.AddCourse(myAnotherCourse);
     int courseCount = 2;
     Assert.AreEqual(courseCount, mySchool.Courses.Count);
 }
예제 #10
0
        public Student(string name, int number, School school)
        {
            if (school == null)
            {
                throw new ArgumentNullException("You must provide a school!");
            }

            this.Name = name;
            this.Number = number;
            school.AddStudent(this);
        }
예제 #11
0
        public void TryingToRemoveUnexistingStudent()
        {
            School mySchool = new School();
            Course math = new Course();

            for (int i = 0; i < 30; i++)
            {
                math.AddStudent(new Student("Pesho", 10000 + i, mySchool));
            }

            math.RemoveStudent(new Student("Gosho", 34322, mySchool));
        }
예제 #12
0
        public void JoinCourse()
        {
            School mySchool = new School();

            Course math = new Course();

            Student pesho = new Student("Pesho", 10000, mySchool);

            pesho.JointCourse(math);

            Assert.IsTrue(math.Students.Count == 1);
        }
예제 #13
0
        public static void Main()
        {
            // Create & loads Teacher & Disciplines
            Teacher teacherOne = new Teacher("Goshko", "Goshkov");
            Discipline disciplineOne = new Discipline("Mathematica", 4, 10);
            Discipline disciplineTwo = new Discipline("Phisics", 10, 6);
            teacherOne.AddDiscipline(disciplineOne);
            teacherOne.AddDiscipline(disciplineTwo);

            // Create & loads students
            Student studentOne = new Student("Petarcho", "Petarchov", 1);
            Student studentTwo = new Student("Yordancho", "Yordanov", 2);
            Student studentThree = new Student("Zuyo", "Zuev", 1);
            Student studentFour = new Student("Suzi", "Suzankovichkova", 2);

            // Create & loads class with students and teachers
            Class classOne = new Class("Class One");
            try
            {
                classOne.AddStudent(studentOne);
                classOne.AddStudent(studentTwo);
                classOne.AddTeacher(teacherOne);
            }
            catch (ArgumentException e)
            {
                Console.WriteLine(e.Message);
            }

            Teacher teacherTwo = new Teacher("Petunia", "Petunkova", new Discipline("Rocket Science", 1000, 6000));
            Class classTwo = new Class("Class Two");
            try
            {
                classTwo.AddStudent(studentThree);
                classTwo.AddStudent(studentFour);
                classTwo.AddTeacher(teacherOne);
                classTwo.AddTeacher(teacherTwo);
            }
            catch (ArgumentException e)
            {
                Console.WriteLine(e.Message);
            }

            // Create & loads school and add class
            School school = new School();
            school.AddClass(classOne);
            school.AddClass(classTwo);
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("School details:");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(school.ToString());
        }
예제 #14
0
        public void RemoveCourse()
        {
            School mySchool = new School();

            Course math = new Course();
            Course OOP = new Course();

            mySchool.AddCourse(math);
            mySchool.AddCourse(OOP);

            mySchool.RemoveCourse(math);

            Assert.IsTrue(mySchool.Courses.Count == 1);
        }
예제 #15
0
        public void InitCourseWithList()
        {
            School mySchool = new School();

            List<Student> students = new List<Student>();

            for (int i = 0; i < 10; i++)
            {
                students.Add(new Student("pesho", 10000 + i, mySchool));
            }

            Course math = new Course(students);

            Assert.IsTrue(math.Students.Count == 10);
        }
예제 #16
0
 public void InitStudentWithTooSmallNumber()
 {
     School mySchool = new School();
     Student pesho = new Student("Pesho", 9999, mySchool);
 }
 public void TestSchoolNameIfEmptyStringToThrowArgumentException()
 {
     School mySchool = new School(string.Empty);
 }
예제 #18
0
        public void RemoveNullCourse()
        {
            School mySchool = new School();

            mySchool.RemoveCourse(null);
        }
예제 #19
0
        public void InitSchool()
        {
            School mySchool = new School();

            Assert.IsTrue(mySchool.Courses.Count == 0);
        }
 public void TestSchoolNameIfEqualToValidInput()
 {
     var mySchool = new School("abcd");
     var testSchoolName = "abcd";
     Assert.AreEqual(testSchoolName, mySchool.Name);
 }
 public void TestSchoolNameIfNullToThrowArgumentException()
 {
     School mySchool = new School(null);
 }
예제 #22
0
        public void AddNullStudent()
        {
            School mySchool = new School();

            mySchool.AddStudent(null);
        }
예제 #23
0
        public void AddNullCourse()
        {
            School mySchool = new School();

            mySchool.AddCourse(null);
        }
예제 #24
0
        public void LeaveCourseOfNull()
        {
            School mySchool = new School();

            Student pesho = new Student("Pesho", 99999, mySchool);

            pesho.LeaveCourse(null);
        }
예제 #25
0
 public void InitStudentWithEmptyName()
 {
     School mySchool = new School();
     Student pesho = new Student("", 19345, mySchool);
 }
예제 #26
0
 public void InitStudentWithTooBigNumber()
 {
     School mySchool = new School();
     Student pesho = new Student("Pesho", 100000, mySchool);
 }
예제 #27
0
 public void InitStudentWithNullName()
 {
     School mySchool = new School();
     Student pesho = new Student(null, 19345, mySchool);
 }