February 2018
Intermediate to advanced
552 pages
13h 46m
English
In this section, we will discuss how to unit test Scala components using the ScalaTest unit testing framework. Most or all of the Scala-based applications use Case classes to represent their Data Models, so we should learn how to unit test Case classes.
Refer to the scala-fp-app project from Chapter 2, Functional Scala, GitHub repository. It contains the following Case class to represent our WF Reactive System data model:
package com.packt.publishing.caseclass
case class WeatherForecast (city: String, date: String, hour: String, temperature: String)
Perform the following steps to unit test WeatherForecast data model:
Read now
Unlock full access