Skip to content

Instantly share code, notes, and snippets.

@pellekrogholt
Created December 16, 2013 16:37
Show Gist options
  • Save pellekrogholt/7990029 to your computer and use it in GitHub Desktop.
Save pellekrogholt/7990029 to your computer and use it in GitHub Desktop.
test("Test empty tree 'Contains'") {
// behind the scene this on create a node actor - follow props: Props(classOf[BinaryTreeNode], elem, initiallyRemoved)
val testNode = system.actorOf(BinaryTreeNode.props(0, true))
testNode ! Contains(testActor, id = 1, 0)
expectMsg(ContainsResult(1, false))
}
test("Test empty tree 'Insert'") {
val testNode = system.actorOf(BinaryTreeNode.props(0, true))
testNode ! Insert(testActor, id = 1, 42)
expectMsg(OperationFinished(1))
testNode ! Contains(testActor, id = 2, 42)
expectMsg(ContainsResult(2, true))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment