I have extended objects of type IDataReader with some extension methods that I needed. The problem is now when I try to mock the IDataReader, the extended method is not incl
It is possible to stub extension method or any other static method without any framework. The following code allows you to do so, you just need to stub _doSumm
.
public static class MyExtensions
{
public static Func _doSumm = (x, y) => x + y;
public static int Summ(this int x, int y)
{
return _doSumm(x, y);
}
}