public void Initialize() { _cacheServiceMock = new Mock<ICacheService>(); _membershipServiceMock = new Mock<IMembershipService>(); _applicationEnvironmentMock = new Mock<IApplicationEnvironment>(); _flexRoleStoreMock = new Mock<IFlexRoleStore>(); var personUoW = new PersonsUow(new PersonsContext()); _roleService = new MjrAppRoleService(new FlexRoleProvider(new RoleRepository<MjrAppRole, User>(personUoW))); _membershipService = new MembershipService(new FlexMembershipProvider(new MembershipRepository(personUoW), _applicationEnvironmentMock.Object), _roleService, new StubUnitOfWork()); _employeeController = new EmployeeController( new EmployeeLoginFacade( new EmployeeService(new EmployeeRepository(personUoW), personUoW) , _membershipService, new EmailService(), personUoW)); //new EmployeeController(new EmployeeService(new EmployeeRepository(personUoW), _membershipService, new EmailService(), personUoW), _cacheServiceMock.Object, _membershipService); }
public void Initialize() { _employeeRepositoryMock = new Mock<IEmployeeRepository>(); _unitOfWorkMock = new Mock<IUnitOfWork>(); _flexMembershipRepositoryMock = new Mock<IFlexMembershipRepository>(); _applicationEnvironmentMock = new Mock<IApplicationEnvironment>(); _flexRoleStoreMock = new Mock<IFlexRoleStore>(); _emailServiceMock = new Mock<IEmailService>(); _roleService = new MjrAppRoleService(new FlexRoleProvider(_flexRoleStoreMock.Object)); _membershipService = new MembershipService(new FlexMembershipProvider(_flexMembershipRepositoryMock.Object, _applicationEnvironmentMock.Object), _roleService, new StubUnitOfWork()); _principalMock = new Mock<IPrincipal>(); var httpContextBaseMock = new Mock<HttpContextBase>(); httpContextBaseMock.Setup(x => x.User).Returns(_principalMock.Object); _controllerContextMock = new Mock<ControllerContext>(); _controllerContextMock.Setup(x => x.HttpContext).Returns(httpContextBaseMock.Object); var requestContextMock = new RequestContext { HttpContext = httpContextBaseMock.Object }; _urlHelperMock = new UrlHelper(requestContextMock); _employeeController = new EmployeeController( new EmployeeLoginFacade( new EmployeeService(_employeeRepositoryMock.Object, _unitOfWorkMock.Object) , _membershipService, _emailServiceMock.Object, _unitOfWorkMock.Object)) { Url = _urlHelperMock }; _employeeController.Url = _urlHelperMock; }