本文整理汇总了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;未经允许,请勿转载。 |
请发表评论