implemented editGoalieYtdWins
This commit is contained in:
parent
a8a5d6a305
commit
14da1096cd
|
@ -81,7 +81,7 @@ editGoalieYtdWins
|
|||
-- ^ The number of wins
|
||||
-> ProgState
|
||||
-> ProgState
|
||||
editGoalieYtdWins = undefined
|
||||
editGoalieYtdWins wins = editGoalie (gYtd.gsWins .~ wins) EGYtd
|
||||
|
||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||
editGoalie f mode s = fromMaybe s $ do
|
||||
|
|
|
@ -36,6 +36,7 @@ spec = describe "EditGoalie" $ do
|
|||
editGoalieYtdGamesSpec
|
||||
editGoalieYtdMinsSpec
|
||||
editGoalieYtdGoalsSpec
|
||||
editGoalieYtdWinsSpec
|
||||
|
||||
editGoalieNumberSpec :: Spec
|
||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||
|
@ -192,6 +193,37 @@ editGoalieYtdGoalsSpec = describe "editGoalieYtdGoals" $ editTest
|
|||
)
|
||||
]
|
||||
|
||||
editGoalieYtdWinsSpec :: Spec
|
||||
editGoalieYtdWinsSpec = describe "editGoalieYtdWins" $ editTest
|
||||
(editGoalieYtdWins 1)
|
||||
EGYtdWins
|
||||
(\(num, name, wins) -> newGoalie num name & gYtd.gsWins .~ wins)
|
||||
[ ( "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 )
|
||||
, EGYtdWins
|
||||
)
|
||||
, ( "no goalie selected"
|
||||
, Nothing
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGYtdWins
|
||||
)
|
||||
]
|
||||
|
||||
editTest
|
||||
:: (ProgState -> ProgState)
|
||||
-> EditGoalieMode
|
||||
|
|
Loading…
Reference in New Issue
Block a user