private DirectoryInfo GetPath(IntegrationTestType type, bool useExpectedOutputPath) { return GetPath(GetDefaultPathString(type, useExpectedOutputPath), GetConfiguredPathString(type, useExpectedOutputPath)); }
private static string GetDefaultPathString(IntegrationTestType type, bool useExpectedOutputPath) { type.RequireDefinedValue(nameof(type)); var testTypeDirectory = DefaultSubdirectores[type]; var expectedSourceDirectory = useExpectedOutputPath? EXPECTED_OUTPUTS_DIRECTORY : SOURCE_DOCS_DIRECTORY; return Path.Combine(TEST_DATA_ROOT_PATH, testTypeDirectory, expectedSourceDirectory); }
private string GetConfiguredPathString(IntegrationTestType type, bool useExpectedOutputPath) { type.RequireDefinedValue(nameof(type)); string output; if(type == IntegrationTestType.Default && useExpectedOutputPath) { output = this.ExpectedOutputPath; } else if(type == IntegrationTestType.Default) { output = this.SourceDocumentPath; } else if(type == IntegrationTestType.SourceAnnotation && useExpectedOutputPath) { output = this.SourceAnnotationExpectedOutputPath; } else if(type == IntegrationTestType.SourceAnnotation) { output = this.SourceAnnotationSourceDocumentPath; } else if(type == IntegrationTestType.Model && useExpectedOutputPath) { output = this.ModelExpectedOutputPath; } else if(type == IntegrationTestType.Model) { output = this.ModelSourceDocumentPath; } else { throw new InvalidOperationException("Theoretically impossible scenario, broken test config implementation"); } return output; }
internal static DirectoryInfo GetDefaultPath(IntegrationTestType type, bool useExpectedOutputPath) { return GetPath(GetDefaultPathString(type, useExpectedOutputPath)); }
public DirectoryInfo GetSourceDocumentPath(IntegrationTestType type) { return GetPath(type, false); }
public DirectoryInfo GetExpectedOutputPath(IntegrationTestType type) { return GetPath(type, true); }
public DirectoryInfo GetExpectedOutputPath(IntegrationTestType type) { return IntegrationTestConfiguration.GetDefaultPath(type, true); }
public DirectoryInfo GetSourceDocumentPath(IntegrationTestType type) { return IntegrationTestConfiguration.GetDefaultPath(type, false); }