implemented teamPoints

This commit is contained in:
Jonathan Lamothe
2019-08-22 03:06:36 -04:00
parent 87eb2b9f16
commit ff19cd9fb5
2 changed files with 36 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ import qualified Types.MenuSpec as Menu
spec :: Spec
spec = describe "Mtlstats.Types" $ do
pPointsSpec
teamPointsSpec
playerSpec
goalieSpec
databaseSpec
@@ -58,6 +59,28 @@ pPointsSpec = describe "pPoints" $ mapM_
, ( 2, 3, 5 )
]
teamPointsSpec :: Spec
teamPointsSpec = describe "teamPoints" $ do
let
m t = NewGame $ newGameState
& gameType .~ Just t
& homeScore .~ Just 1
& visitorScore .~ Just 2
s t = newProgState
& progMode .~ m t
context "unexpected state" $
it "should return Nothing" $
teamPoints newProgState `shouldBe` Nothing
context "HomeGame" $
it "should return 1" $
teamPoints (s HomeGame) `shouldBe` Just 1
context "AwayGame" $
it "should return 2" $
teamPoints (s AwayGame) `shouldBe` Just 2
playerSpec :: Spec
playerSpec = describe "Player" $ do