Microsoft Moles 不会为具有过时成员的类型生成 Stub 或 Mole
我们成功地为我们的单元测试的第三方供应商组件生成了存根和摩尔。随着最近的更新,许多类型被忽略,因为某些方法已被声明为过时(...,true)。有解决办法吗?我们希望避免从头开始使用新的模拟工具。
We were successfully generating stubs and moles for third party vendor assemblies for our unit tests. With their recent updates a lot of types are being ignored as certain methods have been declared obsolete(...,true). Is there a work around at all. We want to avoid starting from scratch using a new mocking tool..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅:存根生成失败,属性已过时,Pex v0.94.51023.0
“这是设计使然。当一个方法被标记为 Obsolete(..., true) 时,C# 将不允许 [you] 实例化实现该接口的 [a] 类。”
See: Stub generation failes with obsolete attribute, Pex v0.94.51023.0
"This is by design. When a method is marked at Obsolete(..., true), C# will not allow [you] to instantiate [a] class implementing that interface."