TheoryAttribute does not work with generic methods
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.6k
- Forks
- 766
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 24
Description
Setting: NUnit 2.5.3, Console runner, .NET 3.5
TheoryAttribute does not work with generics:
[Datapoint]
public double[,] Array2X2 = new double[,] { { 1, 0 }, { 0, 1 } };
[Theory]
public void TestForArbitraryArray(T[,] array)
{
// ...
}
NUnit gives a warning saying "No arguments were provided".
See discussion at https://bugs.launchpad.net/nunit-3.0/+bug/537914
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the generic Theory example with NUnit 2.5.3 using the console runner and the shown Datapoint and Theory declarations. Start by tracing how TheoryAttribute discovers arguments for generic methods; done means the example no longer reports "No arguments were provided" and executes with the supplied datapoint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100