Пример #1
0
        public void RemoverRemoveCourse_ValidParameters_CourseRemoved()
        {
            // Arrange
            Creator.CreateCourse(Instances.Name, Instances.Description);
            Course course = Course.GetByID(1);

            Creator.CreateStudent(Instances.Name, Instances.Username, Instances.Password);
            Student student = Student.GetByID(2);

            course.AddStudent(student);
            Creator.CreateTeacher(Instances.Name, Instances.Username, Instances.Password);
            Teacher teacher = Teacher.GetByID(3);

            course.AddTeacher(teacher);
            Creator.CreateLesson(course, Instances.Description, Instances.Online,
                                 Instances.Date, Instances.Rooms, Instances.Filepaths);
            Creator.CreateAssignmentDescription(course, Instances.Description, Instances.Date, Instances.Filepaths);
            Creator.CreateCourseGrade(course, student, Instances.Grade, Instances.Comment);

            // Act
            Remover.RemoveCourse(course);

            // Assert
            Assert.AreEqual(0, Course.GetAll().Count);
            Assert.AreEqual(0, student.Courses.Count);
            Assert.AreEqual(0, teacher.Courses.Count);
            Assert.AreEqual(0, Lesson.GetAll().Count);
            Assert.AreEqual(0, AssignmentDescription.GetAll().Count);
            Assert.AreEqual(0, CourseGrade.GetAll().Count);
        }
Пример #2
0
        public void RemoverRemoveCourseGrade_ValidParameters_CourseGradeRemoved()
        {
            // Arrange
            Creator.CreateCourse(Instances.Name, Instances.Description);
            Course course = Course.GetByID(1);

            Creator.CreateCourseGrade(course, Instances.Student, Instances.Grade, Instances.Comment);
            CourseGrade courseGrade = CourseGrade.GetByID(1);

            // Act
            Remover.RemoveCourseGrade(courseGrade);

            // Assert
            Assert.AreEqual(0, course.CourseGrades.Count);
            Assert.AreEqual(0, CourseGrade.GetAll().Count);
        }