mirror of
https://github.com/hmalik144/Android-Cucumber-BDD-Sample.git
synced 2025-12-09 23:45:19 +00:00
Made the random books to be more appropriate.
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
@@ -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 <Author Search>
|
||||
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" |
|
||||
| "Jane" |
|
||||
| "Smith" |
|
||||
| "Jane Smith" |
|
||||
|
||||
Scenario Outline: Search books by title
|
||||
When the customer searches for books with title <Title Search>
|
||||
@@ -38,6 +38,6 @@ Feature: Book Search
|
||||
|
||||
Examples:
|
||||
| Title Search | Number of Results | Found Books |
|
||||
| "Awesome" | 2 | "How to be awesome" and "My life as an awesome guy" |
|
||||
| "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" |
|
||||
Reference in New Issue
Block a user