ForName() public static method

looks up a tokenizer by name from context classpath
public static ForName ( string name, string>.IDictionary args ) : TokenizerFactory
name string
args string>.IDictionary
return TokenizerFactory
コード例 #1
0
        public virtual void TestBogusLookupTokenizer()
        {
            try
            {
                TokenizerFactory.ForName("sdfsdfsdfdsfsdfsdf", new Dictionary <string, string>());
                fail();
            }
            catch (Exception expected) when(expected.IsIllegalArgumentException())
            {
                //
            }

            try
            {
                TokenizerFactory.ForName("!(**#$U*#$*", new Dictionary <string, string>());
                fail();
            }
            catch (Exception expected) when(expected.IsIllegalArgumentException())
            {
                //
            }
        }
コード例 #2
0
        public virtual void TestBogusLookupTokenizer()
        {
            try
            {
                TokenizerFactory.ForName("sdfsdfsdfdsfsdfsdf", new Dictionary <string, string>());
                fail();
            }
            catch (System.ArgumentException)
            {
                //
            }

            try
            {
                TokenizerFactory.ForName("!(**#$U*#$*", new Dictionary <string, string>());
                fail();
            }
            catch (System.ArgumentException)
            {
                //
            }
        }
コード例 #3
0
 public virtual void TestLookupTokenizer()
 {
     assertSame(typeof(WhitespaceTokenizerFactory), TokenizerFactory.ForName("Whitespace", VersionArgOnly()).GetType());
     assertSame(typeof(WhitespaceTokenizerFactory), TokenizerFactory.ForName("WHITESPACE", VersionArgOnly()).GetType());
     assertSame(typeof(WhitespaceTokenizerFactory), TokenizerFactory.ForName("whitespace", VersionArgOnly()).GetType());
 }