Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Bug]: MethodDataSourceAttribute.Factory is incorrect #5834

Copy link
Copy link

Description

@kzrnm
Issue body actions

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?

  • I've confirmed this issue occurs when running via dotnet test or dotnet run, not just in my IDE
Reactions are currently unavailable

Metadata

Metadata

Labels

bugSomething isn't workingSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.