Beispiel #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);
 }
Beispiel #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);
            }
        }
Beispiel #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");
     }
 }
Beispiel #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!");
     }
 }
Beispiel #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;
        }
 public void Student_CreateNormalStudent()
 {
     var student = new Student("Gosho", 12344);
     var isStudent = student is Student;
     Assert.IsTrue(isStudent);
 }
 public void Student_CreatingStudentWithSameNumber()
 {
     var student = new Student("TEST", 10002);
     var student2 = new Student("TEST", 10002);
 }
 public void Student_CreatingStudentWithBiggerNumber()
 {
     var student = new Student("TEST", 1000000);
 }
 public void Student_CreatingStudentWithNoName()
 {
     var student = new Student(string.Empty, 10001);
 }
Beispiel #10
0
 public void Student_CreatingStudentWithNullName()
 {
     var student = new Student(10000);
 }
Beispiel #11
0
 public void Course_DeletingNonPresentStudent()
 {
     var course = new Course("Math");
     var student = new Student("Pesho", 19872);
     course.RemoveStudent(student);
 }