public ToolsController(ApplicationSettings settings, UserServiceBase userManager, SettingsService settingsService, PageService pageService, SearchService searchService, IUserContext context, ListCache listCache, PageViewModelCache pageViewModelCache, IWikiImporter wikiImporter, IPluginFactory pluginFactory, WikiExporter wikiExporter) : base(settings, userManager, context, settingsService) { _pageService = pageService; _searchService = searchService; _listCache = listCache; _pageViewModelCache = pageViewModelCache; _wikiImporter = wikiImporter; _wikiExporter = wikiExporter; }
public void should_register_default_importers_and_exporter() { // Arrange IContainer container = CreateContainer(); // Act IWikiImporter wikiImporter = container.GetInstance <IWikiImporter>(); WikiExporter wikiExporter = container.GetInstance <WikiExporter>(); // Assert Assert.That(wikiImporter, Is.TypeOf <ScrewTurnImporter>()); Assert.That(wikiExporter, Is.TypeOf <WikiExporter>()); }
public UserManagementController(ApplicationSettings settings, UserServiceBase userManager, SettingsService settingsService, PageService pageService, SearchService searchService, IUserContext context, ListCache listCache, PageViewModelCache pageViewModelCache, SiteCache siteCache, IWikiImporter wikiImporter, IRepository repository, IPluginFactory pluginFactory) : base(settings, userManager, context, settingsService) { _settingsService = settingsService; _pageService = pageService; _searchService = searchService; _listCache = listCache; _pageViewModelCache = pageViewModelCache; _siteCache = siteCache; _wikiImporter = wikiImporter; _repository = repository; _pluginFactory = pluginFactory; }
public void Single_Constructor_Argument_Should_Register_Default_Instances() { // Arrange DependencyManager container = new DependencyManager(new ApplicationSettings()); // Act container.Configure(); ApplicationSettings settings = ObjectFactory.TryGetInstance <ApplicationSettings>(); IRepository repository = ObjectFactory.GetInstance <IRepository>(); IUserContext context = ObjectFactory.GetInstance <IUserContext>(); IPageService pageService = ObjectFactory.GetInstance <IPageService>(); MarkupConverter markupConverter = ObjectFactory.GetInstance <MarkupConverter>(); CustomTokenParser tokenParser = ObjectFactory.GetInstance <CustomTokenParser>(); UserViewModel userModel = ObjectFactory.GetInstance <UserViewModel>(); SettingsViewModel settingsModel = ObjectFactory.GetInstance <SettingsViewModel>(); AttachmentRouteHandler routerHandler = ObjectFactory.GetInstance <AttachmentRouteHandler>(); UserServiceBase userManager = ObjectFactory.GetInstance <UserServiceBase>(); IPluginFactory pluginFactory = ObjectFactory.GetInstance <IPluginFactory>(); IWikiImporter wikiImporter = ObjectFactory.GetInstance <IWikiImporter>(); IAuthorizationProvider authProvider = ObjectFactory.GetInstance <IAuthorizationProvider>(); IActiveDirectoryProvider adProvider = ObjectFactory.GetInstance <IActiveDirectoryProvider>(); // Assert Assert.That(settings, Is.Not.Null); Assert.That(repository, Is.TypeOf <LightSpeedRepository>()); Assert.That(context, Is.TypeOf <UserContext>()); Assert.That(pageService, Is.TypeOf <PageService>()); Assert.That(markupConverter, Is.TypeOf <MarkupConverter>()); Assert.That(tokenParser, Is.TypeOf <CustomTokenParser>()); Assert.That(userModel, Is.TypeOf <UserViewModel>()); Assert.That(settingsModel, Is.TypeOf <SettingsViewModel>()); Assert.That(userManager, Is.TypeOf <FormsAuthUserService>()); Assert.That(pluginFactory, Is.TypeOf <PluginFactory>()); Assert.That(wikiImporter, Is.TypeOf <ScrewTurnImporter>()); Assert.That(authProvider, Is.TypeOf <AuthorizationProvider>()); #if !MONO Assert.That(adProvider, Is.TypeOf <ActiveDirectoryProvider>()); #endif }
public void Setup() { _container = new MocksAndStubsContainer(); _applicationSettings = _container.ApplicationSettings; _context = _container.UserContext; _repository = _container.Repository; _settingsService = _container.SettingsService; _userService = _container.UserService; _pageCache = _container.PageViewModelCache; _listCache = _container.ListCache; _siteCache = _container.SiteCache; _cache = _container.MemoryCache; _pageService = _container.PageService; _wikiImporter = new ScrewTurnImporter(_applicationSettings, _repository); _pluginFactory = _container.PluginFactory; _searchService = _container.SearchService; _controller = new UserManagementController(_applicationSettings, _userService, _settingsService, _pageService, _searchService, _context, _listCache, _pageCache, _siteCache, _wikiImporter, _repository, _pluginFactory); }