public void With_AllParsedOptions() { // Arrange const bool isCountAllVisitsNeeded = true; const bool isPlayMode = true; const bool isVerboseMode = true; const bool isKeepRunningAfterStoryFinishedNeeded = true; var pluginNames = new List <string>(); var parsedOptions = new ParsedCommandLineOptions() { IsCountAllVisitsNeeded = isCountAllVisitsNeeded, IsPlayMode = isPlayMode, IsVerboseMode = isVerboseMode, IsKeepOpenAfterStoryFinishNeeded = isKeepRunningAfterStoryFinishedNeeded, PluginNames = pluginNames, }; var processedOptions = new CommandLineToolOptions(); var tool = new CommandLineTool(); // Act tool.ProcesFlags(parsedOptions, processedOptions); // Assert parsedOptions.Should().NotBeNull("because the parsed options object was given"); processedOptions.Should().NotBeNull("because the processed options object was given"); processedOptions.IsCountAllVisitsNeeded.Should().Be(isCountAllVisitsNeeded, "because it was given"); processedOptions.IsPlayMode.Should().Be(isPlayMode, "because it was given"); processedOptions.IsVerboseMode.Should().Be(isVerboseMode, "because it was given"); processedOptions.IsKeepRunningAfterStoryFinishedNeeded.Should().Be(isKeepRunningAfterStoryFinishedNeeded, "because it was given"); processedOptions.PluginNames.Should().BeEquivalentTo(pluginNames, "because it was given"); }
public void With_InputFountainFile() { // Arrange const string inputFilePath = @"generating_testfile.ink"; const string startingDirectory = @"C:\Test"; var parsedOptions = new ParsedCommandLineOptions() { InputFilePath = inputFilePath }; var processedOptions = new CommandLineToolOptions(); var tool = new CommandLineTool(); // Act tool.ProcesOutputFountainFilePath(parsedOptions, processedOptions, startingDirectory); // Assert parsedOptions.Should().NotBeNull("because the parsed options object was given"); processedOptions.Should().NotBeNull("because the processed options object was given"); processedOptions.RootedOutputFountainFilePath.Should().Be(@"C:\Test\generating_testfile.ink.fountain", "because it was given"); }
public void With_RootedOutputFilePath() { // Arrange const string outputFilePath = @"C:\Test\testfile.ink.json"; const string startingDirectory = @"C:\Test"; var parsedOptions = new ParsedCommandLineOptions() { OutputFilePath = outputFilePath }; var processedOptions = new CommandLineToolOptions(); var tool = new CommandLineTool(); // Act tool.ProcesOutputFilePath(parsedOptions, processedOptions, startingDirectory); // Assert parsedOptions.Should().NotBeNull("because the parsed options object was given"); processedOptions.Should().NotBeNull("because the processed options object was given"); processedOptions.RootedOutputFilePath.Should().Be(outputFilePath, "because it was given"); }
public void With_InputFile() { // Arrange const string inputFilePath = @"testfile.ink"; const string startingDirectory = @"C:\SomeFolder"; var parsedOptions = new ParsedCommandLineOptions() { InputFilePath = inputFilePath }; var processedOptions = new CommandLineToolOptions(); var tool = new CommandLineTool(); // Act tool.ProcesInputFilePath(parsedOptions, processedOptions, startingDirectory); // Assert parsedOptions.Should().NotBeNull("because the parsed options object was given"); processedOptions.Should().NotBeNull("because the processed options object was given"); processedOptions.InputFilePath.Should().Be(inputFilePath, "because it was given"); processedOptions.InputFileName.Should().Be(@"testfile.ink", "because that is the filename part of the path"); processedOptions.RootedInputFilePath.Should().Be(@"C:\SomeFolder\testfile.ink", "because combines the starting directory with the filename"); processedOptions.InputFileDirectory.Should().Be(startingDirectory, "because the starting directory should be the default"); }