예제 #1
0
        public TestCase GetCachedTestCase(string id)
        {
            if (_vsTestCaseMap.ContainsKey(id))
            {
                return(_vsTestCaseMap[id]);
            }

            _logger.Warning("Test " + id + " not found in cache");
            return(null);
        }
예제 #2
0
        public T GetService <T>()
            where T : class
        {
            var service = TestEngine.Services.GetService <T>();

            if (service == null)
            {
                logger.Warning($"Engine GetService can't create service {typeof(T)}.");
            }
            return(service);
        }
예제 #3
0
        private void MapTestCategory(string vsTestCategoryType)
        {
            if (vsTestCategoryType == null)
            {
                return;
            }
            var ok = TryParse.EnumTryParse(vsTestCategoryType, out VsTestCategoryType result);

            if (ok)
            {
                VsTestCategoryType = result;
            }
            else
            {
                _logger.Warning($"Invalid value ({vsTestCategoryType}) for VsTestCategoryType, should be either NUnit or MsTest");
            }
        }
예제 #4
0
        public GTestRunOutputParser(ITestSuite testSuite, ITestLogger logger)
        {
            _expectedTests = new Dictionary<string, ITest>();
            foreach (var testCase in testSuite.TestCases)
            {
                foreach (var test in testCase.Tests)
                {
                    var runName = GTestNameFormatter.GetRunName(test);
                    if (!_expectedTests.ContainsKey(runName))
                    {
                        _expectedTests.Add(GTestNameFormatter.GetRunName(test), test);
                    }
                    else
                    {
                        logger.Warning(string.Format("Seem to have multiple test cases with the same name... Skipping {0}", runName));
                    }
                }
            }

            _currentTestRun = new StringBuilder();
            _logger = logger;
        }