This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test("players cannot mark a already marked square") { | |
ttt.mark(0,0) | |
evaluating { ttt.mark(0,0) } should produce [AlreadyMarkedException] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.scalatest.FunSuite | |
class BasicFunSuiteTest extends FunSuite { | |
test("testing hello world") { println("everything is working :D") } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package some.pack; | |
public class Person { | |
private String name; | |
private Integer age; | |
public Person(String name, String age) { | |
this.name = name; | |
this.age = age; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package some.pack; | |
public class AlreadyMarkedException extends Exception { | |
public AlreadyMarkedException(){ | |
} | |
public AlreadyMarkedException(String msg) { | |
super(msg); | |
} |
NewerOlder