Added goToDef count verification in fourslash facilities.

This commit is contained in:
Daniel Rosenwasser 2014-12-17 14:21:35 -08:00
parent eaaf7ad468
commit af4d7d3ff4
2 changed files with 12 additions and 0 deletions

View file

@ -1515,6 +1515,14 @@ module FourSlash {
}
}
public verifyDefinitionsCount(negative: boolean, expectedCount: number) {
var assertFn = negative ? assert.notEqual : assert.equal;
var definitions = this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition);
assertFn(definitions.length, expectedCount, this.messageAtLastKnownMarker("Definitions Count"));
}
public verifyDefinitionsName(negative: boolean, expectedName: string, expectedContainerName: string) {
this.taoInvalidReason = 'verifyDefinititionsInfo NYI';

View file

@ -217,6 +217,10 @@ module FourSlashInterface {
FourSlash.currentTestState.verifyQuickInfoExists(this.negative);
}
public definitionCountIs(expectedCount: number) {
FourSlash.currentTestState.verifyDefinitionsCount(this.negative, expectedCount);
}
public definitionLocationExists() {
FourSlash.currentTestState.verifyDefinitionLocationExists(this.negative);
}