1   /*
2    * StringToBooleanConverterTest.java
3    * Created on 8 Август 2006 г., 17:29
4    */
5   
6   package org.weda.converter;
7   
8   import junit.framework.TestCase;
9   import org.weda.converter.impl.StringToBooleanConverter;
10  
11  /**
12   *
13   * @author Mikhail Titov
14   */
15  public class StringToBooleanConverterTest extends TestCase{
16      
17      public StringToBooleanConverterTest(String name) {
18          super(name);
19      }
20      
21      public void test() throws Exception {       
22          StringToBooleanConverter conv = new StringToBooleanConverter();
23          checkConverter(conv);
24      }
25      
26      public void checkConverter(ValueTypeConverter conv) 
27          throws Exception
28      {
29          assertEquals(true, conv.convert(Boolean.class, "yes", null));
30          assertEquals(true, conv.convert(Boolean.class, "true", null));
31          assertEquals(false, conv.convert(Boolean.class, "no", null));
32          assertEquals(false, conv.convert(Boolean.class, "false", null));
33      }
34      
35  }