示例#1
0
文件: Text_Test.java 项目: ciancu/rap
 @Test
 public void testSetTextChars_EmptyArray() {
   char[] expected = new char[0];
   text.setTextChars(expected);
   char[] result = text.getTextChars();
   assertEquals(0, result.length);
   assertEquals("", text.getText());
 }
示例#2
0
文件: Text_Test.java 项目: ciancu/rap
 @Test
 public void testGetTextChars_FromText() {
   String string = "new string";
   text.setText(string);
   char[] result = text.getTextChars();
   for (int i = 0; i < string.length(); i++) {
     assertEquals(string.charAt(i), result[i]);
   }
 }
示例#3
0
文件: Text_Test.java 项目: ciancu/rap
 @Test
 public void testSetTextChars() {
   char[] expected = new char[] {'p', 'a', 's', 's', 'w', 'o', 'r', 'd'};
   text.setTextChars(expected);
   char[] result = text.getTextChars();
   assertEquals(expected.length, result.length);
   for (int i = 0; i < expected.length; i++) {
     assertEquals(expected[i], result[i]);
   }
   assertEquals("password", text.getText());
 }