implemented createGoalieStateL

This commit is contained in:
Jonathan Lamothe
2019-10-24 09:48:47 -04:00
parent ceb8132a13
commit e94bf59c81
2 changed files with 29 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ spec = describe "Mtlstats.Types" $ do
databaseSpec
gameStateLSpec
createPlayerStateLSpec
createGoalieStateLSpec
teamScoreSpec
otherScoreSpec
homeTeamSpec
@@ -117,6 +118,26 @@ createPlayerStateLSpec = describe "createPlayerStateL" $
& cpsName .~ "Bob"
& cpsPosition .~ "defense"
createGoalieStateLSpec :: Spec
createGoalieStateLSpec = describe "createGoalieStateL" $
lensSpec createGoalieStateL
-- getters
[ ( "missing state", MainMenu, newCreateGoalieState )
, ( "with state", CreateGoalie cgs1, cgs1 )
]
-- setters
[ ( "set state", MainMenu, cgs1 )
, ( "change state", CreateGoalie cgs1, cgs2 )
, ( "clear state", CreateGoalie cgs1, newCreateGoalieState )
]
where
cgs1 = newCreateGoalieState
& cgsNumber ?~ 1
& cgsName .~ "Joe"
cgs2 = newCreateGoalieState
& cgsNumber ?~ 2
& cgsName .~ "Bob"
teamScoreSpec :: Spec
teamScoreSpec = describe "teamScore" $ do
let