Question: HW 2 (due date: Monday, 02/10) Write unit tests to test the methods suit, suitName and rankNameof Card class See the Chapter2-unitTestingCardHW.py #unitTestingCard.py # unit

 HW 2 (due date: Monday, 02/10) Write unit tests to test
the methods suit, suitName and rankNameof Card class See the Chapter2-unitTestingCardHW.py #unitTestingCard.py

HW 2 (due date: Monday, 02/10) Write unit tests to test the methods suit, suitName and rankNameof Card class See the Chapter2-unitTestingCardHW.py #unitTestingCard.py # unit testing rank import sys import unittest from Card import . class RankTest(unittest. Testcase) *** Tests Rank methods: rank() and rankName() *** def testRanks(self): *** creates cards of rank 1 through 13 of clubs and verifies that the created card's rank is equal to the rank it was created with ** for i in range(1,14): my Card - Card(i,'c') # create i of clubs self.assertEqual(myCard.rank(), i) # verifies that the card's rank is i class Suit Test (unittest. Test Case): *** Tests Suit methods: suit and suitName() "*" def test Suits (self): "*" creates cards of rank ... ofc (clubs), d (diamonds), h(hearts) and s (spades), and verifies that the created card's is equal to the suit it was created with (c,d,h,s)" pass def main(argv): unittest.main() if _name__ == main(sys.argy). main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!