mirror of
https://github.com/hmalik144/Android-Cucumber-BDD-Sample.git
synced 2026-03-18 07:25:56 +00:00
Added a license and removed the default file template boilerplate.
This commit is contained in:
@@ -2,9 +2,6 @@ package com.codemate.booklibrary.data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created by ironman on 01/09/16.
|
||||
*/
|
||||
public class Book {
|
||||
private final String title;
|
||||
private final String author;
|
||||
|
||||
@@ -4,9 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ironman on 01/09/16.
|
||||
*/
|
||||
public class Library {
|
||||
private List<Book> inventory = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ironman on 02/09/16.
|
||||
*/
|
||||
public class RandomBookGenerator {
|
||||
private static final String[] SUBJECTS = {
|
||||
"Chicken", "Pig", "Hippo", "Dinosaur", "Giraffe", "Orangutan",
|
||||
|
||||
@@ -2,9 +2,6 @@ package com.codemate.booklibrary.data;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by ironman on 02/09/16.
|
||||
*/
|
||||
public class RandomUtils {
|
||||
private RandomUtils() {}
|
||||
|
||||
|
||||
@@ -14,9 +14,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Created by ironman on 02/09/16.
|
||||
*/
|
||||
public class BookAdapter extends RecyclerView.Adapter<BookAdapter.ViewHolder> {
|
||||
private final SimpleDateFormat dateFormat;
|
||||
private List<Book> items = new ArrayList<>();
|
||||
|
||||
@@ -8,9 +8,6 @@ import com.codemate.booklibrary.data.RandomBookGenerator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ironman on 02/09/16.
|
||||
*/
|
||||
public class MainPresenter {
|
||||
private final MainView mainView;
|
||||
private final Library library;
|
||||
|
||||
@@ -4,9 +4,6 @@ import com.codemate.booklibrary.data.Book;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ironman on 02/09/16.
|
||||
*/
|
||||
public interface MainView {
|
||||
void showBooks(List<Book> books);
|
||||
}
|
||||
|
||||
@@ -7,9 +7,6 @@ import org.junit.runner.RunWith;
|
||||
import cucumber.api.CucumberOptions;
|
||||
import cucumber.api.junit.Cucumber;
|
||||
|
||||
/**
|
||||
* Created by ironman on 01/09/16.
|
||||
*/
|
||||
@RunWith(Cucumber.class)
|
||||
@CucumberOptions(features = "src/test/resources")
|
||||
public class CucumberTests extends TestCase {
|
||||
|
||||
@@ -5,9 +5,6 @@ import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ironman on 02/09/16.
|
||||
*/
|
||||
public class LibraryTest {
|
||||
@Test
|
||||
public void addMultipleBooks_PersistsThemInLibrary() {
|
||||
|
||||
@@ -8,9 +8,6 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
/**
|
||||
* Created by ironman on 02/09/16.
|
||||
*/
|
||||
public class RandomBookGeneratorTest {
|
||||
@Test
|
||||
public void generatingRandomBooks_ReturnsNonEmptyBookList() {
|
||||
|
||||
@@ -25,9 +25,6 @@ import static org.junit.Assert.assertThat;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* Created by ironman on 01/09/16.
|
||||
*/
|
||||
public class BookSearchSteps {
|
||||
private Library library = new Library();
|
||||
private List<Book> results = new ArrayList<>();
|
||||
@@ -75,7 +72,7 @@ public class BookSearchSteps {
|
||||
@And("^Book (\\d+) should have the title \"([^\"]*)\"$")
|
||||
public void verifyBookAtPosition(int position, String title) throws Throwable {
|
||||
int realPosition = position - 1;
|
||||
Assert.assertEquals(title, results.get(realPosition).getTitle());
|
||||
assertEquals(title, results.get(realPosition).getTitle());
|
||||
}
|
||||
|
||||
@And("^Books should be (.+)$")
|
||||
|
||||
@@ -18,9 +18,6 @@ import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Created by ironman on 02/09/16.
|
||||
*/
|
||||
public class MainPresenterTest {
|
||||
private static final List<Book> DUMMY_BOOKS = Arrays.asList(
|
||||
new Book("Sample book one", "John Doe", Date.valueOf("2000-10-25")),
|
||||
|
||||
Reference in New Issue
Block a user