• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CommandLineArgumentParser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CommandLineArgumentParser的典型用法代码示例。如果您正苦于以下问题:C# CommandLineArgumentParser类的具体用法?C# CommandLineArgumentParser怎么用?C# CommandLineArgumentParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CommandLineArgumentParser类属于命名空间,在下文中一共展示了CommandLineArgumentParser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ThenCanParseExcelDocumentationFormatWithLongFormSuccessfully

        public void ThenCanParseExcelDocumentationFormatWithLongFormSuccessfully()
        {
            var args = new[] {@"-documentation-format=excel"};

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            shouldContinue.ShouldBeTrue();
            configuration.DocumentationFormat.ShouldEqual(DocumentationFormat.Excel);
        }
开发者ID:renelou,项目名称:pickles,代码行数:11,代码来源:WhenParsingCommandLineArguments.cs


示例2: Then_can_parse_results_format_nunit_with_short_form_successfully

        public void Then_can_parse_results_format_nunit_with_short_form_successfully()
        {
            var args = new string[] { @"-trfmt=nunit" };

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser();
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Assert.AreEqual(true, shouldContinue);
            Assert.AreEqual(TestResultsFormat.NUnit, configuration.TestResultsFormat);
        }
开发者ID:hugohaggmark,项目名称:pickles,代码行数:11,代码来源:WhenParsingCommandLineArguments.cs


示例3: ThenCanParseExcelDocumentationFormatWithShortFormSuccessfully

        public void ThenCanParseExcelDocumentationFormatWithShortFormSuccessfully()
        {
            var args = new[] { @"-df=excel" };

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Check.That(shouldContinue).IsTrue();
            Check.That(configuration.DocumentationFormat).IsEqualTo(DocumentationFormat.Excel);
        }
开发者ID:MikeThomas64,项目名称:pickles,代码行数:11,代码来源:WhenParsingCommandLineArguments.cs


示例4: ThenCanFilterOutNonExistingTestResultFiles

        public void ThenCanFilterOutNonExistingTestResultFiles()
        {
            var args = new[] { @"-link-results-file=c:\DoesNotExist.xml;" };

              var configuration = new Configuration();
              var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
              bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

              shouldContinue.ShouldBeTrue();
              configuration.HasTestResults.ShouldBeFalse();
              Assert.AreEqual(0, configuration.TestResultsFiles.Count());
        }
开发者ID:Jaykul,项目名称:pickles,代码行数:12,代码来源:WhenParsingCommandLineArguments.cs


示例5: ThenCanParseHelpRequestWithLongFormSuccessfully

        public void ThenCanParseHelpRequestWithLongFormSuccessfully()
        {
            var args = new[] { @"--help" };

              var configuration = new Configuration();
              var writer = new StringWriter();
              var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
              bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, writer);

              StringAssert.Contains(expectedHelpString.ComparisonNormalize(),
                            writer.GetStringBuilder().ToString().ComparisonNormalize());
              shouldContinue.ShouldBeFalse();
        }
开发者ID:Wowbies,项目名称:pickles,代码行数:13,代码来源:WhenParsingCommandLineArguments.cs


示例6: Main

        static void Main(string[] args)
        {
            //Basic parsing of arguments for now
            var parser = new CommandLineArgumentParser();
            parser.Parse(args);

            //Create a cloak manager
            var manager = new CloakManager();
            //Create a cloaking context
            var cloakContext = new CloakContext(parser.Settings);
            //Run the manager
            manager.Run(cloakContext);
        }
开发者ID:modulexcite,项目名称:ncloak,代码行数:13,代码来源:Program.cs


示例7: Then_can_parse_long_form_arguments_successfully

        public void Then_can_parse_long_form_arguments_successfully()
        {
            var args = new string[] { @"--feature-directory=c:\features", @"--output-directory=c:\features-output" };

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser();
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Assert.AreEqual(true, shouldContinue);
            Assert.AreEqual(@"c:\features", configuration.FeatureFolder.FullName);
            Assert.AreEqual(@"c:\features-output", configuration.OutputFolder.FullName);
            Assert.AreEqual(false, configuration.HasTestResults);
            Assert.AreEqual(null, configuration.TestResultsFile);
        }
开发者ID:hugohaggmark,项目名称:pickles,代码行数:14,代码来源:WhenParsingCommandLineArguments.cs


示例8: ThenCanParseHelpRequestWithLongFormSuccessfully

    public void ThenCanParseHelpRequestWithLongFormSuccessfully()
    {
      var args = new[] { @"--help" };

      var configuration = new Configuration();
      var writer = new StringWriter();
      var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
      bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, writer);


      var actual = RetrieveString(writer);
      Check.That(actual).Contains(ExpectedHelpString.ComparisonNormalize());
      Check.That(shouldContinue).IsFalse();
    }
