diff --git a/src/OmniSharp.DotNetTest/TestFrameworks/NUnitTestFramework.cs b/src/OmniSharp.DotNetTest/TestFrameworks/NUnitTestFramework.cs index 591fe564d8..aae7488fed 100644 --- a/src/OmniSharp.DotNetTest/TestFrameworks/NUnitTestFramework.cs +++ b/src/OmniSharp.DotNetTest/TestFrameworks/NUnitTestFramework.cs @@ -10,7 +10,8 @@ protected override bool IsTestAttributeName(string typeName) { return typeName == "NUnit.Framework.TestAttribute" || typeName == "NUnit.Framework.TestCaseAttribute" - || typeName == "NUnit.Framework.TestCaseSourceAttribute"; + || typeName == "NUnit.Framework.TestCaseSourceAttribute" + || typeName == "NUnit.Framework.Theory"; } } } diff --git a/test-assets/test-projects/NUnitTestProject/TestProgram.cs b/test-assets/test-projects/NUnitTestProject/TestProgram.cs index f70d2165bd..8e7e162157 100644 --- a/test-assets/test-projects/NUnitTestProject/TestProgram.cs +++ b/test-assets/test-projects/NUnitTestProject/TestProgram.cs @@ -86,4 +86,17 @@ public void M() } } + + [TestFixture(typeof(int))] + public class TheorySampleTestsGeneric + { + [Datapoint] + public int[] ArrayInt = { 0, 1, 2, 3 }; + + [Theory] + public void TestGenericForArbitraryArray(T[] array) + { + Assert.That(array.Length, Is.EqualTo(4)); + } + } } diff --git a/tests/OmniSharp.DotNetTest.Tests/RunTestFacts.cs b/tests/OmniSharp.DotNetTest.Tests/RunTestFacts.cs index 7de1a84c62..359bd7ac49 100644 --- a/tests/OmniSharp.DotNetTest.Tests/RunTestFacts.cs +++ b/tests/OmniSharp.DotNetTest.Tests/RunTestFacts.cs @@ -222,6 +222,18 @@ public async Task RunNunitTypedTestRunsTwice() Assert.Equal(2, response.Results.Length); } + [Fact] + public async Task RunNunitTheoryTest() + { + var response = await RunDotNetTestAsync( + NUnitTestProject, + methodName: "Main.Test.TheorySampleTestsGeneric`1.TestGenericForArbitraryArray", + testFramework: "nunit", + shouldPass: true); + + Assert.Single(response.Results); + } + [Fact] public async Task RunMSTestTest() {