コード例 #1
0
 public void ConstructorTest4()
 {
     StringTokenizer tok = new StringTokenizer("A true Klingon warrior does NOT comment his code!", " ", false);
     Assert.AreEqual(tok.CountTokens(), 9);
 }
コード例 #2
0
 public void ConstructorTest()
 {
     StringTokenizer tok = new StringTokenizer(null);
     Assert.AreEqual(tok.CountTokens(), 0);
 }
コード例 #3
0
 public void ConstructorTest1()
 {
     StringTokenizer tok = new StringTokenizer("1\t2\n3\r4\f5 6", (Regex)null);
     Assert.AreEqual(tok.CountTokens(), 6);
 }
コード例 #4
0
 public void CountTokensTest()
 {
     string str = "1 2 3 4 5";
     StringTokenizer tok = new StringTokenizer(str);
     Assert.AreEqual(tok.CountTokens(), 5);
     str = "1 2\n\f3 \t4 5 ";
     tok = new StringTokenizer(str);
     Assert.AreEqual(tok.CountTokens(), 5);
     tok = new StringTokenizer("");
     Assert.AreEqual(tok.CountTokens(), 0);
     str = "0 0 1 2 3 4 5";
     tok = new StringTokenizer(str);
     tok.NextToken();
     tok.NextToken();
     Assert.AreEqual(tok.CountTokens(), 5);
 }