@Test public void testTextareaChoiceListProvider_choiceListText() { // complete tests are done in TextareaStringListUtilityTest. String choiceListText = "a\nb\nc\n"; TextareaChoiceListProvider target = new TextareaChoiceListProvider(choiceListText, null, false, null); assertEquals( "Basic test of choiceListText in TextareaChoiceListProvider()", Arrays.asList("a", "b", "c"), target.getChoiceList()); }
@Test public void testTextareaChoiceListProvider_defaultChoice() { // a value { String defaultChoice = "b"; TextareaChoiceListProvider target = new TextareaChoiceListProvider("a\nb\nc", defaultChoice, false, null); assertEquals("a value", defaultChoice, target.getDefaultChoice()); } // null { String defaultChoice = null; TextareaChoiceListProvider target = new TextareaChoiceListProvider("a\nb\nc", defaultChoice, false, null); assertEquals("null", defaultChoice, target.getDefaultChoice()); } // empty { String defaultChoice = ""; TextareaChoiceListProvider target = new TextareaChoiceListProvider("a\nb\nc", defaultChoice, false, null); assertEquals("empty", defaultChoice, target.getDefaultChoice()); } // blank { String defaultChoice = " "; TextareaChoiceListProvider target = new TextareaChoiceListProvider("a\nb\nc", defaultChoice, false, null); assertEquals("blank", defaultChoice, target.getDefaultChoice()); } }