diff options
Diffstat (limited to 'src/test/java/edu/brown/cs/student/ProfitCalculationTest.java')
-rw-r--r-- | src/test/java/edu/brown/cs/student/ProfitCalculationTest.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/java/edu/brown/cs/student/ProfitCalculationTest.java b/src/test/java/edu/brown/cs/student/ProfitCalculationTest.java index d1fc9be..f435c7c 100644 --- a/src/test/java/edu/brown/cs/student/ProfitCalculationTest.java +++ b/src/test/java/edu/brown/cs/student/ProfitCalculationTest.java @@ -12,6 +12,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import java.time.LocalDate; import java.util.List; import java.sql.Date; import java.time.Instant; @@ -55,7 +56,14 @@ public class ProfitCalculationTest { //price of GME at end time is 154.69 List<StockHolding> trade = profitCalculation.getHoldingsList(); //buy with no sell - assertEquals(3842.25, trade.get(0).getUnrealizedGain(),6); + assertEquals(trade.get(0).getUnrealizedGain(), 3842.25,.25); + assertEquals(trade.get(0).getRealizedGain(), 0, .01); + + + profitCalculation = new ProfitCalculation(DatabaseQuerier.getConn(), "Don", new Date(1618234200000l), + new Date(1618814264000l)); + + assertEquals(profitCalculation.compareToSP500(), .01464, .001); } |