mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Deleted and modified previous sprint parser to cater the sprint2’s new requirement
- also added new method for GateMark #story[9] #story[10] #fix
This commit is contained in:
+5
-5
@@ -1,7 +1,7 @@
|
||||
package seng302;
|
||||
|
||||
import org.junit.Test;
|
||||
import seng302.models.FileParser;
|
||||
import seng302.models.OldFileParser;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
@@ -11,14 +11,14 @@ import static org.junit.Assert.assertEquals;
|
||||
* Unit test for FileParser class
|
||||
* Created by Haoming on 5/03/17.
|
||||
*/
|
||||
public class FileParserTest {
|
||||
public class OldFileParserTest {
|
||||
|
||||
/**
|
||||
* test if it fails from reading non existed file
|
||||
*/
|
||||
@Test(expected = FileNotFoundException.class)
|
||||
public void readNonExistedFile() throws Exception {
|
||||
FileParser fileParser = new FileParser("test/java/seng302/non-existed.json");
|
||||
OldFileParser fileParser = new OldFileParser("test/java/seng302/non-existed.json");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -26,7 +26,7 @@ public class FileParserTest {
|
||||
*/
|
||||
@Test
|
||||
public void readValidFile() throws Exception {
|
||||
FileParser fileParser = new FileParser("src/test/java/seng302/valid.json");
|
||||
OldFileParser fileParser = new OldFileParser("src/test/java/seng302/valid.json");
|
||||
|
||||
assertEquals("AC35", fileParser.getRaceName());
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FileParserTest {
|
||||
*/
|
||||
@Test
|
||||
public void readInvalidFile() throws Exception {
|
||||
FileParser fileParser = new FileParser("src/test/java/seng302/invalid.json");
|
||||
OldFileParser fileParser = new OldFileParser("src/test/java/seng302/invalid.json");
|
||||
|
||||
assertEquals(null, fileParser.getRaceName());
|
||||
assertEquals(null, fileParser.getTeams());
|
||||
Reference in New Issue
Block a user