public void With_NullArguments() { // Arrange var tool = new CommandLineTool(); // Act tool.ProcesInputFilePath(null, null, null); // Assert // Without arguments the function should process nothing. }
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"); }