-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow veto of certain combinations #3
Comments
+1 for this feature. It seems not really hard to implement it at least for |
+1 Currently we have to do |
Can someone make a proposal that includes the new API surface area, example uses and describe the behavior? |
This is the simplest I could come up with [Theory, CombinatorialData]
[CombinatiorialExclude(false, false, false)]
// maybe a few more
public void CheckValidAge(bool p1, bool p2, bool p3) to exclude Something similar should probably work for pairwise, but I don't have a good use case for it right now. |
That's a good start. What about when the args can't be expressed as constants? Something like MemberData provides. Or maybe that already doesn't work for Combinatorial, I don't recall. |
Even if it does work, that may need a special equality check as well so it's probably out of scope. I think an attribute like that will cover 90% of scenarios. |
#1 actually tracks a |
Maybe to add 2 different attributes?
[Theory, CombinatorialData]
[CombinatiorialExclude(1, 1, 1)]
public void CheckFailIfAnyParamIsNonpositive(
[CombinatorialValues(-1, 0, 1)] int a,
[CombinatorialValues(-1, 0, 1)] int b,
[CombinatorialValues(-1, 0, 1)] int c) [Theory, CombinatorialData]
[CombinatiorialExcludeMemberData(nameof(GetUntestableCombinations))]
public void CheckComplexParameters(
[CombinatorialMemberDataValues(nameof(GetComplexData1))] Complex1 complex1,
[CombinatorialMemberDataValues(nameof(GetComplexData2))] Complex2 complex2) |
Sure, that could work. |
26696c1 doesn't seem to be related? |
Agreed. That's a mistake from merging commits from another repo. Thanks for catching, @alrz. |
+1 Personally I would need something like |
PairwiseDataAttribute
andCombinatorialDataAttribute
should accept a parameter that allows the test to veto certain known invalid parameter combinations. Thereby suppressing generation of test cases that don't make sense.Ideally in the pairwise case, such a suppression will feed back into the pairwise algorithm so it can try selecting other combinations that still satisfy pairwise testing requirements, wherever possible.
The text was updated successfully, but these errors were encountered: