I have the following class:
class foo {
public:
foo() : the_count(0) {}
~foo() = default;
void add_one_to_count() { the_count++; };
private:
int the_count;
};
In this class, a public function changes a private member variable. How can I unit-test this in such a way that I can verify what the value of the_count
is without making a getter function?