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:
- Write unit tests to test each and every data value of this data model using the ScalaTest ...