Adds test for the getText function.
@@ -51,6 +51,18 @@ public class TextAreaTest {
Assert.assertEquals("TestingC", textArea.getText()[2]);
}
+ @Test
+ public void testGetText() {
+ textArea.setText(0, "TestingA");
+ textArea.setText(1, "TestingB");
+ textArea.setText(2, "TestingC");
+
+ Assert.assertEquals(4, textArea.getText().length);
+ Assert.assertEquals("TestingA", textArea.getText()[0]);
+ Assert.assertEquals("TestingB", textArea.getText()[1]);
+ Assert.assertEquals("TestingC", textArea.getText()[2]);
+ }
+
@Test(expected=IllegalArgumentException.class)
public void testClearText_oneParam_withNegativeIndex() {
textArea.clearText(-1);
