Exemplo n.º 1
0
        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;
            _container.ClearCache();

            _pageService   = _container.PageService;
            _wikiImporter  = new WikiImporterMock();
            _pluginFactory = _container.PluginFactory;
            _searchService = _container.SearchService;

            // There's no point mocking WikiExporter (and turning it into an interface) as
            // a lot of usefulness of these tests would be lost when creating fake Streams and zip files.
            _wikiExporter = new WikiExporter(_applicationSettings, _pageService, _repository, _pluginFactory);
            _wikiExporter.ExportFolder = AppDomain.CurrentDomain.BaseDirectory;

            _toolsController = new ToolsController(_applicationSettings, _userService, _settingsService, _pageService,
                                                   _searchService, _context, _listCache, _pageCache, _wikiImporter,
                                                   _repository, _pluginFactory, _wikiExporter);
        }
Exemplo n.º 2
0
        public void Setup()
        {
            _container           = new MocksAndStubsContainer();
            _applicationSettings = _container.ApplicationSettings;
            _repository          = _container.Repository;
            _pageService         = _container.PageService;
            _pluginFactory       = _container.PluginFactory;

            _wikiExporter = new WikiExporter(_applicationSettings, _pageService, _repository, _pluginFactory);
            _wikiExporter.ExportFolder = AppDomain.CurrentDomain.BaseDirectory;
        }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
        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>());
        }