Пример #1
0
        public void HelpOptionParameterTest(string[] param)
        {
            var result = new StandaloneCliOptionsTest(param);

            result.ExitCode
            .Should()
            .Be(0);
        }
Пример #2
0
        public void MissingOptionParameterTest(params string[] param)
        {
            var result = new StandaloneCliOptionsTest(param);

            result.ExitCode.Should().Be(160);

            result.Warnings.Count.Should().Be(1);
            result.Warnings[0].Should().Be($"Parse args exception: Missing required value for option '{param[0]}'.");
        }
Пример #3
0
        public void LegacyOptionTest(string cliOption, string[] param)
        {
            var result = new StandaloneCliOptionsTest(param);

            result.Count.Should().Be(0);

            result.Warnings.Count.Should().Be(1);
            result.Warnings[0].Should().Be(
                "Legacy option {option} not supported, please use -h option to get all the supported options."
                + "::" + cliOption
                );
        }
Пример #4
0
        public void UnsupportedOptionTest(params string[] param)
        {
            var result = new StandaloneCliOptionsTest(param);

            result.Count.Should().Be(0);

            result.Warnings.Count.Should().Be(param.Length);

            for (var i = 0; i < result.Warnings.Count; ++i)
            {
                var warning = result.Warnings[i];
                warning.Should().Be(
                    "Option {option} wrong or not supported, please use -h option to get all the supported options."
                    + "::" + param[i]
                    );
            }
        }