Question: Lab 6 Individual: the task is to write a testbench to perform class Unit Testing on Class Card (Look at the end of Lab6 Team










Lab 6 Individual: the task is to write a testbench to perform class Unit Testing on Class Card (Look at the end of Lab6 Team PDF for instructions). You will use a code that you wrote in Lab 6 Team. You can look at the TESTBENCH.CPP for StatsInfo Class that we used in the lecture today to see how test are written for a class. SUBMISSION: submit Card.h, Card.cpp, CS215Lab6Individual.cpp in a ZIP file. Write tests as functions and make function calls to tests from MAIN. //Purpose: get the rank of card object int Card: :getRank() return rank; //Purpose: get the suit of card object Card: :Suits Card::getSuits() //Purpose: set the rank of a card object //PreCondition: new rank for a card object \{ rank (int newrank) \} newrank; //Purpose: set the suit value of a card object //PreCondition: new suit for a card object void Card: setSuit(Suits newsuit) suit = newsuit; Card: : compareTo(Card RHS) int returnval; if (this->getRank() getRank ()> RHS.getRank()) { returnval =1; else if ( this->getRank ()== RHS.getRank()) { returnval =0; \} return returnval; oid Card: printCard() switch (rank) \{ case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: cout rank; \#pragma once class Card public: typedef enum class suit { Invalid =0, Spade =1, Club =2, Heart =3, Diamond =4} Suits; Card(); Card(int newrank, Suits newsuit); int getRank(); Suits getSuits(); void setRank(int newrank); void setSuit(Suits newsuit); int compareTo(Card RHS); void printCard(); private: int rank; Suits suit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
