Exemplo n.º 1
0
 public void Initialize()
 {
     httpContext      = new MockHttpContextWrapper();
     controllerToTest = new StudentApiController();
     //controllerToTest.ControllerContext = new ControllerContext(httpContext.Context.Object, new RouteData(), controllerToTest);
     dbContext = new DAL.SchoolContext(this.ConnectionString);
     //controllerToTest.DbContext = dbContext;
 }
Exemplo n.º 2
0
 public void Initialize()
 {
     httpContext      = new MockHttpContextWrapper();
     DBUtils.db       = new DAL.SchoolContext(this.ConnectionString);
     studentBL        = new StudentBL();
     generator        = new EntityGenerator();
     controllerToTest = new StudentApiController();
     //controllerToTest.ControllerContext = new ControllerContext(httpContext.Context.Object, new RouteData(), controllerToTest);
 }
 public StudentApiControllerTest()
 {
     studentMockRepository     = new Mock <IRepository <Student> >();
     this.StudentApiController = new StudentApiController(studentMockRepository.Object);
 }