Skip to content

Commit 16c5546

Browse files
authored
Merge pull request #2410 from akshita31/find_implementation
Integration test for the implementation provider
2 parents ce95719 + b84a156 commit 16c5546

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import * as vscode from "vscode";
7+
import CSharpImplementationProvider from "../../src/features/implementationProvider";
8+
import * as path from "path";
9+
import testAssetWorkspace from "./testAssets/testAssetWorkspace";
10+
import { expect } from "chai";
11+
import { activateCSharpExtension } from './integrationHelpers';
12+
13+
suite(`${CSharpImplementationProvider.name}: ${testAssetWorkspace.description}`, () => {
14+
let fileUri: vscode.Uri;
15+
16+
suiteSetup(async () => {
17+
await testAssetWorkspace.restore();
18+
await activateCSharpExtension();
19+
20+
let fileName = 'implementation.cs';
21+
let projectDirectory = testAssetWorkspace.projects[0].projectDirectoryPath;
22+
fileUri = vscode.Uri.file(path.join(projectDirectory, fileName));
23+
await vscode.commands.executeCommand("vscode.open", fileUri);
24+
});
25+
26+
suiteTeardown(async () => {
27+
await testAssetWorkspace.cleanupWorkspace();
28+
});
29+
30+
test("Returns the implementation", async() => {
31+
let implementationList = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeImplementationProvider", fileUri, new vscode.Position(4, 22)));
32+
expect(implementationList.length).to.be.equal(2);
33+
});
34+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using System;
2+
3+
namespace minimal
4+
{
5+
public class BaseClass {}
6+
public class SomeClass : BaseClass {}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using System;
2+
3+
namespace minimal
4+
{
5+
public class BaseClass {}
6+
public class SomeClass : BaseClass {}
7+
}

0 commit comments

Comments
 (0)