diff options
author | clarkohw <clark_oh-willeke@brown.edu> | 2021-04-19 03:01:48 -0400 |
---|---|---|
committer | clarkohw <clark_oh-willeke@brown.edu> | 2021-04-19 03:01:48 -0400 |
commit | 0508b076ac948a11bde14cfa9f5261796d890ef2 (patch) | |
tree | a22f1803b10093561283f5ce03135dab49e5b538 /src/test/java/edu/brown/cs | |
parent | 8e76bf15c53c540a72a273ec560a624dfb7e11df (diff) |
caching of prices profit
Diffstat (limited to 'src/test/java/edu/brown/cs')
-rw-r--r-- | src/test/java/edu/brown/cs/student/ProfitCalculationTest.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/test/java/edu/brown/cs/student/ProfitCalculationTest.java b/src/test/java/edu/brown/cs/student/ProfitCalculationTest.java index f435c7c..a4baa53 100644 --- a/src/test/java/edu/brown/cs/student/ProfitCalculationTest.java +++ b/src/test/java/edu/brown/cs/student/ProfitCalculationTest.java @@ -56,13 +56,17 @@ public class ProfitCalculationTest { //price of GME at end time is 154.69 List<StockHolding> trade = profitCalculation.getHoldingsList(); //buy with no sell - assertEquals(trade.get(0).getUnrealizedGain(), 3842.25,.25); + assertEquals(trade.get(0).getUnrealizedGain(), 3842.25, .25); assertEquals(trade.get(0).getRealizedGain(), 0, .01); + } + + public void checkAPICalls() { + ProfitCalculation profitCalculation = + new ProfitCalculation(DatabaseQuerier.getConn(), "Don", new Date(1618234200000l), + new Date(1618814264000l)); - profitCalculation = new ProfitCalculation(DatabaseQuerier.getConn(), "Don", new Date(1618234200000l), - new Date(1618814264000l)); - + //check sp500 calculation. 411.28 to 417.30 assertEquals(profitCalculation.compareToSP500(), .01464, .001); } |