开发者ID:testpulse,项目名称:pickles,代码行数:14,代码来源:WhenParsingCommandLineArguments.cs


示例9: Then_can_parse_help_request_with_short_form_successfully

        public void Then_can_parse_help_request_with_short_form_successfully()
        {
            var args = new string[] { @"-h" };

            var configuration = new Configuration();
            var writer = new StringWriter();
            var commandLineArgumentParser = new CommandLineArgumentParser();
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, writer);

            StringAssert.Contains(expectedHelpString, writer.GetStringBuilder().ToString().Trim());
            Assert.AreEqual(false, shouldContinue);
            Assert.AreEqual(Path.GetFullPath(Directory.GetCurrentDirectory()), configuration.FeatureFolder.FullName);
            Assert.AreEqual(Path.GetFullPath(Environment.GetEnvironmentVariable("TEMP")), configuration.OutputFolder.FullName);
            Assert.AreEqual(false, configuration.HasTestFrameworkResults);
            Assert.AreEqual(null, configuration.LinkedTestFrameworkResultsFile);
        }
开发者ID:MikeEast,项目名称:pickles,代码行数:16,代码来源:WhenParsingCommandLineArguments.cs


示例10: ThenCanParseHelpRequestWithLongFormSuccessfully

        public void ThenCanParseHelpRequestWithLongFormSuccessfully()
        {
            var args = new[] {@"--help"};

            var configuration = new Configuration();
            var writer = new StringWriter();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, writer);


            StringAssert.Contains(expectedHelpString.ComparisonNormalize(),
                                  writer.GetStringBuilder().ToString().ComparisonNormalize());
            Assert.AreEqual(false, shouldContinue);
            Assert.AreEqual(Path.GetFullPath(Directory.GetCurrentDirectory()), configuration.FeatureFolder.FullName);
            Assert.AreEqual(Path.GetFullPath(Directory.GetCurrentDirectory()), configuration.OutputFolder.FullName);
            Assert.AreEqual(false, configuration.HasTestResults);
            Assert.AreEqual(null, configuration.TestResultsFile);
        }
开发者ID:eduaquiles,项目名称:pickles,代码行数:18,代码来源:WhenParsingCommandLineArguments.cs


示例11: ThenCanParseShortFormArgumentsSuccessfully

        public void ThenCanParseShortFormArgumentsSuccessfully()
        {
            var args = new[] { @"-f=c:\features", @"-o=c:\features-output" };

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Check.That(shouldContinue).IsTrue();
            Check.That(configuration.FeatureFolder.FullName).IsEqualTo(@"c:\features");
            Check.That(configuration.OutputFolder.FullName).IsEqualTo(@"c:\features-output");
        }
开发者ID:MikeThomas64,项目名称:pickles,代码行数:12,代码来源:WhenParsingCommandLineArguments.cs


示例12: ThenCanParseResultsFileWithShortFormSuccessfully

        public void ThenCanParseResultsFileWithShortFormSuccessfully()
        {
            FileSystem.AddFile(@"c:\results.xml", "<xml />");
            var args = new[] { @"-lr=c:\results.xml" };

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Check.That(shouldContinue).IsTrue();
            Check.That(configuration.HasTestResults).IsTrue();
            Check.That(configuration.TestResultsFile.FullName).IsEqualTo(@"c:\results.xml");
        }
开发者ID:MikeThomas64,项目名称:pickles,代码行数:13,代码来源:WhenParsingCommandLineArguments.cs


示例13: ThenCanParseResultsFileAsSemicolonSeparatedListThatEndsWithASemicolon

        public void ThenCanParseResultsFileAsSemicolonSeparatedListThatEndsWithASemicolon()
        {
            FileSystem.AddFile(@"c:\results1.xml", "<xml />");
            var args = new[] { @"-link-results-file=c:\results1.xml;" };

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Check.That(shouldContinue).IsTrue();
            Check.That(configuration.HasTestResults).IsTrue();
            Check.That(configuration.TestResultsFiles.Count()).IsEqualTo(1);
            Check.That(configuration.TestResultsFiles.First().FullName).IsEqualTo(@"c:\results1.xml");
        }
开发者ID:MikeThomas64,项目名称:pickles,代码行数:14,代码来源:WhenParsingCommandLineArguments.cs


