Mock anything in C++ without Dependency Injection

Опубликовано: 06 Август 2026
на канале: platis.solutions
3,709
70

Learn about the "static mock injection" technique that allows you to mock almost any dependency in C++ without having to use the Dependency Injection pattern.

Written tutorial: https://platis.solutions/blog/2022/02...
GitHub link: https://github.com/platisd/static-moc...

Contents:
00:00 - Intro
01:07 - Why are mocks useful
04:38 - Dependency Injection
08:01 - Static mock injection
13:29 - The good
15:16 - The bad
17:28 - The ugly
21:15 - Static mock injection alternative with templates
22:58 - Takeaways