DeveloperLove
DeveloperLove

Reputation: 567

C++ : Is it possible to write Mock class for a class with parameterized constructor

I am using Google Mock framework to develop unit test cases. For all the classes that have default constructors, I am able to write a mock class and mock the required methods. But is it possible for us to write a mock class for a class with no default constructor/ with a constructor but with parameters?

Upvotes: 0

Views: 853

Answers (1)

πάντα ῥεῖ
πάντα ῥεῖ

Reputation: 1

is it possible for us to write a mock class for a class with no default constructor/ with a constructor but with parameters?

Definitiely yes! I have already written such mock classes.

Do you have particular problems? Then show and make them clear please.

Upvotes: 2

Related Questions