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+ } ) ;
0 commit comments