简体   繁体   English

有没有一种使用MSpec进行RowTest的方法?

[英]Is there a way to RowTest using 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. 在使用MSpec练习Check Out Kata的同时 ,我想以与在NUnit中添加RowTest相同的方式删除规范中的重复项,但是我不知道该如何做。

Has anyone tried anything similiar, or would you consider such an approach an anti-pattern in an Context/Observation framework such as MSpec? 有没有人尝试过类似的尝试,或者您会认为这种方法是Context / Observation框架(例如MSpec)中的反模式?

MSpec doesn't support the RowTest concept known from other frameworks like NUnit and MbUnit. MSpec不支持其他框架(例如NUnit和MbUnit)中已知的RowTest概念。

There's limited support for reusing specifications (the It s) with behaviors, ie Behaves_like<TBehavior> but that's not entirely the same as a RowTest . 对行为的重用规范( It )的支持有限,即Behaves_like<TBehavior>但这与Behaves_like<TBehavior>并不RowTest

I generally discourage forcing MSpec to handle lots of different data points as you need to with your code kata. 我通常不鼓励您使用代码kata强制MSpec处理许多不同的数据点。 There are better tools out there to handle such situations, like the one you mentioned (NUnit). 有更好的工具可以处理这种情况,例如您提到的工具(NUnit)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM