Skip to content

Commit

Permalink
Feat: seperated .txt files for testing and dummydata
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyah committed Mar 15, 2026
1 parent a5b9485 commit d419387
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/main/resources/dummydata.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
COOL, This is a cool name, 252.2a

AAPL,Apple Inc.,276.43
NVID,Nvidida Corporation,241.591
11 changes: 11 additions & 0 deletions src/main/resources/testStockData.txt
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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();
Expand Down

0 comments on commit d419387

Please sign in to comment.