I have a 3rd party C++ DLL that I call from C#.
The methods are static.
I want to abstract it out to do some unit testing so I created an interface with the
As to why you cannot have a static method on an interface: Why Doesn't C# Allow Static Methods to Implement an Interface?
However, I would suggest removing the static methods in favor of instance methods. If that is not possible, then you could wrap the static method calls inside of an instance method, and then you can create an interface for that and run your unit tests from that.
ie
public static class MyStaticClass
{
public static void MyStaticMethod()
{...}
}
public interface IStaticWrapper
{
void MyMethod();
}
public class MyClass : IStaticWrapper
{
public void MyMethod()
{
MyStaticClass.MyStaticMethod();
}
}