Rhino Mocks 3.5 测试属性设置器未被调用
是否可以使用Rhino Mocks 3.5测试属性设置器是否未被调用?
Is it possible to test that a property setter has not been called using Rhino Mocks 3.5?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是完全有可能的:
在 Rhino Mocks 3.5 上运行此测试会导致以下错误:
我从中发现了
Arg
语法 Rhino 文档的一部分。This is entirely possible:
Running this test on Rhino Mocks 3.5 results in the following error:
I discovered the
Arg<T>
syntax from this part of the Rhino documentation.在测试中将该属性设置为某个已知值。调用不会更改属性的代码,然后断言该属性与原来相同。不应该需要为此使用 Rhino Mocks。
Set the property to some known value in the test. Call the code that won't change the property, then assert that the property is the same as it was. Shouldn't need to use Rhino Mocks for that.