Esempio n. 1
0
        /// <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));
        }
Esempio n. 2
0
        /// <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));
        }
Esempio n. 3
0
 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));
 }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        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));
        }
Esempio n. 6
0
        public void EmptyInputTest()
        {
            var r = new StringRules(_minLength, _maxLength, CharType.All);

            Assert.IsFalse(r.IsValid(string.Empty));
        }
Esempio n. 7
0
        public void NullInputTest()
        {
            var r = new StringRules(_minLength, _maxLength, CharType.All);

            Assert.IsFalse(r.IsValid(null));
        }
Esempio n. 8
0
 public void NullInputTest()
 {
     var r = new StringRules(_minLength, _maxLength, CharType.All);
     Assert.IsFalse(r.IsValid(null));
 }
Esempio n. 9
0
 public void EmptyInputTest()
 {
     var r = new StringRules(_minLength, _maxLength, CharType.All);
     Assert.IsFalse(r.IsValid(string.Empty));
 }
Esempio n. 10
0
 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));
 }