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; }
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"));
private static TestInfo GetLoadErrorNoError() => TestInfo.FromRelativePaths("NoErrorTests", "test_no_error", "TestData\\TestAdapterTests\\LoadErrorTest.pyproj", @"TestData\TestAdapterTests\LoadErrorTestNoError.py", 4, TestOutcome.Passed);
private static TestInfo GetLoadErrorImportError(string projectName) => TestInfo.FromRelativePaths("ImportErrorTests", "test_import_error", $"TestData\\TestAdapterTests\\{projectName}.pyproj", @"TestData\TestAdapterTests\LoadErrorTestImportError.py", 5, TestOutcome.Failed);