You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially, I'm looking to be able to hand write values for some test parameters while combinatorially populating others. This would allow more control over e.g. int values than the existing range options or the veto option proposed in #3.
An (albeit useless) toy example:
/// Assumption: a > b[Theory][InlineData(10,0,true)][InlineData(10,0,false)][InlineData(5,2,true)][InlineData(5,2,false)]publicvoidExample(inta,intb,boolc){// body}
In this example, the values for a and b are hand-picked, but should be tested for both values of c. I assume it may not be possible to build this functionality on top of the existing InlineData attribute, but supposing a new keyword-style equivalent that replaced any omitted parameters with their combinatorial definitions, it could look like this:
/// Assumption: a > b[Theory,CombinatorialData][PartialInlineData(10,0)][PartialInlineData(10,0)][PartialInlineData(5,2)][PartialInlineData(5,2)]publicvoidExample(inta,intb,[CombinatorialValues(true,false)]boolc){// body}
and could also support cases where we don't want the combinatorics a la #3
[PartialInlineData(6,2,false)]// No need to veto [PartialInlineData(6, 2, true)] if you don't want it
The text was updated successfully, but these errors were encountered:
It sounds interesting. The combinatorial algorithm is very complex, and I just copied it from NUnit. I'm not sure how easily adaptable it would be to this idea. I think your proposed API would need a little adjusting as well. But if you have time and interest to give it a try, let me know and I'll assign the issue to you. Otherwise I may close the issue as I don't foresee ever having the time to deliver on this myself.
@asimon-od For now, the workaround for your scenario is to use tuples. Works perfectly although I do understand your request for it to be part of the base API of the library.
Essentially, I'm looking to be able to hand write values for some test parameters while combinatorially populating others. This would allow more control over e.g.
int
values than the existing range options or the veto option proposed in #3.An (albeit useless) toy example:
In this example, the values for
a
andb
are hand-picked, but should be tested for both values ofc
. I assume it may not be possible to build this functionality on top of the existingInlineData
attribute, but supposing a new keyword-style equivalent that replaced any omitted parameters with their combinatorial definitions, it could look like this:and could also support cases where we don't want the combinatorics a la #3
The text was updated successfully, but these errors were encountered: