package datasources;

import org.junit.*;

import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

import java.util.ArrayList;
import java.util.Collection;

import datasources.DummyDataProvider;
import models.Person;

public class DummyDataProviderTest {
	
	private DummyDataProvider mdp;
	private ArrayList<Person> persons;
	private Person bart;
	
	@Before
	public void setUp() throws Exception {
		mdp = new DummyDataProvider();
		persons = mdp.getPersons();
		bart = new Person(101,"Bart","Simpsons",1987,"Springfield","USA");
	}
	
	@Test
	public void constructorInvokePopulateCollection() {
		assertFalse(persons.isEmpty());
	}
	
	@Test
	public void getPersonsReturnCollectionType() {
		Collection<Object> expectedDataCollection = new ArrayList<>();
		assertThat(expectedDataCollection, instanceOf(persons.getClass()));
	}
	
	@Test
	public void getPersonsReturnCollectionItemType() {
		Person expectedType = bart;
		assertThat(expectedType, instanceOf(persons.get(0).getClass()));
	}

	@Test
	public void getPersonsReturnCollectionSize() {
		int expectedSize = 3;
		assertEquals(expectedSize, persons.size());
	}
	
	@Test(timeout=1000) // milliseconds, i.e. 1000=1sec
	public void getPersonsInInfiniteLoop() {
		assertNotNull(mdp.getPersons());	
	}
	
}

@@ -364,16 +364,144 @@
 bart;%0A%09%0A
+%09/**%0A%09 * This method is a setup hooks for test-cases, which ensures that each %0A%09 * test-case is dealing with known values.%0A%09 */%0A
 %09@Before
@@ -683,105 +683,370 @@
 %0A%09%0A%09
-@Test%0A%09public void constructorInvokePopulateCollection() %7B%0A%09%09assertFalse(persons.isEmpty());%0A%09%7D%0A%09
+/**%0A%09 * This method tests the side-effect of calling constructor i.e. is the local %0A%09 * dummy data-collection populated.%0A%09 */%0A%09@Test%0A%09public void constructorInvokePopulateCollection() %7B%0A%09%09assertFalse(persons.isEmpty());%0A%09%7D%0A%09%0A%09/**%0A%09 * This method tests the returned data-type of getPersons() method to match %0A%09 * with the IDataSource interface specification.%0A%09 */
 %0A%09@T
@@ -1233,24 +1233,160 @@
 s()));%0A%09%7D%0A%09%0A
+%09/**%0A%09 * This method tests getPersons() method return data-type's item to match %0A%09 * with the IDataSource interface specification.%0A%09 */%0A
 %09@Test%0A%09publ
@@ -1533,16 +1533,116 @@
 ));%0A%09%7D%0A%0A
+%09/**%0A%09 * This method tests the number of rows contained within the dummy %0A%09 * data-collection.%0A%09 */%0A
 %09@Test%0A%09
@@ -1763,16 +1763,92 @@
 );%0A%09%7D%0A%09%0A
+%09/**%0A%09 * This method tests if getPersons() method is an infinite loop %0A%09 */%0A
 %09@Test(t

Add Javadocs to each test method