forked from microsoft/azuredatastudio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more arc tests (microsoft#11051)
* Add more arc tests * fix errors
- Loading branch information
1 parent
7080e3e
commit ca4ab55
Showing
5 changed files
with
187 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the Source EULA. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
import 'mocha'; | ||
import { Deferred } from '../../common/promise'; | ||
|
||
describe('Deferred', () => { | ||
it('Then should be called upon resolution', function (done): void { | ||
const deferred = new Deferred(); | ||
deferred.then(() => { | ||
done(); | ||
}); | ||
deferred.resolve(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the Source EULA. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as vscode from 'vscode'; | ||
|
||
export class MockInputBox implements vscode.InputBox { | ||
private _value: string = ''; | ||
public get value(): string { | ||
return this._value; | ||
} | ||
public set value(newValue: string) { | ||
this._value = newValue; | ||
if (this._onDidChangeValueCallback) { | ||
this._onDidChangeValueCallback(this._value); | ||
} | ||
} | ||
placeholder: string | undefined; | ||
password: boolean = false; | ||
private _onDidChangeValueCallback: ((e: string) => any) | undefined = undefined; | ||
onDidChangeValue: vscode.Event<string> = (listener) => { | ||
this._onDidChangeValueCallback = listener; | ||
return new vscode.Disposable(() => { }); | ||
}; | ||
private _onDidAcceptCallback: ((e: void) => any) | undefined = undefined; | ||
public onDidAccept: vscode.Event<void> = (listener) => { | ||
this._onDidAcceptCallback = listener; | ||
return new vscode.Disposable(() => { }); | ||
}; | ||
buttons: readonly vscode.QuickInputButton[] = []; | ||
onDidTriggerButton: vscode.Event<vscode.QuickInputButton> = (_) => { return new vscode.Disposable(() => { }); }; | ||
prompt: string | undefined; | ||
validationMessage: string | undefined; | ||
title: string | undefined; | ||
step: number | undefined; | ||
totalSteps: number | undefined; | ||
enabled: boolean = false; | ||
busy: boolean = false; | ||
ignoreFocusOut: boolean = false; | ||
show(): void { } | ||
|
||
hide(): void { | ||
if (this._onDidHideCallback) { | ||
this._onDidHideCallback(); | ||
} | ||
} | ||
private _onDidHideCallback: ((e: void) => any) | undefined = undefined; | ||
onDidHide: vscode.Event<void> = (listener) => { | ||
this._onDidHideCallback = listener; | ||
return new vscode.Disposable(() => { }); | ||
}; | ||
dispose(): void { } | ||
|
||
public async triggerAccept(): Promise<any> { | ||
if (this._onDidAcceptCallback) { | ||
return await this._onDidAcceptCallback(); | ||
} | ||
return undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters