Ejemplo n.º 1
0
 public void Init()
 {
     Repo = new Mock<Repository<User>>();
     FormsAuth = new Mock<IFormsAuthService>();
     Controller = new UserController(Repo.Object,FormsAuth.Object);
     User = new NewUserNoChildrenFixture().GetInstance();
     LoginInput = new LoginInputNewUserNoChildrenFixture().GetInstance();
     RegisterInput = new RegisterInputCompleteFixture().GetInstance();
     AuthService = new UserAuthService(User,Repo.Object);
 }
Ejemplo n.º 2
0
 public void Init()
 {
     Repo = new Mock<IRepository<User>>();
     Auth = new Mock<IAuthenticationService>();
     Controller = new UserController(Repo.Object, Auth.Object);
     Context = new Mock<HttpContextBase>(MockBehavior.Strict);
     Response = new Mock<HttpResponseBase>();
     Response.SetupGet(x => x.Cookies).Returns(new HttpCookieCollection());
     Context.SetupGet(x => x.Response).Returns(Response.Object);
     Controller.ControllerContext = new ControllerContext(Context.Object, new RouteData(), Controller);
 }