示例14: ThenCanParseVersionRequestShortFormSuccessfully

        public void ThenCanParseVersionRequestShortFormSuccessfully()
        {
            var args = new[] {@"-v"};

            var configuration = new Configuration();
            var writer = new StringWriter();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, writer);

            StringAssert.IsMatch(expectedVersionString.ComparisonNormalize(),
                                 writer.GetStringBuilder().ToString().ComparisonNormalize());
            Assert.AreEqual(false, shouldContinue);
            Assert.AreEqual(Path.GetFullPath(Directory.GetCurrentDirectory()), configuration.FeatureFolder.FullName);
            Assert.AreEqual(Path.GetFullPath(Environment.GetEnvironmentVariable("TEMP")),
                            configuration.OutputFolder.FullName);
            Assert.AreEqual(false, configuration.HasTestResults);
            Assert.AreEqual(null, configuration.TestResultsFile);
        }
开发者ID:renelou,项目名称:pickles,代码行数:18,代码来源:WhenParsingCommandLineArguments.cs


示例15: ThenCanParseShortFormArgumentsSuccessfully

        public void ThenCanParseShortFormArgumentsSuccessfully()
        {
            var args = new[] {@"-f=c:\features", @"-o=c:\features-output"};

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Assert.AreEqual(true, shouldContinue);
            Assert.AreEqual(@"c:\features", configuration.FeatureFolder.FullName);
            Assert.AreEqual(@"c:\features-output", configuration.OutputFolder.FullName);
            Assert.AreEqual(false, configuration.HasTestResults);
            Assert.AreEqual(null, configuration.TestResultsFile);
        }
开发者ID:renelou,项目名称:pickles,代码行数:14,代码来源:WhenParsingCommandLineArguments.cs


示例16: ThenCanParseResultsFormatSpecrunWithLongFormSuccessfully

        public void ThenCanParseResultsFormatSpecrunWithLongFormSuccessfully()
        {
            var args = new[] { @"-test-results-format=specrun" };

              var configuration = new Configuration();
              var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
              bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

              shouldContinue.ShouldBeTrue();
              Assert.AreEqual(TestResultsFormat.SpecRun, configuration.TestResultsFormat);
        }
开发者ID:Wowbies,项目名称:pickles,代码行数:11,代码来源:WhenParsingCommandLineArguments.cs


示例17: ThenSetsLanguageToEnglishByDefault

        public void ThenSetsLanguageToEnglishByDefault()
        {
            var args = new[] { "" };

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Check.That(configuration.Language).IsEqualTo("en");
        }
开发者ID:MikeThomas64,项目名称:pickles,代码行数:10,代码来源:WhenParsingCommandLineArguments.cs


示例18: ThenCanParseResultsFormatSpecrunWithShortFormSuccessfully

        public void ThenCanParseResultsFormatSpecrunWithShortFormSuccessfully()
        {
            var args = new[] { @"-trfmt=specrun" };

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Check.That(shouldContinue).IsTrue();
            Check.That(configuration.TestResultsFormat).IsEqualTo(TestResultsFormat.SpecRun);
        }
开发者ID:MikeThomas64,项目名称:pickles,代码行数:11,代码来源:WhenParsingCommandLineArguments.cs


示例19: Then_can_parse_results_file_with_short_form_successfully

        public void Then_can_parse_results_file_with_short_form_successfully()
        {
            var args = new string[] { @"-lr=c:\results.xml" };

            var configuration = new Configuration();
            var commandLineArgumentParser = new CommandLineArgumentParser();
            bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

            Assert.AreEqual(true, shouldContinue);
            Assert.AreEqual(Path.GetFullPath(Directory.GetCurrentDirectory()), configuration.FeatureFolder.FullName);
            Assert.AreEqual(Path.GetFullPath(Environment.GetEnvironmentVariable("TEMP")), configuration.OutputFolder.FullName);
            Assert.AreEqual(true, configuration.HasTestFrameworkResults);
            Assert.AreEqual(@"c:\results.xml", configuration.LinkedTestFrameworkResultsFile.FullName);
        }
开发者ID:MikeEast,项目名称:pickles,代码行数:14,代码来源:WhenParsingCommandLineArguments.cs


示例20: ThenCanParseResultsFileWithShortFormSuccessfully

        public void ThenCanParseResultsFileWithShortFormSuccessfully()
        {
            var args = new[] { @"-lr=c:\results.xml" };

              var configuration = new Configuration();
              var commandLineArgumentParser = new CommandLineArgumentParser(FileSystem);
              bool shouldContinue = commandLineArgumentParser.Parse(args, configuration, TextWriter.Null);

              shouldContinue.ShouldBeTrue();
              configuration.HasTestResults.ShouldBeTrue();
              Assert.AreEqual(@"c:\results.xml", configuration.TestResultsFile.FullName);
        }
开发者ID:Wowbies,项目名称:pickles,代码行数:12,代码来源:WhenParsingCommandLineArguments.cs



注:本文中的CommandLineArgumentParser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CommandLineArguments类代码示例发布时间:2022-05-24
下一篇:
C# CommandLineApplication类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap