-
-
Save monkey-codes/d57d9a7143a17f4f8d0cff497587b270 to your computer and use it in GitHub Desktop.
Testing a pure function
This file contains hidden or 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
| "should detect won games" { | |
| winningMoves | |
| .map { games -> | |
| checkAll(games) { moves -> | |
| either { | |
| val game = Game.new().bind().make(moves).bind() | |
| moves.forEach { (coordinates, symbol) -> game.cell(coordinates) shouldBe symbol } | |
| val won = game.shouldBeTypeOf<Won>() | |
| won.winner shouldBe CROSS | |
| } | |
| .shouldBeRight() | |
| } | |
| } | |
| .shouldBeRight() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment