implemented editGoalieYtdTies
This commit is contained in:
parent
101f436424
commit
f97db477dd
|
@ -99,7 +99,7 @@ editGoalieYtdTies
|
|||
-- ^ The number of ties
|
||||
-> ProgState
|
||||
-> ProgState
|
||||
editGoalieYtdTies = undefined
|
||||
editGoalieYtdTies ties = editGoalie (gYtd.gsTies .~ ties) EGYtd
|
||||
|
||||
editGoalie :: (Goalie -> Goalie) -> EditGoalieMode -> ProgState -> ProgState
|
||||
editGoalie f mode s = fromMaybe s $ do
|
||||
|
|
|
@ -38,6 +38,7 @@ spec = describe "EditGoalie" $ do
|
|||
editGoalieYtdGoalsSpec
|
||||
editGoalieYtdWinsSpec
|
||||
editGoalieYtdLossesSpec
|
||||
editGoalieYtdTiesSpec
|
||||
|
||||
editGoalieNumberSpec :: Spec
|
||||
editGoalieNumberSpec = describe "editGoalieNumber" $ editTest
|
||||
|
@ -256,6 +257,37 @@ editGoalieYtdLossesSpec = describe "editGoalieYtdLosses" $ editTest
|
|||
)
|
||||
]
|
||||
|
||||
editGoalieYtdTiesSpec :: Spec
|
||||
editGoalieYtdTiesSpec = describe "editGoalieYtdTies" $ editTest
|
||||
(editGoalieYtdTies 1)
|
||||
EGYtdTies
|
||||
(\(num, name, ties) -> newGoalie num name & gYtd.gsTies .~ ties)
|
||||
[ ( "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 )
|
||||
, EGYtdTies
|
||||
)
|
||||
, ( "no goalie selected"
|
||||
, Nothing
|
||||
, ( 2, "Joe", 0 )
|
||||
, ( 3, "Bob", 0 )
|
||||
, EGYtdTies
|
||||
)
|
||||
]
|
||||
|
||||
editTest
|
||||
:: (ProgState -> ProgState)
|
||||
-> EditGoalieMode
|
||||
|
|
Loading…
Reference in New Issue
Block a user