aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/edu/brown/cs/student/ProfitCalculationTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/edu/brown/cs/student/ProfitCalculationTest.java')
-rw-r--r--src/test/java/edu/brown/cs/student/ProfitCalculationTest.java12
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);
}