|
@@ -12,16 +12,17 @@ public class StringUtilsTest {
|
|
String text = "this is a simple test";
|
|
String text = "this is a simple test";
|
|
String searchText = "simple";
|
|
String searchText = "simple";
|
|
int dummyColorInt = 44221;
|
|
int dummyColorInt = 44221;
|
|
- String expectedReturn = String.format("this is a <font color='%d'><b>%s</b></font> test", dummyColorInt, searchText);
|
|
|
|
|
|
+ String expectedReturn = String.format("this is a <font color='%d'><b>%s</b></font> test",
|
|
|
|
+ dummyColorInt, searchText);
|
|
|
|
|
|
- assertEquals("correctly parsed text returned",
|
|
|
|
|
|
+ assertEquals("returned parsed text value was incorrect",
|
|
expectedReturn, StringUtils.searchAndColor(text, searchText, dummyColorInt));
|
|
expectedReturn, StringUtils.searchAndColor(text, searchText, dummyColorInt));
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void searchAndColor_assertTextReturnedIfSearchTextIsEmpty() {
|
|
public void searchAndColor_assertTextReturnedIfSearchTextIsEmpty() {
|
|
String helloWorld = "hello world";
|
|
String helloWorld = "hello world";
|
|
- assertEquals("text returned when searchText was empty",
|
|
|
|
|
|
+ assertEquals("text returned when searchText was not empty",
|
|
helloWorld, StringUtils.searchAndColor(helloWorld, "", 0));
|
|
helloWorld, StringUtils.searchAndColor(helloWorld, "", 0));
|
|
}
|
|
}
|
|
}
|
|
}
|