コード例 #1
0
 public void SingleRegexOptionsParsing()
 {
     Assert.AreEqual(RegexOptions.Compiled, RuleAttributeFactory.ParsePatternSingleFlags("cOmPiLed"));
     Assert.AreEqual(RegexOptions.CultureInvariant, RuleAttributeFactory.ParsePatternSingleFlags("CultureInvariant"));
     Assert.AreEqual(RegexOptions.ECMAScript, RuleAttributeFactory.ParsePatternSingleFlags("ECMAScript"));
     Assert.AreEqual(RegexOptions.ExplicitCapture, RuleAttributeFactory.ParsePatternSingleFlags("ExplicitCapture"));
     Assert.AreEqual(RegexOptions.IgnoreCase, RuleAttributeFactory.ParsePatternSingleFlags("IgnoreCase"));
     Assert.AreEqual(RegexOptions.IgnorePatternWhitespace, RuleAttributeFactory.ParsePatternSingleFlags("IgnorePatternWhitespace"));
     Assert.AreEqual(RegexOptions.Multiline, RuleAttributeFactory.ParsePatternSingleFlags("Multiline"));
     Assert.AreEqual(RegexOptions.None, RuleAttributeFactory.ParsePatternSingleFlags("None"));
     Assert.AreEqual(RegexOptions.RightToLeft, RuleAttributeFactory.ParsePatternSingleFlags("RightToLeft"));
     Assert.AreEqual(RegexOptions.Singleline, RuleAttributeFactory.ParsePatternSingleFlags("Singleline"));
     try
     {
         RuleAttributeFactory.ParsePatternSingleFlags("Pizza");
     }
     catch (ValidatorConfigurationException)
     {
         // Ok
     }
 }