Skip to content

Commit

Permalink
Merge pull request dotnet#2410 from akshita31/find_implementation
Browse files Browse the repository at this point in the history
Integration test for the implementation provider
  • Loading branch information
akshita31 authored Jul 19, 2018
2 parents ce95719 + b84a156 commit 16c5546
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/integrationTests/implementationProvider.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as vscode from "vscode";
import CSharpImplementationProvider from "../../src/features/implementationProvider";
import * as path from "path";
import testAssetWorkspace from "./testAssets/testAssetWorkspace";
import { expect } from "chai";
import { activateCSharpExtension } from './integrationHelpers';

suite(`${CSharpImplementationProvider.name}: ${testAssetWorkspace.description}`, () => {
let fileUri: vscode.Uri;

suiteSetup(async () => {
await testAssetWorkspace.restore();
await activateCSharpExtension();

let fileName = 'implementation.cs';
let projectDirectory = testAssetWorkspace.projects[0].projectDirectoryPath;
fileUri = vscode.Uri.file(path.join(projectDirectory, fileName));
await vscode.commands.executeCommand("vscode.open", fileUri);
});

suiteTeardown(async () => {
await testAssetWorkspace.cleanupWorkspace();
});

test("Returns the implementation", async() => {
let implementationList = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeImplementationProvider", fileUri, new vscode.Position(4, 22)));
expect(implementationList.length).to.be.equal(2);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System;

namespace minimal
{
public class BaseClass {}
public class SomeClass : BaseClass {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System;

namespace minimal
{
public class BaseClass {}
public class SomeClass : BaseClass {}
}

0 comments on commit 16c5546

Please sign in to comment.