Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有多个依赖于同一个 Mole 重定向的测试方法,为了防止重复,我将重定向代码放在了我的 ClassInit 方法中:
[ClassInitialize] public static void ClassInit(TestContext context) { MBase.AllInstances.BaseMethod = b => "Mole"; }
但是,当测试方法一起运行时,重定向只发生一次。为什么每个测试方法都不会发生重定向?
原来 Moles 不支持 ClassInitialize 方法。
有关此问题的更多信息,请参阅:
http://social.msdn.microsoft.com/Forums/en-US/pex/thread/c4e432e5-e657-454a-b90f-cfd37803c961?prof=required