M332-PT-NGCC/tests/csv/TestCSV.java

68 lines
1.1 KiB
Java
Raw Normal View History

2019-09-19 14:57:06 +02:00
package csv;
2019-09-19 13:55:43 +02:00
2019-10-10 09:30:35 +02:00
import static org.junit.jupiter.api.Assertions.*;
2019-09-19 13:55:43 +02:00
2019-10-10 09:30:35 +02:00
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
2019-09-19 13:55:43 +02:00
import org.junit.jupiter.api.Test;
public class TestCSV {
2019-10-10 09:30:35 +02:00
Map<String,String> map = new HashMap<String,String>();
String length = "8";
String path = "../export/result.csv";
GenerateCSV csv = new GenerateCSV(map,length,path);
@BeforeEach
void setUp() {
map = new HashMap<String,String>();
length = "8";
path = "../export/result.csv";
}
@Test
void testNotNull() {
map.put("21705239", "17");
csv = new GenerateCSV(map,length,path);
assertFalse(csv == null);
}
@Test
void testValid() {
map.put("21435712", "9");
map.put("21705239", "17");
csv = new GenerateCSV(map,length,path);
for (String etud : csv.etudiants.keySet()) {
assertTrue(csv.isValid(etud));
}
}
@Test
void testNotValid() {
map.put("21435", "9");
map.put("1705239", "17");
csv = new GenerateCSV(map,length,path);
for (String etud : csv.etudiants.keySet()) {
assertFalse(csv.isValid(etud));
}
}
@Test
void testGeneration() {
}
2019-09-19 13:55:43 +02:00
2019-10-10 09:30:35 +02:00
}