有没有办法使用 MSpec 进行 RowTest?
在使用 MSpec 练习 Check Out Kata 时,我想删除规范中的重复内容与在 NUnit 中添加 RowTest 的方式相同,但我不知道如何添加。
有没有人尝试过类似的方法,或者您是否认为这种方法是上下文/观察框架(例如 MSpec)中的反模式?
Whilst practising the Check Out Kata with MSpec I wanted to remove the duplication in my specs the same way that you would add a RowTest in NUnit, but I couldn't figure out how.
Has anyone tried anything similiar, or would you consider such an approach an anti-pattern in an Context/Observation framework such as MSpec?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MSpec 不支持 NUnit 和 MbUnit 等其他框架中已知的
RowTest
概念。对重用规范(
It
)和行为(即Behaves_like
)的支持有限,但这与RowTest
并不完全相同。我通常不鼓励强制 MSpec 处理大量不同的数据点,因为您需要使用代码 kata。有更好的工具可以处理这种情况,例如您提到的(NUnit)。
MSpec doesn't support the
RowTest
concept known from other frameworks like NUnit and MbUnit.There's limited support for reusing specifications (the
It
s) with behaviors, i.e.Behaves_like<TBehavior>
but that's not entirely the same as aRowTest
.I generally discourage forcing MSpec to handle lots of different data points as you need to with your code kata. There are better tools out there to handle such situations, like the one you mentioned (NUnit).