implemented editGoalieYtdLosses
This commit is contained in:
parent
01859634a1
commit
4655cb37b9
|
@ -90,7 +90,7 @@ editGoalieYtdLosses
|
|||
-- ^ The number of losses
|
||||
-> ProgState
|
||||
-> ProgState
|
||||
editGoalieYtdLosses = undefined
|
||||
editGoalieYtdLosses losses = editGoalie (gYtd.gsLosses .~ losses) EGYtd
|
||||
|
||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||
editGoalie f mode s = fromMaybe s $ do
|
||||
|
|
|
@ -37,6 +37,7 @@ spec = describe "EditGoalie" $ do
|
|||
editGoalieYtdMinsSpec
|
||||
editGoalieYtdGoalsSpec
|
||||
editGoalieYtdWinsSpec
|
||||
editGoalieYtdLossesSpec
|
||||
|
||||
editGoalieNumberSpec :: Spec
|
||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||
|
@ -224,6 +225,37 @@ editGoalieYtdWinsSpec = describe "editGoalieYtdWins" $ editTest
|
|||
)
|
||||
]
|
||||
|
||||
editGoalieYtdLossesSpec :: Spec
|
||||
editGoalieYtdLossesSpec = describe "editGoalieYtdLosses" $ editTest
|
||||
(editGoalieYtdLosses 1)
|
||||
EGYtdLosses
|
||||
(\(num, name, losses) -> newGoalie num name & gYtd.gsLosses .~ losses)
|
||||
[ ( "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 )
|
||||
, EGYtdLosses
|
||||
)
|
||||
, ( "no goalie selected"
|
||||
, Nothing
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGYtdLosses
|
||||
)
|
||||
]
|
||||
|
||||
editTest
|
||||
:: (ProgState -> ProgState)
|
||||
-> EditGoalieMode
|
||||
|
|
Loading…
Reference in New Issue
Block a user