Skip to content

Commit 6d0dfaa

Browse files
Merge pull request #1478 from AbhitejJohn/mstestsupport
Support to run MSTest based tests
2 parents d92fa4e + 841b9a4 commit 6d0dfaa

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/features/dotnetTest.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,19 @@ export function updateCodeLensForTest(bucket: vscode.CodeLens[], fileName: strin
184184
return;
185185
}
186186

187-
let testFeature = node.Features.find(value => (value.Name == 'XunitTestMethod' || value.Name == 'NUnitTestMethod'));
187+
let testFeature = node.Features.find(value => (value.Name == 'XunitTestMethod' || value.Name == 'NUnitTestMethod' || value.Name == 'MSTestMethod'));
188188
if (testFeature) {
189189
// this test method has a test feature
190-
let testFrameworkName = testFeature.Name == 'XunitTestMethod' ? 'xunit' : 'nunit';
190+
let testFrameworkName = 'xunit';
191+
if(testFeature.Name == 'NunitTestMethod')
192+
{
193+
testFrameworkName = 'nunit';
194+
}
195+
else if(testFeature.Name == 'MSTestMethod')
196+
{
197+
testFrameworkName = 'mstest';
198+
}
199+
191200
bucket.push(new vscode.CodeLens(
192201
toRange(node.Location),
193202
{ title: "run test", command: 'dotnet.test.run', arguments: [testFeature.Data, fileName, testFrameworkName] }));

0 commit comments

Comments
 (0)