Skip to main content
1 of 7
Winston Ewert
  • 25k
  • 12
  • 74
  • 103

You should break up the class under question.

Each class should do some simple task. If you task is too complicated to test, then the task the class does is too big.

Ignoring the goofiness of this design:

class NewYork
{
    decimal GetRevenue();
    decimal GetExpenses();
    decimal GetProfit();
}


class Miami
{
    decimal GetRevenue();
    decimal GetExpenses();
    decimal GetProfit();
}

class MyProfit
{
     MyProfit(NewYork new_york, Miami miami);
     boolean bothProfitable();
}


   
Winston Ewert
  • 25k
  • 12
  • 74
  • 103