I am trying to make test cases for a program that finds and prints the prime factors of a number. So, 100 would print out 2 2 5 5. I have the program written but cannot figure out a test case. any information on how to use it would be appreciated.
#include <iostream>
#include <vector>
typedef std::vector<int> IntVector;
IntVector CalcPrimeFactors(constint number)
{
IntVector factors;
// do your calculation here and add the factors to the vector
return factors;
}
int main()
{
cout << "Testing prime factors of 100" << endl;
IntVector result = CalcPrimeFactors(100);
// Check that the vector contains 4 elements
// Check that the vector has 2 elements with value2
// and 2 with value 5
// Show the result
// repeat for other values
return 0;
}