public void AddStudents() { School mySchool = new School(); mySchool.AddStudent(new Student("Pesho", 10004, mySchool)); mySchool.AddStudent(new Student("Pesho", 10005, mySchool)); }
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); }
public void InitStudent() { School mySchool = new School(); Student pesho = new Student("Pesho", 10001, mySchool); Assert.IsTrue(pesho.Name == "Pesho"); Assert.IsTrue(pesho.Number == 10001); }
public void JoinCourseOfNull() { School mySchool = new School(); Student pesho = new Student("Pesho", 10000, mySchool); pesho.JointCourse(null); }
public void AddCourse() { School mySchool = new School(); mySchool.AddCourse(new Course()); mySchool.AddCourse(new Course()); Assert.IsTrue(mySchool.Courses.Count == 2); }
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); }
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); }
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)); }
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); }
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()); }
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); }
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); }
public void InitStudentWithTooSmallNumber() { School mySchool = new School(); Student pesho = new Student("Pesho", 9999, mySchool); }
public void TestSchoolNameIfEmptyStringToThrowArgumentException() { School mySchool = new School(string.Empty); }
public void RemoveNullCourse() { School mySchool = new School(); mySchool.RemoveCourse(null); }
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); }
public void AddNullStudent() { School mySchool = new School(); mySchool.AddStudent(null); }
public void AddNullCourse() { School mySchool = new School(); mySchool.AddCourse(null); }
public void LeaveCourseOfNull() { School mySchool = new School(); Student pesho = new Student("Pesho", 99999, mySchool); pesho.LeaveCourse(null); }
public void InitStudentWithEmptyName() { School mySchool = new School(); Student pesho = new Student("", 19345, mySchool); }
public void InitStudentWithTooBigNumber() { School mySchool = new School(); Student pesho = new Student("Pesho", 100000, mySchool); }
public void InitStudentWithNullName() { School mySchool = new School(); Student pesho = new Student(null, 19345, mySchool); }