示例#1
0
        public virtual void TestUserNameOkAfterResettingPattern()
        {
            StringParam.Domain oldDomain  = UserParam.GetUserPatternDomain();
            string             newPattern = "^[A-Za-z0-9_][A-Za-z0-9._-]*[$]?$";

            UserParam.SetUserPattern(newPattern);
            UserParam userParam = new UserParam("1x");

            NUnit.Framework.Assert.IsNotNull(userParam.GetValue());
            userParam = new UserParam("123");
            NUnit.Framework.Assert.IsNotNull(userParam.GetValue());
            UserParam.SetUserPatternDomain(oldDomain);
        }
示例#2
0
 public static void SetUserPattern(string pattern)
 {
     domain = new StringParam.Domain(Name, Sharpen.Pattern.Compile(pattern));
 }
示例#3
0
 public static void SetUserPatternDomain(StringParam.Domain dm)
 {
     domain = dm;
 }