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


C# ConsoleOptions.Validate方法代码示例

本文整理汇总了C#中System.ConsoleOptions.Validate方法的典型用法代码示例。如果您正苦于以下问题:C# ConsoleOptions.Validate方法的具体用法?C# ConsoleOptions.Validate怎么用?C# ConsoleOptions.Validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.ConsoleOptions的用法示例。


在下文中一共展示了ConsoleOptions.Validate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FixtureNamePlusAssemblyIsValid

 public void FixtureNamePlusAssemblyIsValid()
 {
     ConsoleOptions options = new ConsoleOptions( "-fixture:NUnit.Tests.AllTests", "nunit.tests.dll" );
     Assert.AreEqual("nunit.tests.dll", options.Parameters[0]);
     Assert.AreEqual("NUnit.Tests.AllTests", options.fixture);
     Assert.IsTrue(options.Validate());
 }
开发者ID:torkelo,项目名称:shouldly,代码行数:7,代码来源:CommandLineTests.cs

示例2: ExcludeCategories

 public void ExcludeCategories()
 {
     ConsoleOptions options = new ConsoleOptions( "tests.dll", "-exclude:Database;Slow" );
     Assert.IsTrue( options.Validate() );
     Assert.IsNotNull(options.exclude);
     Assert.AreEqual(options.exclude, "Database;Slow");
     Assert.IsTrue(options.HasExclude);
     string[] categories = options.ExcludedCategories;
     Assert.IsNotNull(categories);
     Assert.AreEqual(2, categories.Length);
     Assert.AreEqual("Database", categories[0]);
     Assert.AreEqual("Slow", categories[1]);
 }
开发者ID:fotisp,项目名称:conqat,代码行数:13,代码来源:CommandLineTests.cs

示例3: ExploreOptionWithoutPath

 public void ExploreOptionWithoutPath()
 {
     ConsoleOptions options = new ConsoleOptions("tests.dll", "-explore");
     Assert.True(options.Validate());
     Assert.True(options.Explore);
 }
开发者ID:rojac07,项目名称:nunit,代码行数:6,代码来源:CommandLineTests.cs

示例4: ResultOptionMayBeRepeated

        public void ResultOptionMayBeRepeated()
        {
            ConsoleOptions options = new ConsoleOptions("tests.dll", "-result:results.xml", "-result:nunit2results.xml;format=nunit2", "-result:myresult.xml;transform=mytransform.xslt");
            Assert.True(options.Validate(), "Should be valid");

            var specs = options.ResultOutputSpecifications;
            Assert.AreEqual(3, specs.Count);

            var spec1 = specs[0];
            Assert.AreEqual("results.xml", spec1.OutputPath);
            Assert.AreEqual("nunit3", spec1.Format);
            Assert.Null(spec1.Transform);

            var spec2 = specs[1];
            Assert.AreEqual("nunit2results.xml", spec2.OutputPath);
            Assert.AreEqual("nunit2", spec2.Format);
            Assert.Null(spec2.Transform);

            var spec3 = specs[2];
            Assert.AreEqual("myresult.xml", spec3.OutputPath);
            Assert.AreEqual("user", spec3.Format);
            Assert.AreEqual("mytransform.xslt", spec3.Transform);
        }
开发者ID:rojac07,项目名称:nunit,代码行数:23,代码来源:CommandLineTests.cs

示例5: NoInputFiles

 public void NoInputFiles()
 {
     ConsoleOptions options = new ConsoleOptions();
     Assert.True(options.Validate());
     Assert.AreEqual(0, options.InputFiles.Count);
 }
开发者ID:rojac07,项目名称:nunit,代码行数:6,代码来源:CommandLineTests.cs

示例6: FileNameWithoutXmlParameterLooksLikeParameter

		public void FileNameWithoutXmlParameterLooksLikeParameter()
		{
			ConsoleOptions options = new ConsoleOptions( "tests.dll", "result.xml" );
			Assert.IsTrue(options.Validate());
			Assert.AreEqual(2, options.Parameters.Count);
		}
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:6,代码来源:CommandLineTests.cs

示例7: IncludeAndExcludeAreInvalidTogether

 public void IncludeAndExcludeAreInvalidTogether()
 {
     ConsoleOptions options = new ConsoleOptions( "tests.dll", "-include:Database;Slow", "-exclude:Fast" );
     Assert.IsFalse( options.Validate() );
 }
