-
|
In NUnit it is possible to run tests against all possible values - passing enum or boolean as a parameter, and this would generate test cases against every value defined in the type. Is there such a way in TUnit? E.g. public enum MyEnum
{
Value1,
Value2,
Value3
}
public class MyTest()
{
[Test]
public async Task Test_MyEnum([Values] MyEnum value)
// ^^^ NUnit concept
{
await Assert.That(CallSomething(value)).IsTrue();
}
}which would run the test against Value1, Value2 and Value3. |
Beta Was this translation helpful? Give feedback.
Answered by
thomhurst
Mar 18, 2026
Replies: 1 comment 1 reply
-
|
Yes in TUnit this is just a bit more explicit. Mark your test with MatrixDataSource And mark your parameter with a Matrix parameter, but without any arguments. If its an enum or Boolean, it should automatically expand all known values |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Lexy2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes in TUnit this is just a bit more explicit.
Mark your test with MatrixDataSource
And mark your parameter with a Matrix parameter, but without any arguments. If its an enum or Boolean, it should automatically expand all known values