public void TestAddStudentExceptionWhenAlreadyAdded()
 {
     Course course = new Course("Math");
     Student student = new Student("Pesho");
     course.AddStudent(student);
     course.AddStudent(student);
 }
 public void AddStudentTestSameStudentTwoTimes()
 {
     string name = "Javascript";
     IList<Student> students = new List<Student>();
     Course course = new Course(name);
     Student maria = new Student("Maria Petrova", 12345);
     course.AddStudent(maria);
     course.AddStudent(maria);
 }
 public void AddStudentTestTwoStudents()
 {
     string name = "Javascript";
     IList<Student> students = new List<Student>();
     Course course = new Course(name);
     Student maria = new Student("Maria Petrova", 12345);
     Student petar = new Student("Petar Marinov", 23445);
     course.AddStudent(maria);
     course.AddStudent(petar);
     Assert.IsTrue(course.Students.Count == 2);
 }
        public void TestAddStudentRemoveStudent()
        {
            Course course = new Course("Math");
            Student student = new Student("Pesho");

            course.AddStudent(new Student("Gosho"));
            Assert.AreEqual(course.Students.Count, 1);

            course.AddStudent(student);
            Assert.AreEqual(course.Students.Count, 2);
            Assert.AreEqual(course.Students[1].Name, "Pesho");

            course.RemoveStudent(student);
            Assert.AreEqual(course.Students.Count, 1);
            Assert.AreEqual(course.Students[0].Name, "Gosho");
        }
 public void TestRemoveStudentExceptionWhenNotExisting()
 {
     Course course = new Course("Math");
     Student studentOne = new Student("Pesho");
     Student studentTwo = new Student("Gosho");
     course.AddStudent(studentOne);
     course.RemoveStudent(studentTwo);
 }
 public void TestAddStudentExceptionWhenStudentsTooMuch()
 {
     Course course = new Course("Math");
     for (int i = 0; i <= 30; i++)
     {
         course.AddStudent(new Student("Pesho"));
     }
 }
 public void AddStudentTestOneStudent()
 {
     string name = "Javascript";
     IList<Student> students = new List<Student>();
     Course course = new Course(name);
     Student maria = new Student("Maria Petrova", 12345);
     course.AddStudent(maria);
     Assert.IsTrue(course.Students.Count == 1);
 }
 public void CourseConstructorTestListStudents()
 {
     string name = "Javascript";
     Student maria = new Student("Maria Petrova", 12345);
     IList<Student> students = new List<Student>();
     Course course = new Course(name);
     course.AddStudent(maria);
     Assert.IsTrue(course.Students.Contains(maria));
 }
 public void ToStringTestTwoStudents()
 {
     string name = "Javascript";
     Student maria = new Student("Maria Petrova", 12345);
     Student petar = new Student("Petar Marinov", 23445);
     IList<Student> students = new List<Student>();
     Course javascript = new Course(name);
     javascript.AddStudent(maria);
     javascript.AddStudent(petar);
     string expected = "Course name Javascript; Student Maria Petrova, ID 12345; Student Petar Marinov, ID 23445; ";
     string actual;
     actual = javascript.ToString();
     Assert.AreEqual(expected, actual);
 }
Exemple #10
0
 public void AddStudentTestMoreThanMaximumStudents()
 {
     string name = "Javascript";
     IList<Student> students = new List<Student>();
     Course course = new Course(name);
     course.AddStudent(new Student("Maria Petrova", 12345));
     course.AddStudent(new Student("Maria Petrova", 12346));
     course.AddStudent(new Student("Maria Gocheva", 12347));
     course.AddStudent(new Student("Maria Mihaylova", 12348));
     course.AddStudent(new Student("Maria Grozeva", 12349));
     course.AddStudent(new Student("Maria Toneva", 12350));
     course.AddStudent(new Student("Maria Gecheva", 12351));
     course.AddStudent(new Student("Maria Gacheva", 12352));
     course.AddStudent(new Student("Maria Donkova", 12353));
     course.AddStudent(new Student("Maria Vrankova", 12354));
     course.AddStudent(new Student("Maria Drakonova", 12355));
     course.AddStudent(new Student("Maria Bobeva", 12356));
     course.AddStudent(new Student("Maria Kateva", 12357));
     course.AddStudent(new Student("Maria Bonkova", 12358));
     course.AddStudent(new Student("Maria Kolova", 12359));
     course.AddStudent(new Student("Maria Simova", 12360));
     course.AddStudent(new Student("Maria Koleva", 12361));
     course.AddStudent(new Student("Maria Popova", 12362));
     course.AddStudent(new Student("Maria Tsolova", 12363));
     course.AddStudent(new Student("Maria Doneva", 12364));
     course.AddStudent(new Student("Maria Dakova", 12365));
     course.AddStudent(new Student("Maria Makova", 12366));
     course.AddStudent(new Student("Maria Petkova", 12367));
     course.AddStudent(new Student("Maria Kamenova", 12368));
     course.AddStudent(new Student("Maria Vuchkova", 12369));
     course.AddStudent(new Student("Maria Komnina", 12370));
     course.AddStudent(new Student("Maria Burdina", 12371));
     course.AddStudent(new Student("Maria Hristova", 12372));
     course.AddStudent(new Student("Petar Marinov", 23445));
     course.AddStudent(new Student("Petar Krastev", 23446));
 }
 public void TestAddStudentExceptionWhenNull()
 {
     Course course = new Course("Math");
     course.AddStudent(null);
 }