示例#1
0
 private TestCase TryCreateVsTestCase(UnittestTestCase test, string projectHome)
 {
     try {
         // Note: Test Explorer will show a key not found exception if we use a source path that doesn't match a test container's source.
         TestCase tc = test.ToVsTestCase(projectHome);
         return(tc);
     } catch (Exception ex) {
         Error(ex.Message);
     }
     return(null);
 }
示例#2
0
        public static TestCase ToVsTestCase(this UnittestTestCase test, string projectHome)
        {
            var relativeModulePath = PathUtils.CreateFriendlyFilePath(projectHome, test.Source);
            var fullyQualifiedName = MakeFullyQualifiedTestName(relativeModulePath, test.Id);
            var testCase           = new TestCase(fullyQualifiedName, PythonConstants.UnitTestExecutorUri, test.Source)
            {
                DisplayName  = test.Name,
                LineNumber   = test.Line,
                CodeFilePath = test.Source
            };

            return(testCase);
        }