Question: here is the sample program of testing a constructor . Anyone knows how to implement this base on this( similar ) Here is my constructor,
here is the sample program of testing a constructor .
Test GameofLife constructor and destr 37 evoid test game smoketest(Errorcontext &ec) f bool passi Gameof Life' my Game; A0 ec .DESC Test- Gameof Life Smoke test ec.DESC("Default constructor"); 43 pass true; 45 Construct a Default GameofLife boardsize should be set to MAX BoARD Game new GameofLife; pass yGame- getBoardsize() myGame->MAX BoARD); ec result(pass); 49 "Destruct Defualt Test Game"); ec-DESC( cleans up after previous test, destruct the object delete syGame; ec.DEsco custom constructor requesting a specific boad size"); pass true: II Construct a custom Gameoff Life boardsize should be set to what was requested yGame new Gameof Life(30); pass yare->getsoards 30); ec. ize() result (pass): 61 ec.DESCC Destruct custom Test Game"); 63 Cleans up after previous test, destruct the object elete Games Game rules test output from Debug Test GameofLife constructor and destr 37 evoid test game smoketest(Errorcontext &ec) f bool passi Gameof Life' my Game; A0 ec .DESC Test- Gameof Life Smoke test ec.DESC("Default constructor"); 43 pass true; 45 Construct a Default GameofLife boardsize should be set to MAX BoARD Game new GameofLife; pass yGame- getBoardsize() myGame->MAX BoARD); ec result(pass); 49 "Destruct Defualt Test Game"); ec-DESC( cleans up after previous test, destruct the object delete syGame; ec.DEsco custom constructor requesting a specific boad size"); pass true: II Construct a custom Gameoff Life boardsize should be set to what was requested yGame new Gameof Life(30); pass yare->getsoards 30); ec. ize() result (pass): 61 ec.DESCC Destruct custom Test Game"); 63 Cleans up after previous test, destruct the object elete Games Game rules test output from Debug
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
