Gordon Pedersen

Using a Shim to mockup static and extension methods

For our C# unit testing, we generally use a mocking framework called Moq which makes it easy to create mock classes for injecting behaviour and verifying calls. But this only works for public instance methods and won’t work for anything static. Extension methods must be static methods within static classes, so what happens when you want […]