Exemple #1
0
        public override IWoxResultFinder PrepareContext()
        {
            var systemService                     = new SystemService("Wox.Workspacer");
            var workspacerSystemService           = new WorkspacerSystemService(systemService);
            var dataAccessService                 = new DataAccessService(workspacerSystemService);
            var workspacerConfigurationRepository = new WorkspacerConfigurationRepository(dataAccessService);
            var workspacerRepoRepository          = new WorkspacerRepoRepository(dataAccessService);
            var workspacerService                 = new WorkspacerService(dataAccessService, workspacerConfigurationRepository, workspacerRepoRepository, systemService, workspacerSystemService);
            var workspacerResultFinder            = new WorkspacerResultFinder(WoxContextService, workspacerService);

            return(workspacerResultFinder);
        }
        public void Init(string testName)
        {
            TestName = testName;
            QueryServiceMock                   queryService                      = new QueryServiceMock();
            WoxContextServiceMock              woxContextService                 = new WoxContextServiceMock(queryService);
            SystemServiceMock                  systemService                     = new SystemServiceMock();
            WorkspacerSystemServiceMock        workspacerSystemService           = new WorkspacerSystemServiceMock(systemService);
            IDataAccessService                 dataAccessService                 = new DataAccessService(workspacerSystemService);
            IWorkspacerConfigurationRepository workspacerConfigurationRepository = new WorkspacerConfigurationRepository(dataAccessService);
            IWorkspacerRepoRepository          workspacerRepoRepository          = new WorkspacerRepoRepository(dataAccessService);
            IWorkspacerService                 workspacerService                 = new WorkspacerService(dataAccessService, workspacerConfigurationRepository, workspacerRepoRepository, systemService, workspacerSystemService);
            WorkspacerResultFinder             workspacerResultFinder            = new WorkspacerResultFinder(woxContextService, workspacerService);

            systemService.ApplicationDataPath = GetApplicationDataPath();

            WoxContextService       = woxContextService;
            QueryService            = queryService;
            SystemService           = systemService;
            WorkspacerSystemService = workspacerSystemService;
            WorkspacerService       = workspacerService;
            WoxResultFinder         = workspacerResultFinder;

            WoxContextService.AddQueryFetcher("work", WoxResultFinder);
        }