-
Notifications
You must be signed in to change notification settings - Fork 676
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test that reads options and verifies default values
- Loading branch information
1 parent
7eac784
commit 8bb7c30
Showing
3 changed files
with
88 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,56 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { should, expect } from 'chai'; | ||
import { Options } from '../../src/omnisharp/options'; | ||
import { getFakeVsCode, getWorkspaceConfiguration } from './testAssets/Fakes'; | ||
|
||
function getVSCode() { | ||
const vscode = getFakeVsCode(); | ||
|
||
const omnisharpConfig = getWorkspaceConfiguration(); | ||
const csharpConfig = getWorkspaceConfiguration(); | ||
|
||
vscode.workspace.getConfiguration = (section?, resource?) => | ||
{ | ||
if (section === 'omnisharp') | ||
{ | ||
return omnisharpConfig; | ||
} | ||
|
||
if (section === 'csharp') | ||
{ | ||
return csharpConfig; | ||
} | ||
|
||
return undefined; | ||
}; | ||
|
||
return vscode; | ||
} | ||
|
||
suite("CsharpChannelObserver", () => { | ||
suiteSetup(() => should()); | ||
|
||
test('Construct options and verify defaults', () => | ||
{ | ||
const vscode = getVSCode(); | ||
const options = Options.Read(vscode); | ||
|
||
expect(options.path).to.be.null; | ||
options.useGlobalMono.should.equal("auto"); | ||
options.waitForDebugger.should.equal(false); | ||
options.loggingLevel.should.equal("information"); | ||
options.autoStart.should.equal(true); | ||
options.projectLoadTimeout.should.equal(60); | ||
options.maxProjectResults.should.equal(250); | ||
options.useEditorFormattingSettings.should.equal(true); | ||
options.useFormatting.should.equal(true); | ||
options.showReferencesCodeLens.should.equal(true); | ||
options.showTestsCodeLens.should.equal(true); | ||
options.disableCodeActions.should.equal(false); | ||
options.disableCodeActions.should.equal(false); | ||
}); | ||
}); |
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