diff --git a/src/main/resources/dummydata.txt b/src/main/resources/dummydata.txt index 29f6c6b..25144a3 100644 --- a/src/main/resources/dummydata.txt +++ b/src/main/resources/dummydata.txt @@ -1,4 +1,4 @@ -#THIS IS A COMMENT. Below me is an empty line +#THIS IS A COMMENT. AAPL, Apple Inc., 276.43 NVID, Nvidida Corporation, 241.591 @@ -8,4 +8,7 @@ NVID, Nvidida Corporation, 241.591 COOLI, This is a cool name, 252.2 -COOL, This is a cool name, 252.2a \ No newline at end of file +COOL, This is a cool name, 252.2a + +AAPL,Apple Inc.,276.43 +NVID,Nvidida Corporation,241.591 \ No newline at end of file diff --git a/src/main/resources/testStockData.txt b/src/main/resources/testStockData.txt new file mode 100644 index 0000000..b349d0e --- /dev/null +++ b/src/main/resources/testStockData.txt @@ -0,0 +1,11 @@ +#THIS IS A COMMENT. + +AAPL, Apple Inc., 276.43 +NVID, Nvidida Corporation, 241.591 + +#Above me are some valid formats. +#Below me are some invalid formats + +COOLI, This is a cool name, 252.2 + +COOL, This is a cool name, 252.2a \ No newline at end of file diff --git a/src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/FileParserTest.java b/src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/FileParserTest.java index fc901fc..2935a30 100644 --- a/src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/FileParserTest.java +++ b/src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/FileParserTest.java @@ -15,7 +15,7 @@ class FileParserTest { - private final String filePath = "src/main/resources/dummydata.txt"; + private final String testStockDataPath = "src/main/resources/testStockData.txt"; FileParser fileParser; private final String validStockFromFile = "NVID, Nvidida Corporation, 241.591"; @@ -30,8 +30,8 @@ class FileParserTest { @BeforeEach void setUp() throws Exception { - fileParser = new FileParser(filePath); - Path path = Paths.get(filePath); + fileParser = new FileParser(testStockDataPath); + Path path = Paths.get(testStockDataPath); allLines = Files.readAllLines(path); try { validStocks = fileParser.readFile();