コード例 #1
0
        public NUnitResults Explore(TestFilter filter)
        {
            var timing  = new TimingLogger(settings, logger);
            var results = new NUnitResults(Runner.Explore(filter));

            timing.LogTime($"Execution engine discovery time with filter length {filter.Text.Length}");
            if (filter.Text.Length < 300)
            {
                logger.Debug($"Filter: {filter.Text}");
            }

            return(results);
        }
コード例 #2
0
        public TestCase GetCachedTestCase(string id)
        {
            if (_vsTestCaseMap.ContainsKey(id))
            {
                return(_vsTestCaseMap[id]);
            }

            _logger.Debug("Test " + id + " not found in cache");
            return(null);
        }
コード例 #3
0
        protected TestContainerDiscoverer(
            IServiceProvider serviceProvider,
            ITestsService testsService,
            TestSettingsProvider testSettingsProvider,
            ITestLogger logger
            )
        {
            Logger = logger;
            try
            {
                TestSettingsProvider = testSettingsProvider;
                TestAdapterInfo = CreateTestAdapterInfo();

                Containers = new TestContainerList(this);

                ServiceProvider = serviceProvider;
                _testsService = testsService;

                SolutionListener = new SolutionListener(serviceProvider);
                SolutionListener.SolutionLoaded += OnSolutionLoaded;
                SolutionListener.SolutionUnloaded += OnSolutionUnloaded;
                SolutionListener.ProjectChanged += OnSolutionProjectChanged;
                SolutionListener.StartListening();

                ProjectListener = new ProjectListener(serviceProvider, Logger);
                ProjectListener.FileAdded += (source, e) => OnProjectFileAdded(e.Project, e.File);
                ProjectListener.FileRemoved += (source, e) => OnProjectFileRemoved(e.Project, e.File);
                ProjectListener.FileRenamed += (source, e) => OnProjectFileRenamed(e.Project, e.OldFile, e.NewFile);
                ProjectListener.StartListening();

                RunScheduler = new Scheduler(250, RunTestsInternal);
                RefreshTestContainersScheduler = new Scheduler<string>(250, RefreshTestContainersInternal);

                Logger.Debug("TestContainerDiscoverer created");
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw;
            }
        }