下面列出了java.text.ChoiceFormat#setChoices ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* @tests java.text.ChoiceFormat#clone()
*/
public void test_clone() {
// Test for method java.lang.Object java.text.ChoiceFormat.clone()
ChoiceFormat f = (ChoiceFormat) f1.clone();
assertTrue("Not equal", f.equals(f1));
f.setChoices(new double[] { 0, 1, 2 }, new String[] { "0", "1", "2" });
assertTrue("Equal", !f.equals(f1));
}
/**
* @tests java.text.ChoiceFormat#setChoices(double[], java.lang.String[])
*/
public void test_setChoices$D$Ljava_lang_String() {
// Test for method void java.text.ChoiceFormat.setChoices(double [],
// java.lang.String [])
ChoiceFormat f = (ChoiceFormat) f1.clone();
double[] l = new double[] { 0, 1 };
String[] fs = new String[] { "0", "1" };
f.setChoices(l, fs);
assertTrue("Limits copied", f.getLimits() == l);
assertTrue("Formats copied", f.getFormats() == fs);
}