-
-
Notifications
You must be signed in to change notification settings - Fork 108
Closed
Description
Hi, i followed documentation https://tunit.dev/docs/experimental/dynamic-tests and wanted to add several tests for single method, example:
`
public class SynchronizationTests
{
[DynamicTestBuilder]
public static void BuildSmokeTests(DynamicTestBuilderContext context)
{
foreach (var type in typeof(SomeType<,,>).Assembly.GetExportedTypes())
{
if (type.IsClass == false || type.IsAbstract == true)
continue;
context.AddTest(new DynamicTest<SynchronizationTests>
{
TestMethod = @class => @class.parametrized_smoke_tests(DynamicTestHelper.Argument<Type>()),
TestMethodArguments = [type]
});
}
}
public async Task parametrized_smoke_tests(Type commandType)
{
//real test
}
}
`
In debugging i see that context.AddTest is invoked mutlitple times (correct), however parametrized_smoke_tests is only called once - with data passed to first call to context.AddTest.
Additionally - it would be nice to provide custom test names (similiar to TestCaseData.SetName https://docs.nunit.org/articles/nunit/writing-tests/TestCaseData.html) to show more meaningful test names in test explorer or console.
Copilot
Metadata
Metadata
Assignees
Labels
No labels