public void FindConverterReturnsTheExpectedConverter(string path, Type converterType) { var fileSystem = new MockFileSystem(); var vcs = new PowerBiExtractor(fileSystem); vcs.FindConverter(path).GetType().ShouldBe(converterType); }
static void Main(string[] args) { var fileSystem = new FileSystem(); var extractor = new PowerBiExtractor(fileSystem); extractor.ExtractPbit("Files\\Template.pbit", "TemplateVcs", true); extractor.CompressPbit("TemplateVcs", "Files\\Template2.pbit", true); var options = new CommandLineOptions(); var result = Parser.Default.ParseArguments <CommandLineOptions>(args) .WithParsed(x => options = x); if (options.Input == options.Output) { Console.WriteLine("Error! Input and output paths cannot be same"); return; } if ((options.ExtractToVcs || options.CompressFromVcs) && string.IsNullOrEmpty(options.Output)) { Console.WriteLine("Error! Output is required for extraction and compression"); return; } if (options.ExtractToVcs) { extractor.ExtractPbit(options.Input, options.Output, options.Overwrite); } if (options.CompressFromVcs) { extractor.CompressPbit(options.Input, options.Output, options.Overwrite); } if (options.WriteToScreen) { extractor.WritePbitToScreen(options.Input); //if (Debugger.IsAttached) //{ // Console.ReadLine(); //} } }
private void ANewPowerBiExtractor() { _fileSystem = new MockFileSystem(new Dictionary <string, MockFileData>(), @"C:\Test\"); _extractor = new PowerBiExtractor(_fileSystem); }