[英]Combinatorial data in xUnit.NET?
I'm migrating from MbUnit to xUnit, and I'm trying to locate the equivalent attributes (or approach) to MbUnit's [CombinatorialJoin]
and [Column]
. 我正在从MbUnit迁移到xUnit,我正在尝试找到MbUnit的
[CombinatorialJoin]
和[Column]
的等效属性(或方法)。
For example, when testing common behavior of a function with multiple boolean parameters, [Column]
makes it very easy to test the permutations: 例如,在测试具有多个布尔参数的函数的常见行为时,
[Column]
可以非常轻松地测试排列:
public void TestMethodWithTooManyOptions([Column(true, false)] bool dispose,
[Column(true, false)] bool useDestinationStream,
[Column(true, false)] bool useCorruptedSource,
[Column(true, false)] bool loadTwice,
[Column(true, false)] bool useSourceStream) {
[CombinatorialJoin]
, [SequentialJoin]
, [PairwiseJoin]
affect how columns (or rows) are permuted. [CombinatorialJoin]
, [SequentialJoin]
, [PairwiseJoin]
会影响列(或行)的置换方式。
This is perhaps a correct response... 这可能是一个正确的回应......
https://github.com/AArnott/Xunit.Combinatorial https://github.com/AArnott/Xunit.Combinatorial
If you use ApprovalTests, you can create an xUnit.net Fact and the CombinationApprovals.VerifyAllCombinations method to run combinatorial tests. 如果使用ApprovalTests,则可以创建xUnit.net Fact和CombinationApprovals.VerifyAllCombinations方法来运行组合测试。
It's not the same as using an attribute, but it's the best solution I have found in xUnit. 它与使用属性不同,但它是我在xUnit中找到的最佳解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.