My Project
 All Classes Files Functions
Public Member Functions | Protected Member Functions | List of all members
TestCalculations Class Reference

#include <TestCalculations.h>

Inheritance diagram for TestCalculations:

Public Member Functions

void setUp (void)
 setUp() method that is executed before all the test cases that the test class includes
 
void tearDown (void)
 tearDown() method that is executed after all the test cases that the test class includes
 

Protected Member Functions

void testDivision (void)
 
void testAddition (void)
 
void testMultiplication (void)
 
void testSubtraction (void)
 

Detailed Description

Test Class for the Calculations class It must be a subclass of CppUnit::TestFixture It then uses CPPUNIT_TEST_SUITE() to create the test suite, and CPPUNIT_TEST() to include the test methods in the test suite. CPPUNIT_TEST_SUITE_REGISTRATION() is then used to register the test class in the test registry.

Definition at line 25 of file TestCalculations.h.

Member Function Documentation

void TestCalculations::testAddition ( void  )
protected

test method to test the Addition() method of the Calculations class Test Case: 3+3=6

Definition at line 21 of file TestCalculations.cpp.

22 {
23  CPPUNIT_ASSERT(6 == CalcObject->Addition(3,3));
24 }
float Addition(float a, float b)
void TestCalculations::testDivision ( void  )
protected

test method to test the Division() method of the Calculations class Test Case: 9/3=3

Definition at line 35 of file TestCalculations.cpp.

36 {
37  CPPUNIT_ASSERT(3 == CalcObject->Division(9,3));
38 }
float Division(float a, float b)
void TestCalculations::testMultiplication ( void  )
protected

test method to test the Multiplication() method of the Calculations class Test Case: 2*3=6

Definition at line 28 of file TestCalculations.cpp.

29 {
30  CPPUNIT_ASSERT(6 == CalcObject->Multiplication(2,3));
31 }
float Multiplication(float a, float b)
void TestCalculations::testSubtraction ( void  )
protected

test method to test the Subtraction() method of the Calculations class Test Case: 9-3=6

Definition at line 42 of file TestCalculations.cpp.

43 {
44  CPPUNIT_ASSERT(6 == CalcObject->Subtraction(9,3));
45 }
float Subtraction(float a, float b)

The documentation for this class was generated from the following files: