public void Execute() { DefaultModelBinder.ResourceClassKey = "SystemWebMvc"; MvcHandler.DisableMvcResponseHeader = true; HtmlHelper.IdAttributeDotReplacement = "-"; GlobalResource.ResourceClassKey = "ReusableLibraryWebMvc"; Localization.DefaultLanguage = "en"; Localization.Languages = new[] { "en", "ru" }; CaptchaOptions.ResourceClassKey = "ReusableLibraryCaptcha"; var options = ConfigurationManager.AppSettings["CaptchaOptions"] ?? string.Empty; //// 1. Using default web cache ////CaptchaBuilder.Current.Setup(new DefaultCaptchaFactory( //// new CaptchaOptions(options))); //// 2. Using factory method to supply challenge code cache CaptchaBuilder.Current.Setup(new BitmapCaptchaFactory( new CaptchaOptions(options), () => DependencyResolver.Resolve <ICache>("Captcha"))); options = ConfigurationManager.AppSettings["CaptchaOptions2"] ?? string.Empty; ////CaptchaBuilder.Current.Setup(new DefaultCaptchaFactory( //// new CaptchaOptions(options))); CaptchaBuilder.Current.Setup(new BitmapCaptchaFactory( new CaptchaOptions(options), () => DependencyResolver.Resolve <ICache>("Captcha"))); }
protected ControllerTest() { ValidationServiceMock = new Mock <IValidationService>(MockBehavior.Strict); DependencyResolverMock = new Mock <IDependencyResolver>(); UnitOfWorkMock = new Mock <IUnitOfWork>(); HttpContextMock = new HttpContextMock(); DependencyResolver.InitializeWith(DependencyResolverMock.Object); ModelBinders.Binders.DefaultBinder = new TrimStringModelBinder(); }
protected override void Dispose(bool disposing) { if (!disposing) { return; } DependencyResolver.Reset(); ValidationServiceMock.VerifyAll(); UnitOfWorkMock.VerifyAll(); DependencyResolverMock.VerifyAll(); }