-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a button to redirect to stock market page from portfolio tab
Added GameControllerTest
- Loading branch information
Nikollai
committed
May 25, 2026
1 parent
9d0cbfd
commit d3a095f
Showing
2 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package millions.controller; | ||
|
|
||
| import millions.controller.fileIO.UncheckedFileNotFoundException; | ||
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import java.math.BigDecimal; | ||
| import java.nio.file.Path; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
|
||
| public class GameControllerTest { | ||
| GameController gameController; | ||
| @BeforeEach | ||
| public void setUpController() { | ||
| this.gameController = new GameController(); | ||
| } | ||
|
|
||
| @Test | ||
| public void startGameFileNotFoundTest() { | ||
| String name = "name"; | ||
| BigDecimal startingMoney = new BigDecimal("100"); | ||
| Path stockFilePath = Path.of("nonexistantfile"); | ||
| int prerunWeeks = 1; | ||
| assertThrows(UncheckedFileNotFoundException.class, () -> {gameController.startGame(name,startingMoney,stockFilePath,prerunWeeks);}); | ||
| } | ||
| } |