I'm working through the simple refactoring example in
Refactoring by Martin Fowler and using the method he describes for
JUnit testing.
Problem is, within the JUnit framework, how do you test
private methods??
The refactoring example
Customer class has two private methods
getTotalAmount() and
getFrequentRenterPoints() that return a
result and can't be called from a TestSuite. Presumably these are critical values to a customer.
What do you use when that happens? A simple main method in the class?
Or is the problem just that the refactoring example is simplified and in a real case scenario a 'statement' object would exist and
TotalAmount and
FrequentRenterPoints would be fields inside
Customer with public accessors and would be updated when a statement is called??
Insights would be greatly appreciated