@Test
public void testStringToEnum_Customized() throws Exception
{
final MasterConversionService service = Sapphire.service( MasterConversionService.class );
assertEquals( ThreeChoiceAnswerCustomized.YES, service.convert( "YES", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.YES, service.convert( "yes", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.YES, service.convert( "yEs", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.YES, service.convert( "1", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.YES, service.convert( "TRUE", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.YES, service.convert( "true", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.YES, service.convert( "tRuE", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.MAYBE, service.convert( "MAYBE", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.MAYBE, service.convert( "maybe", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.MAYBE, service.convert( "mAyBe", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.MAYBE, service.convert( "0", ThreeChoiceAnswerCustomized.class ) );
assertNull( service.convert( "NO", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.NO, service.convert( "no", ThreeChoiceAnswerCustomized.class ) );
assertNull( service.convert( "nO", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.NO, service.convert( "-1", ThreeChoiceAnswerCustomized.class ) );
assertNull( service.convert( "FALSE", ThreeChoiceAnswerCustomized.class ) );
assertEquals( ThreeChoiceAnswerCustomized.NO, service.convert( "false", ThreeChoiceAnswerCustomized.class ) );
assertNull( service.convert( "fAlSe", ThreeChoiceAnswerCustomized.class ) );
}