Tutorial by Examples

Create a testing class in the src/test/scala directory, in a file named HelloWorldSpec.scala. Put this inside the file: import org.scalatest.{FlatSpec, Matchers} class HelloWorldSpec extends FlatSpec with Matchers { "Hello World" should "not be an empty String" in { ...
Setup The tests below uses these values for the examples. val helloWorld = "Hello World" val helloWorldCount = 1 val helloWorldList = List("Hello World", "Bonjour Le Monde") def sayHello = throw new IllegalStateException("Hello World Exception") Type c...
Using SBT to manage the library dependency, add this to build.sbt: libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.0" libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.0" % "test" More details can be f...

Page 1 of 1