当前位置: 首页>>代码示例>>C#>>正文


C# CommandLineArgumentParser类代码示例

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


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


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