public static void ClassInit(TestContext textContext)
 {
     controller               = new UserDemandController(UserDemandServiceGenerator.GetMockService().Object);
     controller.Request       = new HttpRequestMessage();
     controller.Configuration = new HttpConfiguration();
     AutoMapperInit.BuildMap();
 }
Example #2
0
 public void Initialize()
 {
     TestBootstrapper.TestServiceStructureMap();
     AutoMapperInit.BuildMap();
     domainService = ObjectFactory.GetInstance <IUserService>();
     domainService.UserRepository = ObjectFactory.GetInstance <IUserRepository>();
     domainService.UnitOfWork     = ObjectFactory.GetInstance <IUnitOfWork>();
 }
 public void Initialize()
 {
     TestBootstrapper.TestServiceStructureMap();
     AutoMapperInit.BuildMap();
     userService    = ObjectFactory.GetInstance <IUserService>();
     userController = new UserController(userService);
     MockControllerHelpers.RegisterTestRoutes();
 }
Example #4
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     AutoMapperInit.BuildMap();
     AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimsIdentity.DefaultNameClaimType;
 }
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
            AutoMapperInit.BuildMap();
            ControllerBuilder.Current.SetControllerFactory(new IOCControllerFactory());

            // Configure FluentValidation to use StructureMap
            var factory = new FluentValidatorFactory();

            // Tell MVC to use FluentValidation for validation
            ModelValidatorProviders.Providers.Add(new FluentValidationModelValidatorProvider(factory));
            DataAnnotationsModelValidatorProvider.AddImplicitRequiredAttributeForValueTypes = false;
        }
 public static void ClassInit(TestContext textContext)
 {
     domainService            = new NewsLetterService();
     domainService.UnitOfWork = UnitOfWorkGenerator.MockUnitOfWork();
     AutoMapperInit.BuildMap();
 }