implemented editGoalieStateL
This commit is contained in:
parent
8aa8d39f70
commit
f9849023bc
|
@ -653,7 +653,11 @@ editPlayerStateL = lens
|
|||
(\_ eps -> EditPlayer eps)
|
||||
|
||||
editGoalieStateL :: Lens' ProgMode EditGoalieState
|
||||
editGoalieStateL = undefined
|
||||
editGoalieStateL = lens
|
||||
(\case
|
||||
EditGoalie egs -> egs
|
||||
_ -> newEditGoalieState)
|
||||
(\_ egs -> EditGoalie egs)
|
||||
|
||||
-- | Constructor for a 'ProgState'
|
||||
newProgState :: ProgState
|
||||
|
|
|
@ -56,6 +56,7 @@ spec = describe "Mtlstats.Types" $ do
|
|||
createPlayerStateLSpec
|
||||
createGoalieStateLSpec
|
||||
editPlayerStateLSpec
|
||||
editGoalieStateLSpec
|
||||
teamScoreSpec
|
||||
otherScoreSpec
|
||||
homeTeamSpec
|
||||
|
@ -169,6 +170,24 @@ editPlayerStateLSpec = describe "editPlayerStateL" $
|
|||
eps2 = newEditPlayerState
|
||||
& epsSelectedPlayer ?~ 2
|
||||
|
||||
editGoalieStateLSpec :: Spec
|
||||
editGoalieStateLSpec = describe "editGoalieStateL" $
|
||||
lensSpec editGoalieStateL
|
||||
-- getters
|
||||
[ ( "missing state", MainMenu, newEditGoalieState )
|
||||
, ( "with state", EditGoalie egs1, egs1 )
|
||||
]
|
||||
-- setters
|
||||
[ ( "set state", MainMenu, egs1 )
|
||||
, ( "change state", EditGoalie egs1, egs2 )
|
||||
, ( "clear state", EditGoalie egs1, newEditGoalieState )
|
||||
]
|
||||
where
|
||||
egs1 = newEditGoalieState
|
||||
& egsSelectedGoalie ?~ 1
|
||||
egs2 = newEditGoalieState
|
||||
& egsSelectedGoalie ?~ 2
|
||||
|
||||
teamScoreSpec :: Spec
|
||||
teamScoreSpec = describe "teamScore" $ do
|
||||
let
|
||||
|
@ -858,6 +877,17 @@ instance Comparable EditPlayerState where
|
|||
it ("should be " ++ show (expected^.epsMode)) $
|
||||
actual^.epsMode `shouldBe` expected^.epsMode
|
||||
|
||||
instance Comparable EditGoalieState where
|
||||
compareTest actual expected = do
|
||||
|
||||
describe "egsSelectedGoalie" $
|
||||
it ("should be " ++ show (expected^.egsSelectedGoalie)) $
|
||||
actual^.egsSelectedGoalie `shouldBe` expected^.egsSelectedGoalie
|
||||
|
||||
describe "egsMode" $
|
||||
it ("should be " ++ show (expected^.egsMode)) $
|
||||
actual^.egsMode `shouldBe` expected^.egsMode
|
||||
|
||||
instance Comparable CreateGoalieState where
|
||||
compareTest actual expected = do
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user