Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

Excel caculation on cascade mental health clinic

Answered: 1 week ago