@Test public void testToString() { Book b5 = new Book("Learn SQL", "John Doe"); String s = "Learn SQL by John Doe - Available"; // System.out.println(b5.getPerson().getName()); assertEquals(s, b5.toString()); b5.setPerson(new Person("User")); s = "Learn SQL by John Doe - Unavailable"; assertEquals(s, b5.toString()); }
@Test public void testToString() { String expected = "\"The Death and Life of Great American Cities\" by Jane Jacobs [1961]"; assertEquals(expected, book.toString()); }