如何将 Xml 数据作为参数传递给 mbunit v3 中的测试
我正在阅读这篇文章中有关使用 mbunit 进行数据驱动测试的内容。 http://blog.benhall.me。 uk/2007/04/mbunit-datafixture-data-driven-unit.html 我现在使用的是 mbunit v3,根据 V3 的发行说明,用于 DataDriven 测试的属性在 V3 中不适用。使用本文 http://blog .bits-in-motion.com/2009/03/announcing-gallio-and-mbunit-v306.html,我能够使用 xml 数据源进行数据驱动测试。但我必须对每个参数使用 [Bind("price")] 。在 V2 中,有一种方法可以在 ForEachTest 属性中指定类的数据类型,反序列化以包含 xml 数据。这样做我们可以将类的对象作为参数传递给测试方法。 v3 有什么办法可以做到这一点吗?
I was reading about data driven testing using mbunit from this article.
http://blog.benhall.me.uk/2007/04/mbunit-datafixture-data-driven-unit.html
I am using v3 of mbunit now and the attributes used for DataDriven testing are Not applicable in V3 as per the release notes for V3. Using this article http://blog.bits-in-motion.com/2009/03/announcing-gallio-and-mbunit-v306.html, I was able to do Data Driven testing using xml data source. But I have to use [Bind("price")] with each parameter. In V2, there was a way to specify the datatype of a class, deserialized to contain the xml data, in the ForEachTest attribute. And doing so we can just pass the object of the class to the test method as a parameter. Is there any way to do such thing in v3?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Gallio/MbUnit v3.2 尚未。您必须使用
[Bind]
属性绑定每个单个参数。不过,这是个好主意;并相应创建了一个问题。它应该是 v3.3。
This is not supported in Gallio/MbUnit v3.2 yet. You must bind each single parameter with the
[Bind]
attribute.It's a excellent idea however; and an issue was created accordingly. It should make v3.3.