/// <summary> /// Gets if the <paramref name="tag"/> is a valid guild tag. /// </summary> /// <param name="tag">The guild tag.</param> /// <returns>True if the <paramref name="tag"/> is a valid guild tag; otherwise false.</returns> public bool IsValidTag(string tag) { if (string.IsNullOrEmpty(tag)) { return(false); } return(_tagRules.IsValid(tag)); }
/// <summary> /// Gets if the <paramref name="name"/> is a valid guild name. /// </summary> /// <param name="name">The guild name.</param> /// <returns>True if the <paramref name="name"/> is a valid guild name; otherwise false.</returns> public bool IsValidName(string name) { if (string.IsNullOrEmpty(name)) { return(false); } return(_nameRules.IsValid(name)); }
public void AlphaUpperTest() { var r = new StringRules(_minLength, _maxLength, CharType.AlphaUpper); Assert.IsFalse(r.IsValid(_sLower)); Assert.IsTrue(r.IsValid(_sUpper)); Assert.IsFalse(r.IsValid(_sUpperLower)); Assert.IsFalse(r.IsValid(_sNumeric)); Assert.IsFalse(r.IsValid(_sPunctuation)); Assert.IsFalse(r.IsValid(_sSentence)); Assert.IsFalse(r.IsValid(_sWhitespace)); }
public void StringTooShortTest() { var r = new StringRules(_maxLength, _maxLength, CharType.Alpha | CharType.Punctuation | CharType.Whitespace); Assert.IsFalse(r.IsValid(_sLower)); Assert.IsFalse(r.IsValid(_sUpper)); Assert.IsFalse(r.IsValid(_sUpperLower)); Assert.IsFalse(r.IsValid(_sNumeric)); Assert.IsFalse(r.IsValid(_sPunctuation)); Assert.IsFalse(r.IsValid(_sSentence)); Assert.IsFalse(r.IsValid(_sWhitespace)); }
public void EmptyInputTest() { var r = new StringRules(_minLength, _maxLength, CharType.All); Assert.IsFalse(r.IsValid(string.Empty)); }
public void NullInputTest() { var r = new StringRules(_minLength, _maxLength, CharType.All); Assert.IsFalse(r.IsValid(null)); }