Permalink
Browse files

Use scalatest

  • Loading branch information...
1 parent 7465abb commit a49855c705760812dc51de59c94ae56a2cdcbe78 @rightgo09 committed Dec 30, 2012
View
Binary file not shown.
@@ -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 not shown.

0 comments on commit a49855c

Please sign in to comment.