dtu.library.app
Class TestSearchBook

java.lang.Object
  extended by dtu.library.app.SampleDataSetup
      extended by dtu.library.app.TestSearchBook

public class TestSearchBook
extends SampleDataSetup

Note that the test class has been refactor to inherit its setup method from class SampleDataSetup. This allows one to reuse setup code, but still keeps the testing for, e.g. searching, in a separate class.


Constructor Summary
TestSearchBook()
           
 
Method Summary
 void testSearchBooksNothingFound()
          Tests searching for books in the library.
 void testSearchBooksSignature()
          Tests searching for books in the library.
 void testSearchBooksTitle()
          Tests searching for books in the library.
 void testSearchBooksTitleAuthor()
          Tests searching for books in the library.
 
Methods inherited from class dtu.library.app.SampleDataSetup
setUp
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestSearchBook

public TestSearchBook()
Method Detail

testSearchBooksTitle

public void testSearchBooksTitle()
Tests searching for books in the library. Tests that the search finds matches a substring in the author field of a book.


testSearchBooksTitleAuthor

public void testSearchBooksTitleAuthor()
Tests searching for books in the library. Tests that the search finds matches a substring in the author field of a book and in the title field of a book. Tests that two books can be returned.


testSearchBooksSignature

public void testSearchBooksSignature()
Tests searching for books in the library. Tests that the search finds matches a substring in the signature field of a book. Tests that the correct book is returned.


testSearchBooksNothingFound

public void testSearchBooksNothingFound()
Tests searching for books in the library. Tests that an empty list is returned if no matches are found.