/// <summary> /// Initializes a new instance of <see cref="ProjbookEngine"/>. /// </summary> /// <param name="fileSystem">Initializes the required file system abstraction.</param> /// <param name="extensionPath">Initializes the required extension path.</param> /// <param name="csprojFile">Initializes the required <see cref="CsprojFile"/>.</param> /// <param name="indexConfiguration">Initializes the required <see cref="IndexConfiguration"/>.</param> /// <param name="outputDirectoryPath">Initializes the required <see cref="OutputDirectory"/>.</param> /// <param name="skipPdf">Initializes the required <see cref="SkipPdf"/>.</param> public ProjbookEngine(IFileSystem fileSystem, string csprojFile, string extensionPath, IndexConfiguration indexConfiguration, string outputDirectoryPath, bool skipPdf) { // Data validation Ensure.That(() => fileSystem).IsNotNull(); Ensure.That(() => csprojFile).IsNotNullOrWhiteSpace(); Ensure.That(() => indexConfiguration).IsNotNull(); Ensure.That(() => indexConfiguration.Configurations).HasItems(); Ensure.That(() => outputDirectoryPath).IsNotNullOrWhiteSpace(); Ensure.That(fileSystem.File.Exists(csprojFile), string.Format("Could not find '{0}' file", csprojFile)).IsTrue(); // Initialize this.fileSystem = fileSystem; this.CsprojFile = this.fileSystem.FileInfo.FromFileName(csprojFile); this.IndexConfiguration = indexConfiguration; this.OutputDirectory = this.fileSystem.DirectoryInfo.FromDirectoryName(outputDirectoryPath); this.snippetExtractorFactory = new SnippetExtractorFactory(this.fileSystem.DirectoryInfo.FromDirectoryName(this.fileSystem.Path.GetFullPath(extensionPath))); this.SkipPdf = skipPdf; }
public void Setup() { // Initialize extractor this.SnippetExtractorFactory = new SnippetExtractorFactory(TestsUtilities.EnsureExtensionsDeployed()); }