private async Task ReloadDataContext() { if (!string.IsNullOrEmpty(_dte.Solution.FileName)) { Config.SetSolution(_dte.Solution.FileName); var myWorkspace = CoverageOverviewCommand.Instance.MyWorkspace; var rewrittenDocumentsStorage = new RewrittenDocumentsStorage(); ISolutionExplorer solutionExplorer = new SolutionExplorer(rewrittenDocumentsStorage, myWorkspace); ICoverageSettingsStore settingsStore = new XmlCoverageSettingsStore(); ICoverageStore coverageStore = new SqlCompactCoverageStore(); ITestExplorer testExplorer = new TestExplorer(solutionExplorer, new NUnitTestExtractor(), coverageStore, settingsStore); var xmlCoverageStore = new SqlCompactCoverageStore(); var vsSolutionTestCoverage = VsSolutionTestCoverage.CreateInstanceIfDoesNotExist(myWorkspace, new SolutionCoverageEngine(), xmlCoverageStore); var coverageOverviewViewModel = new CoverageOverviewViewModel(testExplorer, settingsStore, vsSolutionTestCoverage); await coverageOverviewViewModel.PopulateWithTestProjectsAsync(); DataContext = coverageOverviewViewModel; } }
private void InitSolutionCoverageEngine() { InitMyWorkspace(_serviceProvider); string solutionPath = _dte.Solution.FullName; if (_vsSolutionTestCoverage != null && _vsSolutionTestCoverage.MyWorkspace == _myWorkspace) return; Config.SetSolution(solutionPath); var sqlCompactCoverageStore = new SqlCompactCoverageStore(); var rewrittenDocumentsStorage = new RewrittenDocumentsStorage(); _vsSolutionTestCoverage = VsSolutionTestCoverage.CreateInstanceIfDoesNotExist(_myWorkspace, new SolutionCoverageEngine(), sqlCompactCoverageStore); _taskCoverageManager = new TaskCoverageManager(new VsDispatchTimer(), new RoslynDocumentProvider(), _vsSolutionTestCoverage); _roslynSolutionWatcher = new RoslynSolutionWatcher(_dte, _myWorkspace, sqlCompactCoverageStore, rewrittenDocumentsStorage, _taskCoverageManager); _roslynSolutionWatcher.DocumentRemoved += _roslynSolutionWatcher_DocumentRemoved; _roslynSolutionWatcher.Start(); }