public void Test_countTokens() { // Test for method int java.util.StringTokenizer.countTokens() StringTokenizer st = new StringTokenizer("This is a test String"); assertEquals("Incorrect token count returned", 5, st.CountTokens()); }
public void Test_ConstructorLjava_lang_StringLjava_lang_String() { // Test for method java.util.StringTokenizer(java.lang.String, // java.lang.String) StringTokenizer st = new StringTokenizer("This:is:a:test:String", ":"); assertTrue("Created incorrect tokenizer", st.CountTokens() == 5 && (st.NextToken().equals("This"))); }
public void Test_ConstructorLjava_lang_StringLjava_lang_StringZ() { // Test for method java.util.StringTokenizer(java.lang.String, // java.lang.String, boolean) StringTokenizer st = new StringTokenizer("This:is:a:test:String", ":", true); st.NextToken(); assertTrue("Created incorrect tokenizer", st.CountTokens() == 8 && (st.NextToken().Equals(":", StringComparison.Ordinal))); }