Static Methods are everywhere, especially if the code is from Microsoft. How you work this?
Make an interface with an instance method/member, make a class that implementes the interface an within this instance you can call the static stuff.
Example: The DateTime-object has the member Now, so if you call DateTime.Now, you will get the current time. Unfortunately, can’t test time relevant actions like how long took a print job this way.
First: Declare the interface (VB.NET Code):
Second: Implement it (C# Code):
With Fake It Easy you can create a mock like this:
Important: Don’t forget to register this in your IoC-Container respectively inject the SystemClock-Object into your object/method that used the DateTime.Now earlier.