문제

I have multiple test methods that depend on the same Mole redirection, and in order to prevent duplication, I've placed the redirection code in my ClassInit Method:

    [ClassInitialize]
    public static void ClassInit(TestContext context)
    {
        MBase.AllInstances.BaseMethod = b => "Mole";
    }

However, when the test methods are run together the redirection only happens once. Why doesn't the redirection occur for each test method?

도움이 되었습니까?

해결책

Turns out that Moles doesn't support the ClassInitialize method.

For more information on this issue see:

http://social.msdn.microsoft.com/Forums/en-US/pex/thread/c4e432e5-e657-454a-b90f-cfd37803c961?prof=required

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top