implemented editGoalieLtMins
This commit is contained in:
parent
30cfea0503
commit
3a1480115d
|
@ -117,7 +117,7 @@ editGoalieLtMins
|
|||
-- ^ The number of minutes
|
||||
-> ProgState
|
||||
-> ProgState
|
||||
editGoalieLtMins = undefined
|
||||
editGoalieLtMins mins = editGoalie (gLifetime.gsMinsPlayed .~ mins) EGLifetime
|
||||
|
||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||
editGoalie f mode s = fromMaybe s $ do
|
||||
|
|
|
@ -40,6 +40,7 @@ spec = describe "EditGoalie" $ do
|
|||
editGoalieYtdLossesSpec
|
||||
editGoalieYtdTiesSpec
|
||||
editGoalieLtGamesSpec
|
||||
editGoalieLtMinsSpec
|
||||
|
||||
editGoalieNumberSpec :: Spec
|
||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||
|
@ -320,6 +321,37 @@ editGoalieLtGamesSpec = describe "editGoalieLtGames" $ editTest
|
|||
)
|
||||
]
|
||||
|
||||
editGoalieLtMinsSpec :: Spec
|
||||
editGoalieLtMinsSpec = describe "editGoalieLtMins" $ editTest
|
||||
(editGoalieLtMins 1)
|
||||
EGLtMins
|
||||
(\(num, name, mins) -> newGoalie num name & gLifetime.gsMinsPlayed .~ mins)
|
||||
[ ( "set Joe"
|
||||
, Just 0
|
||||
, ( 2, "Joe", 1 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGLifetime
|
||||
)
|
||||
, ( "set Bob"
|
||||
, Just 1
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 1 )
|
||||
, EGLifetime
|
||||
)
|
||||
, ( "out of bounds"
|
||||
, Just 2
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGLtMins
|
||||
)
|
||||
, ( "no goalie selected"
|
||||
, Nothing
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGLtMins
|
||||
)
|
||||
]
|
||||
|
||||
editTest
|
||||
:: (ProgState -> ProgState)
|
||||
-> EditGoalieMode
|
||||
|
|
Loading…
Reference in New Issue
Block a user