Skip to content
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

v2/codestructure does not detect NUnit's Theories #2379

Closed
Melandel opened this issue Apr 9, 2022 · 0 comments · Fixed by #2435
Closed

v2/codestructure does not detect NUnit's Theories #2379

Melandel opened this issue Apr 9, 2022 · 0 comments · Fixed by #2435

Comments

@Melandel
Copy link

Melandel commented Apr 9, 2022

Hello,

Here's a repository I made for reproducing the following observation:

  • v2/codestructure detects a test on the following code:
using NUnit.Framework;

namespace demo.omnisharpvim.bug.nunitTheory
{
	public enum Color { Blue, White, Red }
	public class Tests
	{

// Logs show the following properties for the method Test1 below:
//  "Properties": {
//    "testMethodName": "demo.omnisharpvim.bug.nunitTheory.Tests.Test1",
//    "accessibility": "public",
//     "testFramework": "nunit",
//     "static": false
//  }
		[TestCase(Color.Blue)]
		[TestCase(Color.White)]
		[TestCase(Color.Red)]
		public void Test1(Color color)
		{
			Assert.That(new[] { "Blue", "White", "Red" }, Does.Contain(color.ToString()));
		}
	}
}
  • However, v2/codestructure does not detect the same test when written under the following form:
using NUnit.Framework;

namespace demo.omnisharpvim.bug.nunitTheory
{
	public enum Color { Blue, White, Red }
	public class Tests
	{

// Logs show the following properties for the method Test1 below:
//  "Properties": {
//    "accessibility": "public",
//     "static": false
//  }
		[Theory]
		public void Test1(Color color)
		{
			Assert.That(new[] { "Blue", "White", "Red" }, Does.Contain(color.ToString()));
		}
	}
}

Is this behaviour expected?

@Melandel Melandel changed the title v2/codestructure does not detect nUnit's Theories v2/codestructure does not detect NUnit's Theories Apr 9, 2022
333fred added a commit to 333fred/omnisharp-roslyn that referenced this issue Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants