implemented addPlayerStats

This commit is contained in:
Jonathan Lamothe
2019-10-09 00:24:34 -04:00
parent 5f53413ef7
commit 74fd4fe2fb
2 changed files with 38 additions and 1 deletions

View File

@@ -59,6 +59,7 @@ spec = describe "Mtlstats.Types" $ do
playerSearchExactSpec
modifyPlayerSpec
playerSummarySpec
addPlayerStatsSpec
Menu.spec
playerSpec :: Spec
@@ -584,6 +585,33 @@ playerSummarySpec = describe "playerSummary" $
it "should be \"Joe (2) center\"" $
playerSummary joe `shouldBe` "Joe (2) center"
addPlayerStatsSpec :: Spec
addPlayerStatsSpec = describe "addPlayerStats" $ do
let
s1
= newPlayerStats
& psGoals .~ 1
& psAssists .~ 2
& psPMin .~ 3
s2
= newPlayerStats
& psGoals .~ 4
& psAssists .~ 5
& psPMin .~ 6
s3 = addPlayerStats s1 s2
describe "psGoals" $
it "should be 5" $
s3^.psGoals `shouldBe` 5
describe "psAssists" $
it "should be 7" $
s3^.psAssists `shouldBe` 7
describe "psPMin" $
it "should be 9" $
s3^.psPMin `shouldBe` 9
joe :: Player
joe = newPlayer 2 "Joe" "center"