Skip to content

Commit

Permalink
fixed bug and added test (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymondd authored Jan 19, 2017
1 parent 87d00b4 commit ab1c892
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/controllers/QueryRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export default class QueryRunner {
// Update internal state to show that we're executing the query
this._resultLineOffset = selection ? selection.startLine : 0;
this._isExecuting = true;
this._totalElapsedMilliseconds = 0;
this._statusView.executingQuery(this.uri);

// Send the request to execute the query
Expand Down Expand Up @@ -368,4 +369,8 @@ export default class QueryRunner {
public _setHasCompleted(): void {
this._hasCompleted = true;
}

get totalElapsedMilliseconds(): number {
return this._totalElapsedMilliseconds;
}
}
3 changes: 2 additions & 1 deletion test/queryRunner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ suite('Query Runner tests', () => {
testStatusView.verify<void>(x => x.executingQuery(standardUri), TypeMoq.Times.once());
testVscodeWrapper.verify<void>(x => x.logToOutputChannel(TypeMoq.It.isAnyString()), TypeMoq.Times.once());

// ... The query runner should indicate that it is running a query
// ... The query runner should indicate that it is running a query and elapsed time should be set to 0
assert.equal(queryRunner.isExecutingQuery, true);
assert.equal(queryRunner.totalElapsedMilliseconds, 0);
});
});

Expand Down

0 comments on commit ab1c892

Please sign in to comment.