Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Select the Classes Select the most important two classes of our project. These can be the classes selected last week, or you might want to

Select the Classes

Select the most important two classes of our project. These can be the classes selected last week, or you might want to make adjustments based on feedback you received from your submission.

Write the Tests

With classes selected, it is time to write the unit tests. Each unit test should have four parts: Setup, Exercise, Verify, and Teardown. Additionally, each unit test should be encapsulated in a test class.

Strive to make every unit test fulfill the requirements in Chapter 25 of the textbook, and all the test cases meet the requirements of Chapter 14 of the textbook.

Run the Tests

The final step for this assignment is to run the tests. Initially, we expect the tests to fail. It probably will not even compile! Our job here is to write stub code for the classes under tests so they do compile but fail the test.

Here is my code so far. It doesn't need fixing yet, just unit tests designed

chess.cpp:

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

point.h:

image text in transcribed

uidraw.cpp:

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

uiDraw.h

image text in transcribed

uiInteract.cpp:

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

uiInteract.h:

image text in transcribed

image text in transcribed

Thanks in advance!

void ogstream:: drawSelected(int pos) \{ // do nothing if there is nothing to do if ( pos 0 \& \& pos =64 ) return; // find the row and column int row = pos /8; int col= pos %8; // set the color and drawing style glBegin(GL_QUADS); glColor(RGB_SELECTED); // draw the square glVertex2i((GLint) ((col+0)32+3), (GLint) (( row +0)32+3)); glVertex2i((GLint) ((col+1)323), (GLint) (( row +0)32+3)); glvertex2i((GLint) ((col+1)323), (GLint) (( row +1)323)); glVertex2i((GLint) ((col+0)32+3), (GLint) (( row +1)323)); // indicate we are finished glend (); \} void ogstream:: drawHover(int pos) \{ // do nothing if there is nothing to do if ( pos 0 pos =64 ) return; // find the row and column int row = pos /8; int col= pos %8; // set the color and drawing style glBegin (GL_QUADS); glColor(RGB_SELECTED); // draw the square glvertex2i((GLint) ((col+0)32), (GLint) (( row +0)32)); glVertex2i((GLint) ((col+1)32), /,1 \#pragma once using std: :string; \#endif'// LINUX, XCODE return; void clickCallback(int button, int state, int x, int y ) \{ // determine what to do if the button is selected if (button == GLUT_LEFT_BUTTON \& \& state == GLUT_DOWN) \{ // Even though this is a local variable, all the members are static // so we are actually getting the same version as in the constructor. Interface ui; // get coordinates from screen dimensions int pos = ui.positionFromXY (x,y); // if the current cell is selected, then deselect it if (ui.getselectPosition() == pos) ui.clearselectPosition(); else ui.setSelectPosition (pos); \} 3 void moveCallback(int x, int y ) \{ // Even though this is a local variable, all the members are static // so we are actually getting the same version as in the constructor. Interface ui; // get coordinates from screen dimensions int pos = ui.positionFromXY (x,y); ui. sethoverPosition (pos); \} / void closeCallback() \{ exit(0); \} extition \#pragma once

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

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions