implemented editGoalieLtGames
This commit is contained in:
parent
6b1aa85010
commit
afdb7653cd
|
@ -108,7 +108,7 @@ editGoalieLtGames
|
|||
-- ^ The number of games
|
||||
-> ProgState
|
||||
-> ProgState
|
||||
editGoalieLtGames = undefined
|
||||
editGoalieLtGames games = editGoalie (gLifetime.gsGames .~ games) EGLifetime
|
||||
|
||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||
editGoalie f mode s = fromMaybe s $ do
|
||||
|
|
|
@ -39,6 +39,7 @@ spec = describe "EditGoalie" $ do
|
|||
editGoalieYtdWinsSpec
|
||||
editGoalieYtdLossesSpec
|
||||
editGoalieYtdTiesSpec
|
||||
editGoalieLtGamesSpec
|
||||
|
||||
editGoalieNumberSpec :: Spec
|
||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||
|
@ -288,6 +289,37 @@ editGoalieYtdTiesSpec = describe "editGoalieYtdTies" $ editTest
|
|||
)
|
||||
]
|
||||
|
||||
editGoalieLtGamesSpec :: Spec
|
||||
editGoalieLtGamesSpec = describe "editGoalieLtGames" $ editTest
|
||||
(editGoalieLtGames 1)
|
||||
EGLtGames
|
||||
(\(num, name, games) -> newGoalie num name & gLifetime.gsGames .~ games)
|
||||
[ ( "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 )
|
||||
, EGLtGames
|
||||
)
|
||||
, ( "no goalie selected"
|
||||
, Nothing
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGLtGames
|
||||
)
|
||||
]
|
||||
|
||||
editTest
|
||||
:: (ProgState -> ProgState)
|
||||
-> EditGoalieMode
|
||||
|
|
Loading…
Reference in New Issue
Block a user