Пример #1
0
        public void Course_StudentIsExcluded()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student bratPit = new Student("Brat Pit", 10002);
            Student fracescoTotti = new Student("Francesco Totti", 10003);
            Student jessicaAlba = new Student("Jessica Alba", 10004);

            mathCourse[0] = bratPit;
            mathCourse[1] = fracescoTotti;
            mathCourse[2] = jessicaAlba;

            mathCourse.ExcludeParticipant(fracescoTotti);

            bool actual = true;
            for (int index = 0; index < 3; index++)
            {
                if (mathCourse[index] == fracescoTotti)
                {
                    actual = false;
                    break;
                }
            }

            Assert.IsTrue(actual,"Student is not removed from the course.");
        }
Пример #2
0
        public static void Main(string[] args)
        {
            //Student pesho = new Student("Pesho");
            //Console.WriteLine(pesho.Number);
            //Student gosho = new Student("Gosho");
            //Console.WriteLine(gosho.Number);
            //Student vlado = new Student("Vlado");
            //Console.WriteLine(vlado.Number);
            //Student kiro = new Student("Kiro");
            //Console.WriteLine(kiro.Number);
            //Student simo = new Student("Simo");
            //Console.WriteLine(simo.Number);

            //List<Student> students = new List<Student>();
            //students.Add(pesho);
            //students.Add(gosho);
            //students.Add(vlado);

            List<Student> students = new List<Student>();
            var student = new Student("Pesho");
            students.Add(student);
            Course course = new Course(students);
            course.Leave(student);
            Console.WriteLine();
        }
Пример #3
0
        public void Course_30IsOutOfRangeIndex()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student student = new Student("Anonymous", 10008);

            mathCourse[30] = student;
        }
Пример #4
0
        public void Course_Minus5IsOutOfRangeIndex()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student student = new Student("Anonymous", 10009);

            mathCourse[-5] = student;
        }
Пример #5
0
 public void SchoolAddCourseTest()
 {
     School school = new School();
     Course course = new Course("HQPC");
     school.AddCourse(course);
     Assert.AreEqual("HQPC", course.Name, "Adding courses to school works incorrectly.");
 }
Пример #6
0
        public void CrateCourse_CrateCourseAndGetItsCapacity()
        {
            int capacity = 10;
            Course course = new Course("css", 10);

            Assert.AreEqual(capacity, course.Capacity);
        }
Пример #7
0
        public void TestConstructorNormalName()
        {
            Course course = new Course("Chemistry");

            Assert.AreEqual("Chemistry", course.Name);
            Assert.AreEqual(0, course.EnrolledStudents.Count);
        }
Пример #8
0
        public void TestAddStudentNormalTest()
        {
            Course course = new Course("Chemistry");
            course.AddStudent(new Student("Hari", 11));

            Assert.IsTrue(course.HasStudent(new Student("Hari", 11)));
        }
Пример #9
0
 public void SchoolTestAddCourseSecondTime()
 {
     var course = new Course("Javascript");
     var school = new School("Boby Georgiev");
     school.AddCourse(course);
     school.AddCourse(course);
 }
Пример #10
0
 public void CourseAddStudentExistingStudentTest()
 {
     Course course = new Course("HQPC");
     Student student = new Student("Pesho Peshov", 11011);
     course.AddStudent(student);
     course.AddStudent(student);
 }
Пример #11
0
 public void CourseTestAdd()
 {
     var student = new Student("Gosho Goshov", 12300);
     var course = new Course("Csharp");
     course.AddStudent(student);
     course.AddStudent(student);
 }
Пример #12
0
 public void AddOneCourse_ExpectToBeStored()
 {
     Course course = new Course();
     this.school.AddCourse(course);
     Assert.AreEqual(1, this.school.Courses.Count, "Expect to have one course");
     Assert.AreSame(course, this.school.Courses[0], "Expect the stored course to be the same");
 }
Пример #13
0
 public void Add31Students_ExpectToThrow()
 {
     Course course31 = new Course();
     for (int i = 0; i <= 30; i++)
     {
         course31.AddStudent(new Student("Student" + i));
     }
 }
Пример #14
0
 public void AddNewStudent_AddTooManyStudents()
 {
     Course course = new Course("OS", 123);
     for (int i = 0; i < course.Capacity + 1; i++)
     {
         course.AddNewStudent(new Student((uint)i, "Gosho"));
     }
 }
Пример #15
0
        public void CourseTestRemoveExistentStudent()
        {
            var student = new Student("Ivan Ivanov", 12300);
            var course = new Course("CMS");

            course.AddStudent(student);
            course.RemoveStudent(student);
        }
Пример #16
0
 public void AddNewStudent_AddTooMuchStudents()
 {
     Course course = new Course("OS", 123);
     Student student = new Student(10000, "Pesho");
     Student studentWithSameID = new Student(10000, "Gosho");
     course.AddNewStudent(student);
     course.AddNewStudent(studentWithSameID);
 }
Пример #17
0
        public void SchoolTestRemoveExistentStudent()
        {
            var course = new Course("Javascript");
            var school = new School("TUES");

            school.AddCourse(course);
            school.RemoveCourse(course);
        }
Пример #18
0
 public void CourseTestRemove()
 {
     var student = new Student("Ivan Ivanov", 12300);
     var student1 = new Student("Petkan Ivanov", 12100);
     var course = new Course("Csharp");
     course.AddStudent(student);
     course.RemoveStudent(student1);
 }
Пример #19
0
        public void CourseTestAddStudentToFullList()
        {
            var course = new Course("Javascript APIs");

            for (var i = 1; i < 31; i++)
            {
                course.AddStudent(new Student("Test Student", i + 10000));
            }
        }
Пример #20
0
        public void SchoolAddStudentInCourseTest()
        {
            School cSharpSchool = new School("C# School");
            Course cSharpCourse = new Course("C# Course");

            cSharpSchool.AddCourse(cSharpCourse);

            Assert.AreEqual(1, cSharpSchool.CountOfCourses());
        }
Пример #21
0
        public void SchoolRemoveNotExistingStudentFromCourseTest()
        {
            School cSharpSchool = new School("C# School");
            Course cSharpCourse = new Course("C# Course");

            cSharpSchool.RemoveCourse(cSharpCourse);

            Assert.AreEqual(0, cSharpSchool.CountOfCourses());
        }
Пример #22
0
        public void SchoolTestRemoveNonExistingCourse()
        {
            var firstCourse = new Course("Javascript");
            var secondCourse = new Course("Csharp");
            var school = new School("TUES");

            school.AddCourse(firstCourse);
            school.RemoveCourse(secondCourse);
        }
Пример #23
0
        public void AddCourse(Course course)
        {
            if (course == null)
            {
                throw new ArgumentNullException("course", "Cannot add null as a course");
            }

            this.Courses.Add(course);
        }
Пример #24
0
        public void Course_StudentIsAdded()
        {
            Course<Student> mathCourse = new Course<Student>();
            Student student = new Student("Anonymous", 10001);

            mathCourse[0] = student;
            bool actual = (mathCourse[0] == (student));
            Assert.AreEqual(true, actual,"student is not added to the course.");
        }
Пример #25
0
        public void OneStudentInCourseLeaves()
        {
            List<Student> students = new List<Student>();
            students.Add(new Student("Petko", 12987));

            Course course = new Course();

            course.RemoveStudent(students[0]);
        }
Пример #26
0
 public void CourseAddAlreadyExistStudentInCourseTest()
 {
     string name = "C# Course";
     Student iliqn = new Student("Iliqn Dimitrov", 21475);
     Student dimitrov = new Student("Iliqn Dimitrov", 21475);
     Course cSharpCourse = new Course(name);
     cSharpCourse.AddStudent(iliqn);
     cSharpCourse.AddStudent(dimitrov);
 }
Пример #27
0
        public void CourseAddStudentInCourseTest()
        {
            string name = "C# Course";
            Student iliqn = new Student("Iliqn Dimitrov", 21475);
            Course cSharpCourse = new Course(name);
            cSharpCourse.AddStudent(iliqn);

            Assert.AreEqual(1, cSharpCourse.CountOfStudents());
        }
Пример #28
0
        public void AddCourse(Course course)
        {
            if (course == null)
            {
                throw new ArgumentNullException("Course can not be null");
            }

            this.courses.Add(course);
        }
Пример #29
0
 public void CheckLeaveMethod()
 {
     List<Student> students = new List<Student>();
     var student = new Student("Pesho");
     students.Add(student);
     Course course = new Course(students);
     course.Leave(student);
     Assert.AreEqual(0, course.Count);
 }
Пример #30
0
        static void Main(string[] args)
        {
            School school = new School();
            Course<Student> course = new Course<Student>();
            Student student = new Student("A",10000);

            course[0] = student;
            school.AddCourse(course);

        }