implemented editGoalieYtdMins
This commit is contained in:
parent
0961f14c5f
commit
023430d737
|
@ -63,7 +63,7 @@ editGoalieYtdMins
|
|||
-- ^ The number of minutes played
|
||||
-> ProgState
|
||||
-> ProgState
|
||||
editGoalieYtdMins = undefined
|
||||
editGoalieYtdMins mins = editGoalie (gYtd.gsMinsPlayed .~ mins) EGYtd
|
||||
|
||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||
editGoalie f mode s = fromMaybe s $ do
|
||||
|
|
|
@ -34,6 +34,7 @@ spec = describe "EditGoalie" $ do
|
|||
editGoalieNumberSpec
|
||||
editGoalieNameSpec
|
||||
editGoalieYtdGamesSpec
|
||||
editGoalieYtdMinsSpec
|
||||
|
||||
editGoalieNumberSpec :: Spec
|
||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||
|
@ -128,6 +129,37 @@ editGoalieYtdGamesSpec = describe "editGoalieYtdGames" $ editTest
|
|||
)
|
||||
]
|
||||
|
||||
editGoalieYtdMinsSpec :: Spec
|
||||
editGoalieYtdMinsSpec = describe "editGoalieYtdMins" $ editTest
|
||||
(editGoalieYtdMins 1)
|
||||
EGYtdMins
|
||||
(\(num, name, mins) -> newGoalie num name & gYtd.gsMinsPlayed .~ mins)
|
||||
[ ( "set Joe"
|
||||
, Just 0
|
||||
, ( 2, "Joe", 1 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGYtd
|
||||
)
|
||||
, ( "set Bob"
|
||||
, Just 1
|
||||
, (2, "Joe", 0 )
|
||||
, (3, "Bob", 1 )
|
||||
, EGYtd
|
||||
)
|
||||
, ( "out of bounds"
|
||||
, Just 2
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGYtdMins
|
||||
)
|
||||
, ( "no goalie selected"
|
||||
, Nothing
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGYtdMins
|
||||
)
|
||||
]
|
||||
|
||||
editTest
|
||||
:: (ProgState -> ProgState)
|
||||
-> EditGoalieMode
|
||||
|
|
Loading…
Reference in New Issue
Block a user