-
-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
I assumed that TUnit0001 would work with ITypedDataSource, and thus TypedDataSourceAttribute. However, the following, obviously wrong example, compiles just fine:
public class Playground
{
[Test]
[CustomData]
public void Test(string asdf, int notExistingParameter)
{
Assert.Fail("foobar");
}
}
[AttributeUsage(AttributeTargets.Method)]
public class CustomData : TypedDataSourceAttribute<string>
{
public override async IAsyncEnumerable<Func<Task<string>>> GetTypedDataRowsAsync(
DataGeneratorMetadata dataGeneratorMetadata
)
{
await Task.Yield();
yield return () => Task.FromResult("one");
}
}Expected Behavior
I expected that it would not compile and show an error, since the typed data source does not method the test method signature.
Actual Behavior
I expected that the TUnit0001 error is shown, as it is shown for a mismatching [Arguments] for example.
Steps to Reproduce
See the code above.
TUnit Version
1.13.40
.NET Version
.NET 10
Operating System
macOS
IDE / Test Runner
JetBrains Rider
Error Output / Stack Trace
Running it with `dotnet test`, the following error is shown:
TUnit.Engine.Exceptions.TestFailedException: ArgumentException: Expected exactly 2 arguments, but got 1Additional Context
No response
IDE-Specific Issue?
- I've confirmed this issue occurs when running via
dotnet testordotnet run, not just in my IDE
Reactions are currently unavailable
Metadata
Metadata
Labels
bugSomething isn't workingSomething isn't working