This ought to be possible - and I think it might be possible somehow using Constraints, but they seem to only take one variable as input, which fails.
Here's the simplest example I've run into:
- I have an object with size (i.e. a 2D variable)
- I need to show it's partly off-screen
- This happens if x is outside a range OR y is outside a range
- ... I can't see how to achieve that in NUnit (without throwing away critical info)
It seems that NUnit fundamentally doesn't support anything other than 1-dimensional problems, which would be absurd, so I must be missing something here. But the only methods I can find all only work with 1-d inputs.
Things I've thought of ... but don't work:
i. Assert.True( A | B ) - useless: it throws away all the "expected" info and generates such weak messages that there's essentially no point using a testing framework here
ii. Assert.Or - doesn't allow multiple variables, so you can test "X is 3, or 4, or 5", but you cannot test "X is 3, or Y is 4"
iii. Writing custom assertions for a Tuple<A,B> - but then it goes horribly wrong when you get to "greater than" ... is "<A,B> greater than <C,D>" is a non-trivial question and ends up with code that's vastly confusing and I can guarantee someone will misunerstand and misapply it in future (probably me :))