-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestCases.java
42 lines (31 loc) · 1.09 KB
/
TestCases.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import static org.junit.Assert.*;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
public class TestCases {
@Test
public void validateInputOutputofFileInputFunction() throws IOException {
String fileName = "gistfile1.txt";
List<JSONObject> jsonObjectTest = new ArrayList<JSONObject>();
assertSame(jsonObjectTest.getClass(), PartyInvitationList.ReadSingleLineOfJsonFile(fileName).getClass());
}
@Rule
public ExpectedException exception = ExpectedException.none();
@Test
public void validateInputFileName() throws FileNotFoundException{
String fileName = "gistfile1.txt";
try {
PartyInvitationList.ReadSingleLineOfJsonFile(fileName);
} catch (FileNotFoundException e) {
throw (e);
}
exception.expect(ParseException.class);
}
}