CanvasTest.Canvas.CommandLineParsing.ModeParserTests.ParseCommonOptions_WithRequiredArguments_ReturnsSuccessfulResult C# (CSharp) Method

ParseCommonOptions_WithRequiredArguments_ReturnsSuccessfulResult() private method

private ParseCommonOptions_WithRequiredArguments_ReturnsSuccessfulResult ( UnitTests.TemporaryDirectoryFixture tempDirectory ) : void
tempDirectory UnitTests.TemporaryDirectoryFixture
return void
        public void ParseCommonOptions_WithRequiredArguments_ReturnsSuccessfulResult(TemporaryDirectoryFixture tempDirectory)
        {
            // arrange
            Option<CommonOptions> commonOptionsParser = new CommonOptionsParser();
            var kmerFasta = tempDirectory.CreateFile("kmer.fa");
            var bAlleleVcf = tempDirectory.GetFileLocation("ballele.vcf").Touch();
            var filterBed = tempDirectory.GetFileLocation("filter.bed").Touch();
            var output = tempDirectory.CreateSubdirectory("output");
            var genome = tempDirectory.CreateSubdirectory("WholeGenomeFasta");
            string[] stringInputArgument =
            {
                "-r", kmerFasta.ToString(), "-o", output.ToString(), "-g", genome.ToString(), "--b-allele-vcf", bAlleleVcf.ToString(), "--filter-bed", filterBed.ToString(), "--sample-name", "SampleName"
            };

            // act
            ParsingResult<CommonOptions> result = commonOptionsParser.Parse(stringInputArgument);

            // assert
            Assert.Equal("", result.ErrorMessage);
            Assert.True(result.Success);
            Assert.Equal(kmerFasta, result.Result.KmerFasta);
            Assert.Equal(output, result.Result.OutputDirectory);
            Assert.Equal(genome, result.Result.WholeGenomeFasta);
        }