changeset 4:a0d72969e6b4

init test
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Mon, 29 Jan 2018 18:01:05 +0900
parents 4ceb0fc4c564
children 1265935f283c
files src/test/scala/IncrementSampleSpec.scala
diffstat 1 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/scala/IncrementSampleSpec.scala	Mon Jan 29 18:01:05 2018 +0900
@@ -0,0 +1,32 @@
+package IncrementSampleSpec
+
+import IncrementSample.Incrementer
+import IncrementSample.Incrementer._
+import IncrementSample.Incrementer.SetActor
+
+import akka.actor.ActorSystem
+import akka.testkit.{TestKit, TestProbe}
+import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
+
+
+class IncrementSampleSpec(_system: ActorSystem)
+  extends TestKit(_system) with WordSpecLike with Matchers with BeforeAndAfterAll {
+
+  def this() = this(ActorSystem("IncrementSampleSpec"))
+
+  override def afterAll(): Unit = {
+    shutdown(system)
+  }
+
+  " Increment 1 to 10" in {
+    val testProbe = TestProbe()
+
+    val actorOne = system.actorOf(Incrementer.props(testProbe.ref),"ActorOne")
+    val actorTwo = system.actorOf(Incrementer.props(testProbe.ref),"ActorTwo")
+
+    actorOne ! SetActor(actorTwo)
+    actorTwo ! SetActor(actorOne)
+
+
+  }
+}
\ No newline at end of file