Example #1
0
        static void Main()
        {
            School testSchool = new School("NBU");

            Class testClass = new Class("Network technologies");

            Teacher testTeacher = new Teacher("Nikolay", "Kostov");

            Discipline testDiscipline1 = new Discipline("C++ Fundamentials", 2, 2);
            Discipline testDiscipline2 = new Discipline("C++ OOP", 2, 2);

            Student testStudent = new Student("Stavri", "Stamenkov", 3);

            testTeacher.AddDiscipline(testDiscipline1);
            testTeacher.AddDiscipline(testDiscipline2);

            testClass.AddStudent(new Student("Aleksandar", "Aleksandrov", 1));
            testClass.AddStudent(new Student("Ivan", "Ivanov", 2));
            testClass.AddStudent(testStudent);
            testClass.AddStudent(new Student("Yavor", "Kolev", 4));
            testClass.AddTeacher(testTeacher);

            testSchool.AddClass(testClass);

            testClass.RemoveStudent(testStudent);

            Console.WriteLine(testSchool);
        }
 public void TestCourseRemoveStudent()
 {
     Course english = new Course("English");
     Student misho = new Student("Misho");
     english.AddStudent(misho);
     english.Remove(misho);
     Assert.AreEqual(0, english.StudentsCount, "Student count is different!");
 }
 public void TestCourseAddStudent()
 {
     Student misho = new Student("Misho");
     Course english = new Course("English");
     english.AddStudent(misho);
     int studentCount = 1;
     Assert.AreEqual(studentCount, english.StudentsCount, "Student count is different");
 }
Example #4
0
 public void AddStudent(Student student)
 {
     if (this.students.Count < 29)
     {
         this.students.Add(student);
     }
     else
     {
         throw new ArgumentException("Course can have maximum 30 students. Limit for this course is reached");
     }
 }
Example #5
0
 public void Remove(Student student)
 {
     if (student != null)
     {
         this.students.Remove(student);
         this.StudentsCount--;
     }
     else
     {
         throw new NullReferenceException("Student does not exist!");
     }
 }
 public void TestCourseGetStudents()
 {
     //how to test this
     Course english = new Course("English");
     Student misho = new Student("Misho");
     english.AddStudent(misho);
     List<Student> testList = new List<Student>();
     testList.Add(misho);
     Assert.AreEqual(testList[0], english.Students[0],
         "Students in course are not the same");
     //CollectionAssert.AreEqual(testList, english.Students,
         //"Students in course are not the same");
 }
Example #7
0
 public void AddStudent(Student student)
 {
     bool isCourseFull = this.CheckIfCourseIsFull();
     if (!isCourseFull)
     {
         this.students.Add(student);
         this.StudentsCount++;
     }
     else
     {
         //Console.WriteLine("Course is full!");
         throw new ArgumentOutOfRangeException("Course is full!");
     }
 }
Example #8
0
 public void RemoveStudent(Student student)
 {
     this.students.Remove(student);
 }
Example #9
0
 //Methods
 public void AddStudent(Student student)
 {
     this.students.Add(student);
 }
 public void TestStudentGetUniqueNumber()
 {
     Student misho = new Student("Misho");
     int uniqueId = 10000;
     Assert.AreEqual(uniqueId, misho.UniqueNumber, "Student Unique Number are different!");
 }
 public void TestStudentGetName()
 {
     Student misho = new Student("Misho");
     string nameOfStudent = "Misho";
     Assert.AreSame(nameOfStudent, misho.Name, "Names are different!");
 }
 public void TestStudentEmptyName()
 {
     string emptyName = "";
     Student misho = new Student("");
     Assert.AreSame(emptyName, misho.Name, "Names are different");
 }