* string parameters are null or empty and if defaultChoice is not
* within of choices array
*/
public void test01() {
try {
new RealmChoiceCallback(null, choices, 0, true);
fail("IllegalArgumentException should be thrown for null prompt");
} catch (IllegalArgumentException e) {
}
try {
new RealmChoiceCallback("", choices, 0, true);
fail("IllegalArgumentException should be thrown for empty prompt");
} catch (IllegalArgumentException e) {
}
try {
new RealmChoiceCallback("prompt", null, 0, true);
fail("IllegalArgumentException should be thrown for null choices");
} catch (IllegalArgumentException e) {
}
try {
new RealmChoiceCallback("prompt", emptyCh, 0, true);
fail("IllegalArgumentException should be thrown for empty choices");
} catch (IllegalArgumentException e) {
}
try {
new RealmChoiceCallback("prompt", wrongCh1, 0, true);
fail("IllegalArgumentException should be thrown for incorrect choices");
} catch (IllegalArgumentException e) {
}
try {
new RealmChoiceCallback("prompt", wrongCh2, 0, false);
fail("IllegalArgumentException should be thrown for incorrect choices");
} catch (IllegalArgumentException e) {
}
try {
new RealmChoiceCallback("prompt", choices, -1, true);
fail("IllegalArgumentException should be thrown for incorrect choices");
} catch (IllegalArgumentException e) {
}
try {
new RealmChoiceCallback("prompt", choices, choices.length, true);
fail("IllegalArgumentException should be thrown for incorrect default index");
} catch (IllegalArgumentException e) {
}
try {
new RealmChoiceCallback("prompt", choices, choices.length + 1, true);
fail("IllegalArgumentException should be thrown for incorrect default index");
} catch (IllegalArgumentException e) {
}
}