We have now implemented some useful building blocks, and it is time to create an executable so that end users can use our calculator with their own parameters.
We are going to build a simple executable around RetCalc.simulatePlan
. It will take a list of parameters separated by spaces, and print the results on the console.
The test we are going to write integrates several components together and will use a full market data set. As such, it is not really a unit test anymore; it is an integration test. For this reason, we suffixed it with IT instead of Spec.
First, copy sp500.tsv
and cpi.tsv
from https://github.com/PacktPublishing/Scala-Programming-Projects/blob/master/Chapter02/retirement-calculator/src/main/resources/sp500.tsv and https://github.com/PacktPublishing/Scala-Programming-Projects/blob/master/Chapter02/retirement-calculator/src/main/resources/cpi.tsv to src/main/resources
, then create a new unit test called SimulatePlanIT
in src/test...