Skip to content

Commit

Permalink
Use scalatest
Browse files Browse the repository at this point in the history
  • Loading branch information
rightgo09 committed Dec 30, 2012
1 parent 7465abb commit a49855c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Binary file added 02-12/HelloWorld.class
Binary file not shown.
25 changes: 25 additions & 0 deletions 02-12/HelloWorldJUnit3Suite.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import org.scalatest.junit.JUnit3Suite
import org.scalatest.junit.ShouldMatchersForJUnit
import junit.framework.Assert._

class HelloWorld {
def greeting(): String = {
"Hello World"
}

def greeting(message: String): String = {
"Hello " + message
}
}

class HelloWorldTest extends JUnit3Suite with ShouldMatchersForJUnit {
def testGreeting() {
val hello = new HelloWorld()
hello.greeting() should be ("Hello World")
}

def testGreetingWithArg() {
val hello = new HelloWorld()
hello.greeting("World!") should be ("Hello World!")
}
}
Binary file added 02-12/HelloWorldTest.class
Binary file not shown.

0 comments on commit a49855c

Please sign in to comment.