Scalatest example using Suite


/ Published in: Scala
Save to your folder(s)

A simple Scala unit test example using Suite in scalatest


Copy this code and paste it in your HTML
  1. package scalaunittest
  2.  
  3. import org.scalatest.junit.JUnitRunner
  4. import org.junit.runner.RunWith
  5. import org.scalatest.Suite
  6.  
  7. @RunWith(classOf[JUnitRunner]) // Run As | JUnit Test
  8. class ListSuite extends Suite {
  9. def testListLength { // a method with a name starting with "test" is a test
  10. val ls = List(2, 3, 4)
  11. assert(ls.length == 3)
  12. }
  13. }

Report this snippet


Comments


You need to login to view comments.