如何在 Nunit 中的灯具之间共享重物?
全部。 我使用 NUnit 进行了一些集成测试,并且需要为每个装置进行长时间运行的客户端设置。对我来说,最好只设置客户端一次。这将显着减少总时间。我现在使用父夹具中的静态字段来执行此操作。有没有更好的缓存方法?可能是一些背景信息等。
提前致谢,亚历克斯。
All.
I do some integration tests with NUnit and need a long running client setup per fixture. For me it will be good to setup the client only once. This will significantly reduce overall time. i do it now with a static field in the parent fixture. Is there a better way to cache it? Probably some context, etc.
Thanks in advance, Alex.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了适当的解决方案 - http://www.nunit。 org/index.php?p=setupFixture&r=2.5.9
它只会在任何固定装置之前执行一次,并将存储对重物的引用。任何固定装置都可以重复使用它。
i've found appropriate solution - http://www.nunit.org/index.php?p=setupFixture&r=2.5.9
it will be executed only once before any fixtures and will store reference to the heavy object. any fixtures can reuse it.