scala.testing
object SUnit

[source: `scala/testing/SUnit.scala`]

`` `object` SUnit
  `extends` AnyRef

  Unit testing methods in the spirit of JUnit framework.

  Use these classes like this:

       import scala.testing.SUnit
       import SUnit._

       class MyTest(n: String) extends TestCase(n) {

         override def runTest() = n match {
           case "myTest1" => assertTrue(true)
           case "myTest2" => assertTrue("hello", false)
         }
       }

       val r = new TestResult()
       suite.run(r)
       for (tf <- r.failures()) {
         Console.println(tf.toString())
       }

  The trait `TestConsoleMain` contains this code as a `main` method, for convenience.

Author
  Burak Emir

Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized

Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf

Class Summary
`trait` | Assert `extends` AnyRef this class defined useful assert methods
`case class` | AssertFailed (`val` msg : String)`extends` RuntimeException `with` Product an AssertFailed is thrown for a failed assertion
`trait` | Test `extends` AnyRef a Test can be run with its result being collected
`abstract class` | TestCase (`val` name : String)`extends` Test `with` Assert The class `TestCase` defines the fixture to run multiple tests.
`trait` | TestConsoleMain `extends` AnyRef convenience trait, mix it in a TestMain object and implement "suite" to get this code val r = new TestResult() suite.run(r) for (val tf <- r.failures()) { Console.println(tf.toString())
`class` | TestFailure (`val` failedTest : Test, `val` thrownException : Throwable)`extends` AnyRef The class `TestFailure` collects a failed test together with the thrown exception.
`class` | TestResult `extends` AnyRef a TestResult collects the result of executing a test case
`class` | TestSuite (tests : Test*)`extends` Test The class `TestSuite` runs a composite of test cases.