From 0b9daddf3ac5e60b7c6d28c2762eaa72cbc6a393 Mon Sep 17 00:00:00 2001 From: Iiro Krankka Date: Mon, 9 Jan 2017 12:12:20 +0200 Subject: [PATCH] Made the random books to be more appropriate. --- .../booklibrary/data/RandomBookGenerator.java | 17 ++++++------ .../booksearch.feature | 26 +++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/com/codemate/booklibrary/data/RandomBookGenerator.java b/app/src/main/java/com/codemate/booklibrary/data/RandomBookGenerator.java index 9f1f3dd..ebab9bb 100644 --- a/app/src/main/java/com/codemate/booklibrary/data/RandomBookGenerator.java +++ b/app/src/main/java/com/codemate/booklibrary/data/RandomBookGenerator.java @@ -8,16 +8,15 @@ import java.util.List; public class RandomBookGenerator { private static final String[] SUBJECTS = { "Chicken", "Pig", "Hippo", "Dinosaur", "Giraffe", "Orangutan", - "Bat", "Lion", "Daddy", "Grandpa", "Donald Trump", "Coffee", - "Dog", "Rat", "Pokemon", "Cat", "Senile", "Pensioner", - "Project manager", "Salesperson" + "Bat", "Lion", "Daddy", "Grandpa", "Coffee", "Dog", "Rat", + "Pokemon", "Cat", "Pensioner", "Project Manager", "Salesperson" }; private static final String[] SECOND_WORDS = { - "strip club", "that knew too little", "Strategy", "parking space", - "Office", "Banana", "Toilet", "Poop", "Fart", "Rain", "Job", - "Thing", "Radio", "Zoo", "Office", "House", "Village", - "swimming pool", "Computer" + "That Knew Too Little", "Strategy", "Parking Lot", + "Office", "Banana", "Toilet", "Rain", "Job", "Thing", + "Radio", "Zoo", "Office", "House", "Village", "Swimming Pool", + "Computer" }; private static final String[] FIRST_NAMES = { @@ -26,7 +25,7 @@ public class RandomBookGenerator { }; private static final String[] LAST_NAMES = { - "Doe", "Trump", "Bond", "Jackson", "Jordan", "Young", "Page", + "Doe", "Smith", "Bond", "Jackson", "Jordan", "Young", "Page", "Johnson", "Springsteen", "Kauffman", "Schmidt", "Jokinen" }; @@ -72,7 +71,7 @@ public class RandomBookGenerator { private static Date randomDate() { Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.YEAR, RandomUtils.randBetween(1995, 2016)); + calendar.set(Calendar.YEAR, RandomUtils.randBetween(1995, 2017)); calendar.set(Calendar.MONTH, RandomUtils.randBetween(0, 11)); calendar.set(Calendar.DAY_OF_MONTH, RandomUtils.randBetween(1, 25)); diff --git a/app/src/test/resources/com.codemate.booklibrary/booksearch.feature b/app/src/test/resources/com.codemate.booklibrary/booksearch.feature index ccb6cb7..43f5f1e 100644 --- a/app/src/test/resources/com.codemate.booklibrary/booksearch.feature +++ b/app/src/test/resources/com.codemate.booklibrary/booksearch.feature @@ -2,34 +2,34 @@ Feature: Book Search A customer must be able to search books by year, author or title Background: - Given the library has a book with title "How to be awesome", written by "Iiro Krankka", published in 16 May 2016 - And a book with title "My life as an awesome guy", written by "Iiro Krankka", published in 27 July 2016 + Given the library has a book with title "How to be awesome", written by "Jane Smith", published in 16 May 2016 + And a book with title "My life as an awesome girl", written by "Jane Smith", published in 27 July 2016 And a book with title "I think my teacher is cool", written by "John Doe", published in 01 January 2010 Scenario: List all books When the customer wants to know all books in the library Then 3 books should be found And Book 1 should have the title "How to be awesome" - And Book 2 should have the title "My life as an awesome guy" + And Book 2 should have the title "My life as an awesome girl" And Book 3 should have the title "I think my teacher is cool" Scenario: Search books by year When the customer searches for books published in year 2016 Then 2 books should be found And Book 1 should have the title "How to be awesome" - And Book 2 should have the title "My life as an awesome guy" + And Book 2 should have the title "My life as an awesome girl" Scenario Outline: Search books by author When the customer searches for books by author Then 2 books should be found And Book 1 should have the title "How to be awesome" - And Book 2 should have the title "My life as an awesome guy" + And Book 2 should have the title "My life as an awesome girl" Examples: - | Author Search | - | "Iiro" | - | "Krankka" | - | "Iiro Krankka" | + | Author Search | + | "Jane" | + | "Smith" | + | "Jane Smith" | Scenario Outline: Search books by title When the customer searches for books with title @@ -37,7 +37,7 @@ Feature: Book Search And Books should be <Found Books> Examples: - | Title Search | Number of Results | Found Books | - | "Awesome" | 2 | "How to be awesome" and "My life as an awesome guy" | - | "cool" | 1 | "I think my teacher is cool" | - | "How to be" | 1 | "How to be awesome" | \ No newline at end of file + | Title Search | Number of Results | Found Books | + | "Awesome" | 2 | "How to be awesome" and "My life as an awesome girl" | + | "cool" | 1 | "I think my teacher is cool" | + | "How to be" | 1 | "How to be awesome" | \ No newline at end of file