开发者ID:fotisp,项目名称:conqat,代码行数:5,代码来源:CommandLineTests.cs

示例8: FileNameWithoutXmlParameterIsInvalid

 public void FileNameWithoutXmlParameterIsInvalid()
 {
     ConsoleOptions options = new ConsoleOptions( "tests.dll", ":result.xml" );
     Assert.IsFalse(options.Validate());
 }
开发者ID:taoxiease,项目名称:asegrp,代码行数:5,代码来源:CommandLineTests.cs

示例9: CanRecognizeLowerCaseOptionValues

        public void CanRecognizeLowerCaseOptionValues(string propertyName, string optionName, string[] canonicalValues)
        {
            PropertyInfo property = GetPropertyInfo(propertyName);
            Assert.AreEqual(typeof(string), property.PropertyType);

            foreach (string canonicalValue in canonicalValues)
            {
                string lowercaseValue = canonicalValue.ToLower(CultureInfo.InvariantCulture);
                string optionPlusValue = string.Format("--{0}:{1}", optionName, lowercaseValue);
                ConsoleOptions options = new ConsoleOptions(optionPlusValue);
                Assert.True(options.Validate(), "Should be valid: " + optionPlusValue);
                Assert.AreEqual(canonicalValue, (string)property.GetValue(options, null), "Didn't recognize " + optionPlusValue);
            }
        }
开发者ID:rojac07,项目名称:nunit,代码行数:14,代码来源:CommandLineTests.cs

示例10: TimeoutIsMinusOneIfNoOptionIsProvided

 public void TimeoutIsMinusOneIfNoOptionIsProvided()
 {
     ConsoleOptions options = new ConsoleOptions("tests.dll");
     Assert.True(options.Validate());
     Assert.AreEqual(-1, options.DefaultTimeout);
 }
开发者ID:rojac07,项目名称:nunit,代码行数:6,代码来源:CommandLineTests.cs

示例11: TimeoutParsesIntValueCorrectly

 public void TimeoutParsesIntValueCorrectly()
 {
     ConsoleOptions options = new ConsoleOptions("tests.dll", "-timeout:5000");
     Assert.True(options.Validate());
     Assert.AreEqual(5000, options.DefaultTimeout);
 }
开发者ID:rojac07,项目名称:nunit,代码行数:6,代码来源:CommandLineTests.cs

示例12: InvalidOption

 public void InvalidOption()
 {
     ConsoleOptions options = new ConsoleOptions("-asembly:nunit.tests.dll");
     Assert.False(options.Validate());
     Assert.AreEqual(1, options.ErrorMessages.Count);
     Assert.AreEqual("Invalid argument: -asembly:nunit.tests.dll", options.ErrorMessages[0]);
 }
开发者ID:rojac07,项目名称:nunit,代码行数:7,代码来源:CommandLineTests.cs

示例13: InvalidCommandLineParms

 public void InvalidCommandLineParms()
 {
     ConsoleOptions options = new ConsoleOptions("-garbage:TestFixture", "-assembly:Tests.dll");
     Assert.False(options.Validate());
     Assert.AreEqual(2, options.ErrorMessages.Count);
     Assert.AreEqual("Invalid argument: -garbage:TestFixture", options.ErrorMessages[0]);
     Assert.AreEqual("Invalid argument: -assembly:Tests.dll", options.ErrorMessages[1]);
 }
开发者ID:rojac07,项目名称:nunit,代码行数:8,代码来源:CommandLineTests.cs

示例14: AssemblyAloneIsValid

 public void AssemblyAloneIsValid()
 {
     ConsoleOptions options = new ConsoleOptions("nunit.tests.dll");
     Assert.True(options.Validate());
     Assert.AreEqual(0, options.ErrorMessages.Count, "command line should be valid");
 }
开发者ID:rojac07,项目名称:nunit,代码行数:6,代码来源:CommandLineTests.cs

示例15: AssemblyName

 public void AssemblyName()
 {
     ConsoleOptions options = new ConsoleOptions("nunit.tests.dll");
     Assert.True(options.Validate());
     Assert.AreEqual(1, options.InputFiles.Count);
     Assert.AreEqual("nunit.tests.dll", options.InputFiles[0]);
 }
开发者ID:rojac07,项目名称:nunit,代码行数:7,代码来源:CommandLineTests.cs


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