コード例 #1
0
        public void Build_with_outputfile_and_no_restore_parameter_should_parse_correctly()
        {
            var arguments      = ArgumentParser.TryParse(new[] { "build", "--outfile", "jsonFile", "file1", "--no-restore" });
            var buildArguments = (BuildArguments?)arguments;

            // using classic assert so R# understands the value is not null
            Assert.IsNotNull(arguments);
            buildArguments !.InputFile.Should().Be("file1");
            buildArguments !.OutputToStdOut.Should().BeFalse();
            buildArguments !.OutputDir.Should().BeNull();
            buildArguments !.OutputFile.Should().Be("jsonFile");
            buildArguments !.NoRestore.Should().BeTrue();
        }
コード例 #2
0
        public void BuildOneFileStdOut_ShouldReturnOneFileAndStdout()
        {
            var arguments      = ArgumentParser.TryParse(new[] { "build", "--stdout", "file1" });
            var buildArguments = (BuildArguments?)arguments;

            // using classic assert so R# understands the value is not null
            Assert.IsNotNull(arguments);
            buildArguments !.InputFile.Should().Be("file1");
            buildArguments !.OutputToStdOut.Should().BeTrue();
            buildArguments !.OutputDir.Should().BeNull();
            buildArguments !.OutputFile.Should().BeNull();
            buildArguments !.NoRestore.Should().BeFalse();
        }
コード例 #3
0
        public void Build_with_outputdir_parameter_should_parse_correctly()
        {
            // Use relative . to ensure directory exists else the parser will throw.
            var arguments      = ArgumentParser.TryParse(new[] { "build", "--outdir", ".", "file1" });
            var buildArguments = (BuildArguments?)arguments;

            // using classic assert so R# understands the value is not null
            Assert.IsNotNull(arguments);
            buildArguments !.InputFile.Should().Be("file1");
            buildArguments !.OutputToStdOut.Should().BeFalse();
            buildArguments !.OutputDir.Should().Be(".");
            buildArguments !.OutputFile.Should().BeNull();
            buildArguments !.NoRestore.Should().BeFalse();
        }