Description
Attributes can only take literal values as parameters.
Since MethodDataSourceAttribute.Factory is Func<T>, it cannot be specified. Since it cannot be used, it is not documented either.
https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch#arguments-for-attributes
This appears to be an LLM hallucination. #2600
Expected Behavior
Remove MethodDataSourceAttribute.Factory.
Actual Behavior
There is MethodDataSourceAttribute.Factory.
Steps to Reproduce
[MethodDataSource("Data", Factory = default)]
TUnit Version
1.43.11
.NET Version
.NET 9
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
Description
Attributes can only take literal values as parameters.
Since
MethodDataSourceAttribute.FactoryisFunc<T>, it cannot be specified. Since it cannot be used, it is not documented either.https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch#arguments-for-attributes
This appears to be an LLM hallucination. #2600
Expected Behavior
Remove
MethodDataSourceAttribute.Factory.Actual Behavior
There is
MethodDataSourceAttribute.Factory.Steps to Reproduce
TUnit Version
1.43.11
.NET Version
.NET 9
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
dotnet testordotnet run, not just in my IDE