dtu.library.app
Class TestSearchBook

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

public class TestSearchBook
extends java.lang.Object


Constructor Summary
TestSearchBook()
           
 
Method Summary
 void setUp()
          Create the sample data for the search test cases.
 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 java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestSearchBook

public TestSearchBook()
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Create the sample data for the search test cases. This method is executed each time one of the test methods is run. In contrast to old JUnit versions, it is now the @Before annotations that marks this method to be run before each test case and not the name setUp().

Throws:
java.lang.Exception

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.