Пример #1
0
        public static async System.Threading.Tasks.Task PopulateTestDatabaseAsync(ExamContext examContext)
        {
            Student student = StudentTestUtils.GetStudent();
            Course  course  = CourseTestUtils.GetCourse();
            await examContext.AddNewAsync(student);

            await examContext.AddNewAsync(StudentTestUtils.GetStudent2());

            await examContext.AddNewAsync(course);

            await examContext.AddNewAsync(CourseTestUtils.GetCourse2());

            await examContext.AddNewAsync(ProfessorTestUtils.GetProfessor());

            await examContext.AddNewAsync(ProfessorTestUtils.GetProfessor2());

            await examContext.AddNewAsync(StudentCourseTestUtils.GetStudentCourse(student.Id, course.Id));

            await examContext.AddNewAsync(ExamTestUtils.GetExam());

            await examContext.AddNewAsync(ClassroomTestUtils.GetClassroom());

            await examContext.AddNewAsync(GradeTestUtils.GetInitialStateGrade());

            await examContext.AddNewAsync(ClassroomAllocationTestUtils.GetClassroomAllocation());

            await examContext.AddNewAsync(GradeTestUtils.GetGradeWithValue());

            await examContext.SaveAsync();
        }
Пример #2
0
 public void Setup()
 {
     client            = new CustomWebApplicationFactory <Startup>().CreateClient();
     course1           = CourseTestUtils.GetCourse();
     course2           = CourseTestUtils.GetCourse2();
     courseDetailsDto1 = CourseTestUtils.GetCourseDetailsDto(course1.Id);
     courseDetailsDto2 = CourseTestUtils.GetCourseDetailsDto(course2.Id);
     courseCreationDto = CourseTestUtils.GetCourseCreatingDto();
 }
Пример #3
0
 public void Setup()
 {
     this._student                  = StudentTestUtils.GetStudent();
     this._course                   = CourseTestUtils.GetCourse2();
     this._courseDto                = CourseTestUtils.GetCourseDetailsDto(_course.Id);
     this._studentCourse1           = StudentCourseTestUtils.GetStudentCourse(_student.Id, _course.Id);
     this._studentCourse2           = StudentCourseTestUtils.GetStudentCourse2();
     this._studentCourseCreationDto =
         StudentCourseTestUtils.GetStudentCourseCreationDto(this._studentCourse1.CourseId);
     this._mockReadRepository      = new Mock <IReadRepository>();
     this._mockWriteRepository     = new Mock <IWriteRepository>();
     this._mockStudentCourseMapper = new Mock <IStudentCourseMapper>();
     this._mockCourseMapper        = new Mock <ICourseMapper>();
     this._studentCourseService    = new StudentCourseService(_mockReadRepository.Object, _mockWriteRepository.Object, _mockStudentCourseMapper.Object, _mockCourseMapper.Object);
 }