I am using AWS C++ SDK to download/upload files on AWS using AWS::Transfer::TransferManager
. I want to unit test client class which makes uses of TransferManager
and It requires to mock TransferManager
. The AWS TransferManager
class is concrete class, not an abstract class. How do I mock it?
Asked
Active
Viewed 468 times
1

Quarra
- 2,527
- 1
- 19
- 27

Rushin Desai
- 11
- 1
1 Answers
0
See this answer describing a technique called hi-perf dependency injection.
Basically it allows you to define dependency injection of non-virtual class at compile time (and not at runtime, as with regular depencendy injection) using templates. Downside is that you'll have to have it in the header file.

Quarra
- 2,527
- 1
- 19
- 27