September 2018
Intermediate to advanced
398 pages
9h 43m
English
First, copy sp500_2017.tsv from https://github.com/PacktPublishing/Scala-Programming-Projects/blob/master/Chapter02/retirement-calculator/src/main/resources/sp500.tsv to src/test/resources. Then, create a new unit test called EquityDataSpec in the retcalc package. If you retype this example, try the column selection mode (Alt + Shift + Insert). Copy the content of the .tsv file in the test, then select the first column with Shift + Down 13 times, and then type EquityData(". Finally, edit the rest of the lines using the arrow keys, delete, comma, and so on:
package retcalcimport org.scalatest.{Matchers, WordSpec}class EquityDataSpec extends WordSpec with Matchers { "EquityData.fromResource" ...
Read now
Unlock full access