So you're interested in using mocks for your C++ project. Then you find out that in order to mock your favorite type, you need to alter the interface in order to mock member functions which are not virtual. While it may make sense in many cases to refactor into an abstract interface and mock that, it's not always reasonable or even possible. Sometimes you just want to keep a member function non-virtual and be able to mock it.
NVMock is a header only library. It depends on boost 1.53+ and is intended to be used with Google Mock. It may be adaptable to other mocking schemes, but I haven't tried.
See the example directory in the code for a full use-case.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author: Brandon Kohn
NVMock is released under the Boost license: http://www.boost.org/LICENSE_1_0.txt