package ro.dcsi.internship;

import static org.junit.Assert.*;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.List;

import org.junit.Assume;
import org.junit.Ignore;
import org.junit.Test;

public class FileReadTest {

	@Test
	@Ignore
	public void test() {
		fail("Not yet implemented");
	}

	@Test
	public void readCSVSample() throws IOException {
		String csvFile1 = "src/test/resources/sample1.csv";
		String csvFile2 = "src/test/resources/sample2.csv";
		BufferedReader br1 = new BufferedReader(new FileReader(csvFile1));
		BufferedReader br2 = new BufferedReader(new FileReader(csvFile2));
		assertEquals(
				"FIRST NAME ,LAST NAME,USERNAME ,PASSWORD ,EMAIL ADDRESS,PHONE NUMBER,PASSPORT,GROUPS,USERCODE,TITLE,ADDRESS 1 ,ADDRESS 2,CITY,STATE,ZIP",
				br1.readLine());
	}

	@Test
	public void readUsersAlwaysNotNullTest() throws IOException {
		List<User> users = App.readUsers("src/test/resources/sample1.csv");
		assertNotNull(users);
	}

	@Test
	public void readUsersTest() throws IOException {
		List<User> users = App.readUsers("src/test/resources/sample1.csv");
		Assume.assumeNotNull(users);
		assertEquals(5, users.size());
	}

}

@@ -171,33 +171,8 @@
 t;%0A%0A
-import org.junit.Assume;%0A
 impo
@@ -838,21 +838,8 @@
 sers
-AlwaysNotNull
 Test
@@ -854,32 +854,32 @@
 s IOException %7B%0A
+
 %09%09List%3CUser%3E use
@@ -960,170 +960,8 @@
 s);%0A
-%09%7D%0A%0A%09@Test%0A%09public void readUsersTest() throws IOException %7B%0A%09%09List%3CUser%3E users = App.readUsers(%22src/test/resources/sample1.csv%22);%0A%09%09Assume.assumeNotNull(users);%0A
 %09%09as
@@ -989,14 +989,13 @@
 ize());%0A
+
 %09%7D%0A
-%0A
 %7D%0A

improve tests