public void Init() { _studentRepository = StudentRepositoryMocker.GetStudentRepositoryMock(); _studentsController = new StudentsController(_studentRepository.Object); IQueryable<MainStudent> students = _studentsController.Get(); MainStudent student = students.First(); _newCourseStudent = new CourseStudent(); _newCourseStudent.StudentId = student.Id; _newCourseStudent.CourseId = 10; _newCourseStudent.Id = 4; _courseStudentRepository = CourseStudentRepositoryMocker.GetCourseStudentRepositoryMock(); _courseStudentController = new CourseStudentController(_courseStudentRepository.Object); HttpConfiguration configuration = new HttpConfiguration(); HttpRequestMessage request = new HttpRequestMessage(); _courseStudentController.Request = request; _courseStudentController.Request.Properties["MS_HttpConfiguration"] = configuration; }
public void Init() { _newStudent = new MainStudent(); _newStudent.FirstName = "Peyton"; _newStudent.LastName = "Manning"; _studentRepository = StudentRepositoryMocker.GetStudentRepositoryMock(); _studentsController = new StudentsController(_studentRepository.Object); HttpConfiguration configuration = new HttpConfiguration(); HttpRequestMessage request = new HttpRequestMessage(); _studentsController.Request = request; _studentsController.Request.Properties["MS_HttpConfiguration"] = configuration; }