public void Leave(Student student)
        {
            if (student == null)
            {
                throw new ArgumentNullException("The student to leave can't be null!");
            }

            this.students.Remove(student);
        }
Esempio n. 2
0
 public Class(string name, Teacher[] teach, Student[] stud)
 {
     if (String.IsNullOrWhiteSpace(name)) throw new ArgumentNullException("The give argument is null or have only white spaces");
     else
     {
         ClassName = name;
         TeachersList = new List<Teacher>(teach);
         StudentsList = new List<Student>(stud);
     }
 }
        public void Join(Student student)
        {
            if (this.Students.Count == 30)
            {
                throw new OverflowException("The number of students int each ciurse must be between 1 and 30!");
            }

            if (student == null)
            {
                throw new ArgumentNullException("The stydent for joining the course can't be null!");
            }

            this.students.Add(student);
        }
Esempio n. 4
0
        static void Main()
        {
            Student[] inFirstClass = new Student[]
            {
                new Student("Alex","Borisov","1"),
                new Student("Borislav","Vaptsarov","2"),
                new Student("Kiril","Voinov","3")
            };

            Student[] inSecondClass = new Student[]
            {
                new Student("Fili[","Borisov","1"),
                new Student("Megan","Vasilova","2"),
                new Student("Aspartan","E525","3")
            };

            Discipline[] firstDiscipline = new Discipline[]
            {
                new Discipline("Mathematics",2,5),
                new Discipline("Algorithms",3,8),
                new Discipline("Sleeping",10,24)
            };

            Discipline[] secondDiscipline = new Discipline[]
            {
                new Discipline("Physics",2,5),
                new Discipline("Hitting",3,8),
                new Discipline("Peeing on ppl",2,4)
            };

            Teacher[] teachers = new Teacher[]
            {
                new Teacher("Ivan","Kostolov",firstDiscipline),
                new Teacher("Troll","Mogilov",secondDiscipline)
            };

            Teacher[] teachersS = new Teacher[]
            {
                new Teacher("Troll","Mogilov",secondDiscipline)
            };

            Class[] classes = new Class[]
            {
                new Class("12A",teachers,inFirstClass),
                new Class("12B",teachers,inSecondClass)
            };

            School thisSChool = new School("PMG - Akad. Ivan Guzelev", classes);
            Console.WriteLine(thisSChool);
        }
 public void Test_StudentNameShouldntBeNull()
 {
     Student firstStudent = new Student(null);
 }
 public void Test_StudentNameShouldntBeEmpty()
 {
     Student firstStudent = new Student(string.Empty);
 }
 public void Test_StudentsShouldHaveUniqueID()
 {
     Student firstStudent = new Student("Pesho");
     Student secondStudent = new Student("Gosho");
     Assert.AreNotEqual(firstStudent.Id, secondStudent.Id);
 }