public void TestMaxCodeLength() { IDictionary <String, String> args = new Dictionary <String, String>(); args.Put(PhoneticFilterFactory.ENCODER, "Metaphone"); args.Put(PhoneticFilterFactory.MAX_CODE_LENGTH, "2"); PhoneticFilterFactory factory = new PhoneticFilterFactory(args); factory.Inform(new ClasspathResourceLoader(factory.GetType())); assertEquals(2, ((Metaphone)factory.GetEncoder()).MaxCodeLen); }
public void TestFactoryDefaults() { IDictionary <String, String> args = new Dictionary <String, String>(); args.Put(PhoneticFilterFactory.ENCODER, "Metaphone"); PhoneticFilterFactory factory = new PhoneticFilterFactory(args); factory.Inform(new ClasspathResourceLoader(factory.GetType())); assertTrue(factory.GetEncoder() is Metaphone); assertTrue(factory.inject); // default }