updated
authorChristian Urban <urbanc@in.tum.de>
Thu, 09 Nov 2017 16:21:01 +0000
changeset 138 7415ff9c91f4
parent 137 53c769a78a1e
child 139 3350cc06804b
updated
testing/drumb.scala
testing/drumb_test.sh
testing/drumb_test3.scala
--- a/testing/drumb.scala	Thu Nov 09 16:04:31 2017 +0000
+++ b/testing/drumb.scala	Thu Nov 09 16:21:01 2017 +0000
@@ -106,8 +106,8 @@
 
 //test cases for the two portfolios given above
 
-//println("Real data: " + investment(rstate_portfolio, 1978 to 2017, 100))
-//println("Blue data: " + investment(blchip_portfolio, 1978 to 2017, 100))
+println("Real data: " + investment(rstate_portfolio, 1978 to 2017, 100))
+println("Blue data: " + investment(blchip_portfolio, 1978 to 2017, 100))
 
 
 }
--- a/testing/drumb_test.sh	Thu Nov 09 16:04:31 2017 +0000
+++ b/testing/drumb_test.sh	Thu Nov 09 16:21:01 2017 +0000
@@ -100,7 +100,7 @@
 then
   echo "  yearly_yield(get_deltas(<<GOOG+AAPL 2010 - 2012>>), 100, 0) == 125" >> $out
   echo "" >> $out
-  echo "  investment(rstate_portfolio, 1978 to 2017, 100) == 30839" >> $out
+  echo "  investment(rstate_portfolio, 1978 to 2017, 100) == 30895" >> $out
   echo "  investment(bchips_portfolio, 1978 to 2017, 100) == 349597" >> $out
   
   if (scala_assert "drumb.scala" "drumb_test3.scala") 
--- a/testing/drumb_test3.scala	Thu Nov 09 16:04:31 2017 +0000
+++ b/testing/drumb_test3.scala	Thu Nov 09 16:21:01 2017 +0000
@@ -11,6 +11,10 @@
 val urban_rstate_portfolio = List("PLD", "PSA", "AMT", "AIV", "AVB", "BXP", "CCI", 
                                   "DLR", "EQIX", "EQR", "ESS", "EXR", "FRT", "GGP", "HCP") 
 
+val urban_rstate_res = CW6c.investment(urban_rstate_portfolio, 1978 to 2017, 100)
+val urban_blchip_res = CW6c.investment(urban_blchip_portfolio, 1978 to 2017, 100)
 
-assert(CW6c.investment(urban_rstate_portfolio, 1978 to 2017, 100) == 30839)
-assert(CW6c.investment(urban_blchip_portfolio, 1978 to 2017, 100) == 349597)
+// the rstate value is 30895 because of a faulty ESS.cvs file
+
+assert(urban_rstate_res > 30885 && urban_rstate_res < 30905)
+assert(urban_blchip_res > 349587 && urban_blchip_res < 349607)