import static org.testng.Assert.assertEquals;
+import jalview.gui.JvOptionPane;
+
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class FormatTest
{
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
@Test(groups = "Functional")
public void testAppendPercentage()
{
assertEquals(f.form(123.6f), "124.");
assertEquals(f.form(129.6f), "130.");
}
+
+ @Test(groups = "Functional")
+ public void testRepeat()
+ {
+ assertEquals(Format.repeat('a', 3), "aaa");
+ assertEquals(Format.repeat('b', 0), "");
+ assertEquals(Format.repeat('c', -1), "");
+ }
}