In general, one uses unit testing to test "public" interfaces. ie, if I call "func()" my test is really what (in this case, side effects) is visible to external classes.
Class Foo{
public:
static int cTimesAPlusB(int a, int b, int c){
int sum = Foo::APlusB(a, b);
return c * sum;
}
private:
static int APlusB(int a, int b){
return a+b;
}
};
A test for this case would be something like
Test(Foo, cTimesAPlusB){
EXPECT_EQ(45, Foo::cTimesAPlusB(2, 3, 9));
}
See, the only result anyone can access is the result of cTimesAPlusB, so that's what we write a test around. That way, if we change it up in the future (say we used some other library to add a+b in a new implementation), the result should still stay the same. We don't care what the private members actually
do, so long as the public results are the same.
"Ah, but my private function is really complicated and I really would like to know that it works on its own." I've found this to be true more often than not, in fact. This is where one can turn to the PIMPL idiom. (ie, we'd create an implementation class that moves the private function to public, and the interface class, A, would simply call that public function.) But I suspect that at this point it's important to understand why this class has a private static function to begin with.