-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error NUnit1029: The TestCaseSource provides '1' parameter(s), but the Test method expects '1' parameter(s) #685
Comments
Thanks for the report @richardissimo. I cannot reproduce the problem. Do the problem still appear if you clear VS cache and the |
I have the same problem. Even after running |
I wasn't able to reproduce it with @richardissimo's code. using NUnit.Framework;
namespace None;
public class Class1
{
private static IEnumerable<string> TestSettings => ["1"];
[CancelAfter(20_000),TestCaseSource(nameof(TestSettings))]
public static void Test1(string name) { }
} <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>12.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.0.0" />
</ItemGroup>
</Project> Triggers: |
I apologise, I can confirm my test has a CancelAfterAttribute - I hadn't spotted that was related; but I can confirm that by removing the CancelAfter attribute, the complaint about TestCaseSource attribute goes away, so it is the combination of CancelAfter with TestCaseSource. |
I think it was this one: #678. |
It is true that |
I'll get a release out as quickly as possible, but I'm busy all day tomorrow, so I guess it will be Thursday. |
Just updated NUnit.Analyzers from 3.10.0 to 4.0.0, and now getting
Example code:
EDIT: apologies, it has become apparent that the following line was relevant to the problem, insert the following before the TestCaseSource line:
[CancelAfter(30000)]
The text was updated successfully, but these errors were encountered: