Posted By

tedg on 11/14/13


Tagged

test Scala scalatest


Versions (?)

Scalatest example using Suite


 / Published in: Scala
 

A simple Scala unit test example using Suite in scalatest

  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  

You need to login to post a comment.