Example #1
0
 public void Course_DeletingPresentStudent()
 {
     var course = new Course("Math");
     var student = new Student("Pesho", 19834);
     course.AddStudent(student);
     course.RemoveStudent(student);
     bool studentIsRemoved = course.CheckIfStudentExists(student);
     Assert.IsFalse(studentIsRemoved);
 }
Example #2
0
        public void Course_CreatingCourseWithExtraStudents()
        {
            var course = new Course("Math");

            for (int i = 1; i < 50; i++)
            {
                var student = new Student(i.ToString(), 10000 + i);
                course.AddStudent(student);
            }
        }
Example #3
0
 public void RemoveStudent(Student student)
 {
     if (StudentsInCourse.Contains(student))
     {
         StudentsInCourse.Remove(student);
     }
     else
     {
         throw new ArgumentOutOfRangeException("This student is not part of this course");
     }
 }
Example #4
0
 public void AddStudent(Student student)
 {
     if (StudentsInCourse.Count < 30)
     {
         StudentsInCourse.Add(student);
     }
     else
     {
         throw new ArgumentOutOfRangeException("Students in this Course should not be more than 30!");
     }
 }
Example #5
0
        public bool CheckIfStudentExists(Student subject)
        {
            var studentExists = false;

            foreach (var student in StudentsInCourse)
            {
                if (subject.Name == student.Name && subject.Number == student.Number)
                {
                    studentExists = true;
                    break;
                }
            }
            return studentExists;
        }
Example #6
0
 public void Student_CreateNormalStudent()
 {
     var student = new Student("Gosho", 12344);
     var isStudent = student is Student;
     Assert.IsTrue(isStudent);
 }
Example #7
0
 public void Student_CreatingStudentWithSameNumber()
 {
     var student = new Student("TEST", 10002);
     var student2 = new Student("TEST", 10002);
 }
Example #8
0
 public void Student_CreatingStudentWithBiggerNumber()
 {
     var student = new Student("TEST", 1000000);
 }
Example #9
0
 public void Student_CreatingStudentWithNoName()
 {
     var student = new Student(string.Empty, 10001);
 }
Example #10
0
 public void Student_CreatingStudentWithNullName()
 {
     var student = new Student(10000);
 }
Example #11
0
 public void Course_DeletingNonPresentStudent()
 {
     var course = new Course("Math");
     var student = new Student("Pesho", 19872);
     course.RemoveStudent(student);
 }