-
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.
The file structure was configured in a way that caused a package bug. This should fix the problem
- Loading branch information
EspenTinius
committed
Feb 11, 2026
1 parent
ef6d943
commit b7e5824
Showing
22 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions
3
src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/ExchangeTest.java
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,3 @@ | ||
| public class ExchangeTest { | ||
|
|
||
| } |
1 change: 1 addition & 0 deletions
1
src/test/java/MainTest.java → ...tnu/idi/idatt2003/g40/mappe/MainTest.java
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 |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| public class MainTest { | ||
|
|
||
| } |
3 changes: 3 additions & 0 deletions
3
src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/PlayerTest.java
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,3 @@ | ||
| public class PlayerTest { | ||
|
|
||
| } |
3 changes: 3 additions & 0 deletions
3
src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/PortfolioTest.java
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,3 @@ | ||
| public class PortfolioTest { | ||
|
|
||
| } |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/PurchaseTest.java
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,3 @@ | ||
| public class PurchaseTest { | ||
|
|
||
| } |
3 changes: 3 additions & 0 deletions
3
src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/SaleCalculatorTest.java
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,3 @@ | ||
| public class SaleCalculatorTest { | ||
|
|
||
| } |
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,3 @@ | ||
| public class SaleTest { | ||
|
|
||
| } |
3 changes: 3 additions & 0 deletions
3
src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/ShareTest.java
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,3 @@ | ||
| public class ShareTest { | ||
|
|
||
| } |
58 changes: 58 additions & 0 deletions
58
src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/StockTest.java
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,58 @@ | ||
| package edu.ntnu.idi.idatt2003.g40.mappe; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import java.math.BigDecimal; | ||
| import java.util.NoSuchElementException; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| class StockTest { | ||
|
|
||
| @Test | ||
| void constructor_setsSymbolAndCompany() { | ||
| Stock stock = new Stock("AAPL", "Apple Inc.", new BigDecimal("100.00")); | ||
|
|
||
| assertEquals("AAPL", stock.getSymbol()); | ||
| assertEquals("Apple Inc.", stock.getCompany()); | ||
| } | ||
|
|
||
| @Test | ||
| void getSalesPrice_throwsWhenNoPricesExist_currentImplementation() { | ||
| Stock stock = new Stock("AAPL", "Apple Inc.", new BigDecimal("100.00")); | ||
|
|
||
| // Because constructor does not add the initial salesPrice to prices, | ||
| // prices is empty and getLast() throws NoSuchElementException. | ||
| assertThrows(NoSuchElementException.class, stock::getSalesPrice); | ||
| } | ||
|
|
||
| @Test | ||
| void addNewSalesPrice_thenGetSalesPrice_returnsLastAddedPrice() { | ||
| Stock stock = new Stock("AAPL", "Apple Inc.", new BigDecimal("100.00")); | ||
|
|
||
| stock.addNewSalesPrice(new BigDecimal("123.45")); | ||
|
|
||
| assertEquals(new BigDecimal("123.45"), stock.getSalesPrice()); | ||
| } | ||
|
|
||
| @Test | ||
| void addNewSalesPrice_twice_getSalesPrice_returnsMostRecent() { | ||
| Stock stock = new Stock("AAPL", "Apple Inc.", new BigDecimal("100.00")); | ||
|
|
||
| stock.addNewSalesPrice(new BigDecimal("10.00")); | ||
| stock.addNewSalesPrice(new BigDecimal("20.00")); | ||
|
|
||
| assertEquals(new BigDecimal("20.00"), stock.getSalesPrice()); | ||
| } | ||
|
|
||
| @Test | ||
| void addNewSalesPrice_allowsNull_currentImplementation() { | ||
| Stock stock = new Stock("AAPL", "Apple Inc.", new BigDecimal("100.00")); | ||
|
|
||
| stock.addNewSalesPrice(null); | ||
|
|
||
| // List allows nulls; getLast returns null -> should not throw. | ||
| assertDoesNotThrow(stock::getSalesPrice); | ||
| assertNull(stock.getSalesPrice()); | ||
| } | ||
| } |
3 changes: 3 additions & 0 deletions
3
src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/TransactionArchiveTest.java
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,3 @@ | ||
| public class TransactionArchiveTest { | ||
|
|
||
| } |
3 changes: 3 additions & 0 deletions
3
src/test/java/edu/ntnu/idi/idatt2003/g40/mappe/TransactionTest.java
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,3 @@ | ||
| public class TransactionTest { | ||
|
|
||
| } |