use of com.google.example.library.v1.Book in project java_1_wednesday_2022 by AlexJavaGuru.
the class SearchCriteriaTest method testOrCriteria2.
private void testOrCriteria2() {
SearchCriteria searchCriteria = new OrSearchCriteria(new AuthorSearchCriteria("1"), new TitleSearchCriteria("1"));
Book book = new Book("2", "2");
checkResult(!searchCriteria.test(book));
}
use of com.google.example.library.v1.Book in project java_1_wednesday_2022 by AlexJavaGuru.
the class SaveBookUIAction method execute.
public void execute() {
Scanner scanner = new Scanner(System.in);
System.out.println("Book title: ");
String title = scanner.nextLine();
System.out.println("Book author: ");
String author = scanner.nextLine();
System.out.println("Year of issue: ");
String year = scanner.nextLine();
Book book = new Book(title, author, year);
bookDatabase.save(book);
}
use of com.google.example.library.v1.Book in project java_1_wednesday_2022 by AlexJavaGuru.
the class Demo method something.
public static String something(String language, Function<Book, String> function) {
String result = "";
if (language.equals("DE")) {
Book book = new Book("any", "any");
result = function.apply(book);
}
return result;
}
use of com.google.example.library.v1.Book in project wicket by apache.
the class WicketTesterTest method viewBook.
/**
* @throws Exception
*/
@Test
public void viewBook() throws Exception {
Book mockBook = new Book("xxId", "xxName");
Page page = new ViewBook(mockBook);
tester.startPage(page);
// assertion
tester.assertRenderedPage(ViewBook.class);
tester.assertLabel("id", "xxId");
tester.assertLabel("name", "xxName");
}
use of com.google.example.library.v1.Book in project wicket by apache.
the class WicketTesterTest method pageConstructor.
/**
* @throws Exception
*/
@Test
public void pageConstructor() throws Exception {
Book mockBook = new Book("xxId", "xxName");
Page page = new ViewBook(mockBook);
tester.startPage(page);
// assertion
tester.assertRenderedPage(ViewBook.class);
tester.clickLink("link");
tester.assertRenderedPage(CreateBook.class);
}
Aggregations