implemented createPlayerStateL

This commit is contained in:
Jonathan Lamothe
2019-09-09 11:43:37 -04:00
parent d5d08aa0f7
commit 154c3979a5
2 changed files with 26 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ spec = describe "Mtlstats.Types" $ do
gameStatsSpec
databaseSpec
gameStateLSpec
createPlayerStateLSpec
teamScoreSpec
otherScoreSpec
homeTeamSpec
@@ -81,6 +82,23 @@ gameStateLSpec = describe "gameStateL" $ lensSpec gameStateL
]
where gs t = newGameState & gameType ?~ t
createPlayerStateLSpec :: Spec
createPlayerStateLSpec = describe "createPlayerStateL" $
lensSpec createPlayerStateL
-- getters
[ ( MainMenu, newCreatePlayerState )
, ( CreatePlayer $ cps 1 , cps 1 )
]
-- setters
[ ( MainMenu, cps 1 )
, ( CreatePlayer $ cps 1, cps 2 )
]
where
cps n = newCreatePlayerState
& cpsNumber ?~ n
& cpsName .~ "foo"
& cpsPosition .~ "bar"
teamScoreSpec :: Spec
teamScoreSpec = describe "teamScore" $ do
let