Thanks for your help, Scott!
So I have to use this workaround for every classes from mscorlib.dll when mocking objects? How about mocking methods of classes in mscorlib.dll, should I also do like
public static bool CheckSomething(ClassFrom_mscorlib arg)
{
return arg.CheckSomething();
}
If that is the case, then to mock a method with different arguments like,
public static bool CheckSomethingDifficult(ClassFrom_mscorlib arg, int para1, double para2, string para3, bool para4)
{
return arg.CheckSomethingDifficult(para1, para2, para3, para4);
}
With this workaround, whenever we mock objects from mscorlib, we have to provide a static method just for unit testing. This may,
1. introduce lot of APIs change to enable unit testing, and
2. all callers should call our APIs in order to not break the tests
Any alternatives?
________
Honda Wiki