public void Setup()
 {
     client          = new CustomWebApplicationFactory <Startup>().CreateClient();
     exam            = ExamTestUtils.GetExam();
     examDto         = ExamTestUtils.GetExamDto(exam.Id);
     examCreatingDto = ExamTestUtils.GetExamCreatingDto();
 }
 public void Setup()
 {
     this._exam            = ExamTestUtils.GetExam();
     this._examDto         = ExamTestUtils.GetExamDto(this._exam.Id);
     this._examCreatingDto = ExamTestUtils.GetExamCreatingDto();
     this._examMapper      = new ExamMapper();
 }
        public async Task getAllExamsForACourse_ShouldReturnExamsForThatCourse()
        {
            List <ExamDto> examDtosExpected = new List <ExamDto> {
                ExamTestUtils.GetExamDto(exam.Id)
            };
            var response = await client.GetAsync("api/courses/" + CourseTestUtils.GetCourse().Id
                                                 + "/exams");

            //Assert
            response.EnsureSuccessStatusCode();
            var responseString = await response.Content.ReadAsStringAsync();

            List <ExamDto> examsDetailsDtosActual = JsonConvert.DeserializeObject <List <ExamDto> >(responseString);

            examsDetailsDtosActual.Should().BeEquivalentTo(examDtosExpected);
        }
 public void TestInitialize()
 {
     this._exam                           = ExamTestUtils.GetExam();
     this._examDto                        = ExamTestUtils.GetExamDto(_exam.Id);
     this._examCreatingDto                = ExamTestUtils.GetExamCreatingDto();
     this._mockReadRepository             = new Mock <IReadRepository>();
     this._mockWriteRepository            = new Mock <IWriteRepository>();
     this._mockCourseService              = new Mock <ICourseService>();
     this._mockExamMapper                 = new Mock <IExamMapper>();
     this._mockStudentCourseService       = new Mock <IStudentCourseService>();
     this._mockStudentService             = new Mock <IStudentService>();
     this._mockClassroomAllocationService = new Mock <IClassroomAllocationService>();
     this._mockClassroomAllocationMapper  = new Mock <IClassroomAllocationMapper>();
     this._mockStudentMapper              = new Mock <IStudentMapper>();
     this._mockGradeMapper                = new Mock <IGradeMapper>();
     this._mockEmailService               = new Mock <IEmailService>();
     _examService                         = new ExamService(_mockReadRepository.Object, _mockWriteRepository.Object,
                                                            _mockExamMapper.Object, _mockCourseService.Object,
                                                            _mockStudentCourseService.Object, _mockStudentService.Object,
                                                            _mockClassroomAllocationService.Object, _mockClassroomAllocationMapper.Object,
                                                            _mockGradeMapper.Object, _mockStudentMapper.Object, _mockEmailService.Object);
 }