Example #1
0
        public void StartWithTheseTest_CollectionString()
        {
            Assert.False(StringJudgement.StartWithThese("0", new List <string> {
                "1", "2"
            }));
            Assert.False(StringJudgement.StartWithThese("123", new List <string> {
                "", ""
            }));
            Assert.False(StringJudgement.StartWithThese("1234", new List <string> {
                "234", "23"
            }));
            Assert.False(StringJudgement.StartWithThese("23", new List <string> {
                "234", "3"
            }));
            Assert.False(StringJudgement.StartWithThese("123", new List <string> {
                null, null
            }));
            Assert.False(StringJudgement.StartWithThese("", new List <string> {
                "", ""
            }));
            Assert.False(StringJudgement.StartWithThese("", new List <string> {
                null, null
            }));
            Assert.False(StringJudgement.StartWithThese(null, new List <string> {
                "", ""
            }));
            Assert.False(StringJudgement.StartWithThese(null, new List <string> {
                null, null
            }));
            Assert.False(StringJudgement.StartWithThese(null, new List <string> {
                "", null
            }));
            Assert.False(StringJudgement.StartWithThese("", new List <string> {
                "", null
            }));

            Assert.True(StringJudgement.StartWithThese("1234", new List <string> {
                "1", "12", "123", "234", "34", "4"
            }));
            Assert.True(StringJudgement.StartWithThese("1234", new List <string> {
                "1234", "123", "12", "1"
            }));

            List <string> nullList = new List <string>();

            nullList = null;
            Assert.False(StringJudgement.StartWithThese("", nullList));
        }
Example #2
0
        public void EndWithTheseTest_SingleString()
        {
            Assert.False(StringJudgement.EndWithThese("0", "1"));
            Assert.False(StringJudgement.EndWithThese("123", ""));
            Assert.False(StringJudgement.EndWithThese("1234", "123"));
            Assert.False(StringJudgement.EndWithThese("23", "234"));
            Assert.False(StringJudgement.EndWithThese("123", null));
            Assert.False(StringJudgement.EndWithThese("", null));
            Assert.False(StringJudgement.EndWithThese(null, ""));
            Assert.False(StringJudgement.EndWithThese(null, null));
            Assert.False(StringJudgement.EndWithThese("", ""));

            Assert.True(StringJudgement.EndWithThese("1234", "4"));
            Assert.True(StringJudgement.EndWithThese("1234", "1234"));
            Assert.True(StringJudgement.EndWithThese("12345678", "5678"));
        }
Example #3
0
        public void StartWithTheseTest_MutliStrings()
        {
            Assert.False(StringJudgement.StartWithThese("0", "1", "2"));
            Assert.False(StringJudgement.StartWithThese("123", "", ""));
            Assert.False(StringJudgement.StartWithThese("1234", "234", "23"));
            Assert.False(StringJudgement.StartWithThese("23", "234", "3"));
            Assert.False(StringJudgement.StartWithThese("123", null, null));
            Assert.False(StringJudgement.StartWithThese("", "", ""));
            Assert.False(StringJudgement.StartWithThese("", null, null));
            Assert.False(StringJudgement.StartWithThese(null, "", ""));
            Assert.False(StringJudgement.StartWithThese(null, null, null));
            Assert.False(StringJudgement.StartWithThese(null, "", null));
            Assert.False(StringJudgement.StartWithThese("", "", null));

            Assert.True(StringJudgement.StartWithThese("1234", "1", "12", "123", "234", "34", "4"));
            Assert.True(StringJudgement.StartWithThese("1234", "1234", "123", "12", "1"));
        }
Example #4
0
 public void ContainsNumberTest_False(string str)
 {
     Assert.False(StringJudgement.ContainsChineseCharacters(str));
 }
Example #5
0
 public void ContainsNumberTest_True(string str)
 {
     Assert.True(StringJudgement.ContainsNumber(str));
 }
Example #6
0
 public void ContainsChineseCharactersTest_True(string str)
 {
     Assert.True(StringJudgement.ContainsChineseCharacters(str));
 }
Example #7
0
 public void IsEmailTest_False(string mail)
 {
     Assert.False(StringJudgement.IsEmail(mail));
 }
Example #8
0
 public void IsEmailTest_True(string mail)
 {
     Assert.True(StringJudgement.IsEmail(mail));
 }
Example #9
0
 public void IsWebUrlTest_False(string url)
 {
     Assert.False(StringJudgement.IsWebUrl(url));
 }