Today, I needed to mock just one function from a class instance.
I used multiple inheritance to achieve that like so:
The ProdEngineMock class inherits everything from the ProdEngine class, except the mocked function.
Nice and elegant!
28 septembre 2010
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire