Skip to content

Commit

Permalink
KataTennis: When Player1 scores once the score should be Fifteen to Love
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Nov 20, 2010
1 parent b867986 commit 3a4c794
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/test/Spec.KataTennis/Specs.fs
Expand Up @@ -3,8 +3,20 @@
open NaturalSpec
open Model

let point_goes_to player game =
printMethod player
score game player


[<Scenario>]
let ``A newly started game should start with score Love to Love`` () =
Given NewGame
|> It should equal (Love,Love)
|> Verify

[<Scenario>]
let ``When Player1 scores once the score should be Fifteen to Love`` () =
Given NewGame
|> When point_goes_to Player1
|> It should equal (Fifteen,Love)
|> Verify
10 changes: 9 additions & 1 deletion src/test/Spec.KataTennis/Tennis.fs
Expand Up @@ -2,7 +2,15 @@

type Score =
| Love
| Fifteen

type Game = Score * Score

let NewGame = Love,Love
type Players =
| Player1
| Player2

let NewGame = Love,Love

let score game = function
| Player1 -> Fifteen,Love

0 comments on commit 3a4c794

Please sign in to comment.