コード例 #1
0
        public void AddStudentToCourseTest()
        {
            IList<Student> students = new List<Student>()
            {
                new Student("Ivan", "Ivanov", 12512),
                new Student("Pesho", "Peshov", 15122),
                new Student("Milena", "Georgieva", 61222)
            };
            string courseName = "Unit testing course";
            int expectedStudentsCount = students.Count + 1;

            Course course = new Course(courseName, students);
            course.AddStudent(new Student("Lili", "Marinova", 21221));

            Assert.AreEqual(expectedStudentsCount, course.Students.Count);
        }
コード例 #2
0
        public void AddNullToCourseTest()
        {
            IList<Student> students = new List<Student>()
            {
                new Student("Ivan", "Ivanov", 12512),
                new Student("Pesho", "Peshov", 15122),
            };
            string courseName = "Unit testing course";

            Course course = new Course(courseName, students);
            course.AddStudent(null);
        }
コード例 #3
0
 public void AddDuplicateStudentTest()
 {
     IList<Student> students = new List<Student>()
     {
         new Student("Ivan", "Ivanov", 12512),
         new Student("Pesho", "Peshov", 15122),
         new Student("Milena", "Georgieva", 61222)
     };
     string courseName = "Unit testing course";
     
     Course course = new Course(courseName, students);
     course.AddStudent(new Student("Pesho", "Peshov", 15122));
 }
コード例 #4
0
        public void AddStudentToFullCourseTest()
        {
            IList<Student> students = new List<Student>()
            {
                new Student("Ivan", "Ivanov", 12512),
                new Student("Pesho", "Peshov", 15122),
                new Student("Milena", "Georgieva", 61212),
                new Student("Ivan", "Ivanov", 12212),
                new Student("Pesho", "Peshov", 11122),
                new Student("Milena", "Georgieva", 61112),
                new Student("Ivan", "Ivanov", 12516),
                new Student("Pesho", "Peshov", 15121),
                new Student("Milena", "Georgieva", 11212),
                new Student("Ivan", "Ivanov", 17512),
                new Student("Pesho", "Peshov", 15882),
                new Student("Milena", "Georgieva", 61822),
                new Student("Ivan", "Ivanov", 12712),
                new Student("Pesho", "Peshov", 15772),
                new Student("Milena", "Georgieva", 71772),
                new Student("Ivan", "Ivanov", 13452),
                new Student("Pesho", "Peshov", 10122),
                new Student("Milena", "Georgieva", 61202),
                new Student("Ivan", "Ivanov", 10012),
                new Student("Pesho", "Peshov", 15022),
                new Student("Milena", "Georgieva", 61000),
                new Student("Ivan", "Ivanov", 12000),
                new Student("Pesho", "Peshov", 15182),
                new Student("Milena", "Georgieva", 61245),
                new Student("Ivan", "Ivanov", 14412),
                new Student("Pesho", "Peshov", 14822),
                new Student("Milena", "Georgieva", 64152),
                new Student("Ivan", "Ivanov", 11212),
                new Student("Pesho", "Peshov", 17722)
            };
            string courseName = "Unit testing course";

            Course course = new Course(courseName, students);
            course.AddStudent(new Student("Milena", "Georgieva", 67722));
        }