diff --git a/src/test/java/edu/unl/cse/bohn/StringBoxTest.java b/src/test/java/edu/unl/cse/bohn/StringBoxTest.java index db1a318a02cfa831bdb05baf00f3b342980f6899..8a3f3b72e629402f418249b9014a7a7f3beabd19 100644 --- a/src/test/java/edu/unl/cse/bohn/StringBoxTest.java +++ b/src/test/java/edu/unl/cse/bohn/StringBoxTest.java @@ -197,7 +197,7 @@ public class StringBoxTest { String input = "foo"; int row = 2; int column = 10; - String expectedOutput = "\n\n foo"; + String expectedOutput = String.format("%n%n foo"); // Act String actualOutput = stringBox.placeString(input, row, column).toString(false); // Assert @@ -207,34 +207,39 @@ public class StringBoxTest { @Test public void testNormalCases() { // Arrange - @SuppressWarnings("SpellCheckingInspection") String[] inputs = {"foo\nbar", "larry\ncurly\nmoe", "quux\nxyzzy" - , "one\ntwo\nthree"}; + @SuppressWarnings("SpellCheckingInspection") String[] inputs = { + String.format("foo%nbar"), + String.format("larry%ncurly%nmoe"), + String.format("quux%nxyzzy"), + String.format("one%ntwo%nthree") + }; int[] rows = {2, 5, 3, 10}; int[] columns = {10, 5, 20, 15}; - @SuppressWarnings("SpellCheckingInspection") String expectedOutput = - "\n" + // 0 - "\n" + // 1 - " foo\n" + // 2 - " larrybar quux\n" + // 3 - " curly xyzzy\n" + // 4 - " moe\n" + // 5 - "\n" + // 6 - "\n" + // 7 - " one\n" + // 8 - " two\n" + // 9 - " three\n" + // 10 - "\n" + // 11 - "\n" + // 12 - "\n" + // 13 - "\n" + // 14 - "\n" + // 15 - "\n" + // 16 - "\n" + // 17 - "\n" + // 18 - "\n" + // 19 - "\n" + // 20 - "\n" + // 21 - ""; // 22 + //noinspection SpellCheckingInspection + String expectedOutput = String.format( + "%n" + // 0 + "%n" + // 1 + " foo%n" + // 2 + " larrybar quux%n" + // 3 + " curly xyzzy%n" + // 4 + " moe%n" + // 5 + "%n" + // 6 + "%n" + // 7 + " one%n" + // 8 + " two%n" + // 9 + " three%n" + // 10 + "%n" + // 11 + "%n" + // 12 + "%n" + // 13 + "%n" + // 14 + "%n" + // 15 + "%n" + // 16 + "%n" + // 17 + "%n" + // 18 + "%n" + // 19 + "%n" + // 20 + "%n" + // 21 + ""); // 22 // Act String actualOutput = stringBox .placeStringAlignTopLeft(inputs[0], rows[0], columns[0]) @@ -249,7 +254,7 @@ public class StringBoxTest { @Test public void testEmptyBox() { // Arrange - String expectedOutput = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; + String expectedOutput = String.format("%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n"); // Act String actualOutput = stringBox.toString(true); // Assert @@ -259,7 +264,8 @@ public class StringBoxTest { @Test public void testNegativeTopRow() { // Arrange - String input = "foo\nbar"; + //noinspection SpellCheckingInspection + String input = String.format("foo%nbar"); int row = -1; int column = 10; String expectedOutput = " bar";