Mock Object Strategies
By Eric
—
—
12 minute read
How do you get your production code to use real objects and your test code to use mock objects?
Here's the class we want to test (adapted from Object-Oriented Design Heuristics, Arthur J. Riel):
public class HeatFlowRegulator
{
private Furnace furnace;
private Set house;
public HeatFlowRegulator(Set house)
{
this.house = house …