Skip to content

Commit

Permalink
Checkstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yeozongyao committed Apr 14, 2024
1 parent 45cd16a commit 44ca3a9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void testValidBookAddition() {
String[] inputArray = {"add", "1984"};
ParserAdd.executeParseAdd(books, inputArray);
assertEquals(1, books.getSize());
assertEquals("1984", Title.getTitle(books.getBook(1))); // Assuming getBookAt() retrieves the book and getTitle() returns its title
assertEquals("1984", Title.getTitle(books.getBook(1)));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ void testListBooksByRating() {
"Percy Jackson - 5\n" +
"Geronimo - Not Rated";

assertEquals(expectedOutput.trim().replaceAll("\\s+", "|"), outContent.toString().trim().replaceAll("\\s+", "|"));
assertEquals(expectedOutput.trim().replaceAll("\\s+", "|"),
outContent.toString().trim().replaceAll("\\s+", "|"));
}
@Test
void testListGenres() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@


class InputLooperTest {
private InputLooper inputLooper;
BookList books = new BookList();
Scanner scanner = new Scanner(System.in);
private InputLooper inputLooper;

@BeforeEach
void setUp() {
Expand Down Expand Up @@ -107,11 +107,13 @@ void setGenreBookSelectIndexOutOfBounds() {
ParserGenre.executeParseSetGenre(books, new String[]{"set-genre", "1"});
fail();
} catch (Exception ignored) {
System.out.println("Test in progress");
}
try {
ParserGenre.executeParseSetGenre(books, new String[]{"set-genre", "-1"});
fail();
} catch (Exception ignored) {
System.out.println("Test in progress");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ void testDuplicateCheckerWithExistingGenre() {
void testDuplicateCheckerWithNullInput() {
assertNull(NewGenreModifier.duplicateChecker(null, books));
}
}
}

0 comments on commit 44ca3a9

Please sign in to comment.