AArnott / Xunit.Combinatorial

Adds combinatorial and pairwise testing capability to Xunit tests
Other
180 stars 16 forks source link

PairwiseData only works with boolean #28

Closed alrz closed 2 years ago

alrz commented 2 years ago

Looks like using PairwiseData in the following test won't make a different in test run count.

[Theory, CombinatorialData]
public void Test([CombinatorialRange(0, 18)] int c1,
                 [CombinatorialRange(0, 18)] int c2,
                 [CombinatorialValues("System.Span<int>", "int[]")] string type)
AArnott commented 2 years ago

When you try, do you replace the CombinatorialData with PairwiseData?

alrz commented 2 years ago

Yes, that's what I tried.

AArnott commented 2 years ago

It works when I try it:

    [Theory, PairwiseData]
    public void PairwiseOption(
        [CombinatorialRange(0, 3)] int c1,
        [CombinatorialRange(0, 3)] int c2,
        [CombinatorialValues("System.Span<int>", "int[]")] string type)
    {
    }

    [Theory, CombinatorialData]
    public void CombinatorialOption(
        [CombinatorialRange(0, 3)] int c1,
        [CombinatorialRange(0, 3)] int c2,
        [CombinatorialValues("System.Span<int>", "int[]")] string type)
    {
    }

As shown below, the pairwise option generates only 9 test cases while the combinatorial one generates 18. image

alrz commented 2 years ago

Thanks. Looks like I was missing something the first time I tried, sorry.