當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。