Skip to content

Instantly share code, notes, and snippets.

test("players cannot mark a already marked square") {
ttt.mark(0,0)
evaluating { ttt.mark(0,0) } should produce [AlreadyMarkedException]
}
import org.scalatest.{FunSuite, BeforeAndAfterEach}
import org.scalatest.matchers.ShouldMatchers
import some.pack.{TicTacToe, Mark, InvalidSquareException, AlreadyMarkedException}
import some.pack.Mark._
class SecondTicTacToeFunSuiteTest extends FunSuite with BeforeAndAfterEach with ShouldMatchers {
private var ttt: TicTacToe = _
override def beforeEach() { ttt = new TicTacToe }
import org.scalatest.{FunSuite, BeforeAndAfterEach}
import some.pack.{TicTacToe, Mark, InvalidSquareException, AlreadyMarkedException}
import some.pack.Mark._
class FirstTicTacToeFunSuiteTest extends FunSuite with BeforeAndAfterEach {
private var ttt: TicTacToe = _
override def beforeEach() { ttt = new TicTacToe }
test("the game should not start finished") {
import org.scalatest.FunSuite
class BasicFunSuiteTest extends FunSuite {
test("testing hello world") { println("everything is working :D") }
}
package some.pack;
public class Person {
private String name;
private Integer age;
public Person(String name, String age) {
this.name = name;
this.age = age;
package some.pack;
public class AlreadyMarkedException extends Exception {
public AlreadyMarkedException(){
}
public AlreadyMarkedException(String msg) {
super(msg);
}