CreateTestEnvironment() static private method

static private CreateTestEnvironment ( IRunSettings runSettings, IMessageLogger messageLogger ) : TestEnvironment
runSettings IRunSettings
messageLogger IMessageLogger
return GoogleTestAdapter.Helpers.TestEnvironment
Ejemplo n.º 1
0
        public void DiscoverTests(IEnumerable <string> executables, IDiscoveryContext discoveryContext,
                                  IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
        {
            if (_testEnvironment == null || _testEnvironment.Options.GetType() == typeof(SettingsWrapper)) // check whether we have a mock
            {
                _testEnvironment = TestExecutor.CreateTestEnvironment(discoveryContext.RunSettings, logger);
                _discoverer      = new GoogleTestDiscoverer(_testEnvironment);
            }

            try
            {
                VsTestFrameworkReporter reporter = new VsTestFrameworkReporter(discoverySink);
                _discoverer.DiscoverTests(executables, reporter);
            }
            catch (Exception e)
            {
                _testEnvironment.LogError("Exception while discovering tests: " + e);
            }
        }