示例#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();
        }
 public void Setup()
 {
     this._classroom            = ClassroomTestUtils.GetClassroom();
     this._classroomCreatingDto = ClassroomTestUtils.GetClassroomCreatingDto();
     this._classroomDetailsDto  = ClassroomTestUtils.GetClassroomDetailsDto(_classroom.Id);
     this._classroomMapper      = new ClassroomMapper();
 }
示例#3
0
 public void Setup()
 {
     this.client               = new CustomWebApplicationFactory <Startup>().CreateClient();
     this.classroom1           = ClassroomTestUtils.GetClassroom();
     this.classroom2           = ClassroomTestUtils.GetClassroom2();
     this.classroomCreatingDto = ClassroomTestUtils.GetClassroomCreatingDto();
     this.classroomDetailsDto1 = ClassroomTestUtils.GetClassroomDetailsDto(classroom1.Id);
 }
示例#4
0
 public void Setup()
 {
     this._classroom1           = ClassroomTestUtils.GetClassroom();
     this._classroom2           = ClassroomTestUtils.GetClassroom2();
     this._classroomCreatingDto = ClassroomTestUtils.GetClassroomCreatingDto();
     this._classroomDetailsDto1 = ClassroomTestUtils.GetClassroomDetailsDto(_classroom1.Id);
     this._classroomDetailsDto2 = ClassroomTestUtils.GetClassroomDetailsDto(_classroom2.Id);
     this._mockReadRepository   = new Mock <IReadRepository>();
     this._mockWriteRepository  = new Mock <IWriteRepository>();
     this._mockClassroomMapper  = new Mock <IClassroomMapper>();
     this._classroomService     = new ClassroomService(_mockWriteRepository.Object, _mockReadRepository.Object, _mockClassroomMapper.Object);
 }