示例#1
0
文件: TestInfo.cs 项目: zooba/PTVS
 public static TestInfo FromAbsolutePaths(string className, string methodName, string projectFilePath, string sourceCodeFilePath, int sourceCodeLineNumber, TestOutcome outcome, string classFilePath = null) {
     TestInfo ti = new TestInfo();
     ti.ClassName = className;
     ti.MethodName = methodName;
     ti.ProjectFilePath = projectFilePath;
     ti.SourceCodeFilePath = sourceCodeFilePath;
     ti.SourceCodeLineNumber = sourceCodeLineNumber;
     ti.Outcome = outcome;
     ti.ClassFilePath = classFilePath ?? sourceCodeFilePath;
     ti.RelativeClassFilePath = CommonUtils.GetRelativeFilePath(Path.GetDirectoryName(ti.ProjectFilePath), ti.ClassFilePath);
     return ti;
 }
示例#2
0
 private static TestInfo GetLoadErrorImportError(string importErrorFormat)
 => TestInfo.FromRelativePaths("ImportErrorTests", "test_import_error", "TestData\\TestAdapterTests\\LoadErrorTest.pyproj", @"TestData\TestAdapterTests\LoadErrorTestImportError.py", 5, TestOutcome.Failed, containedErrorMessage: string.Format(importErrorFormat, "boooo"));
示例#3
0
 private static TestInfo GetLoadErrorNoError()
 => TestInfo.FromRelativePaths("NoErrorTests", "test_no_error", "TestData\\TestAdapterTests\\LoadErrorTest.pyproj", @"TestData\TestAdapterTests\LoadErrorTestNoError.py", 4, TestOutcome.Passed);
示例#4
0
 private static TestInfo GetLoadErrorImportError(string projectName) => TestInfo.FromRelativePaths("ImportErrorTests", "test_import_error", $"TestData\\TestAdapterTests\\{projectName}.pyproj", @"TestData\TestAdapterTests\LoadErrorTestImportError.py", 5, TestOutcome.Failed);