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); }
public static void SetUserPattern(string pattern) { domain = new StringParam.Domain(Name, Sharpen.Pattern.Compile(pattern)); }
public static void SetUserPatternDomain(StringParam.Domain dm) { domain = dm; }