Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Jan 18, 2019
1 parent 720cdd4 commit 2bf402e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { CommandOption, IDiagnosticsCommandFactory } from '../../../../client/ap
import { DiagnosticCodes } from '../../../../client/application/diagnostics/constants';
import { DiagnosticCommandPromptHandlerServiceId, MessageCommandPrompt } from '../../../../client/application/diagnostics/promptHandler';
import { DiagnosticScope, IDiagnostic, IDiagnosticCommand, IDiagnosticFilterService, IDiagnosticHandlerService, IDiagnosticsService } from '../../../../client/application/diagnostics/types';
import { IApplicationEnvironment } from '../../../../client/common/application/types';
import { IApplicationEnvironment, IWorkspaceService } from '../../../../client/common/application/types';
import { IPlatformService } from '../../../../client/common/platform/types';
import { ICurrentProcess, IPathUtils } from '../../../../client/common/types';
import { EnvironmentVariables } from '../../../../client/common/variables/types';
Expand Down Expand Up @@ -65,6 +65,11 @@ suite('Application Diagnostics - Checks Env Path Variable', () => {
pathUtils.setup(p => p.delimiter).returns(() => pathDelimiter);
serviceContainer.setup(s => s.get(typemoq.It.isValue(IPathUtils)))
.returns(() => pathUtils.object);
const workspaceService = typemoq.Mock.ofType<IWorkspaceService>();
serviceContainer.setup(s => s.get(typemoq.It.isValue(IWorkspaceService)))
.returns(() => workspaceService.object);
workspaceService.setup(w => w.getWorkspaceFolder(typemoq.It.isAny()))
.returns(() => undefined);

diagnosticService = new class extends EnvironmentPathVariableDiagnosticsService {
public _clear() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { CommandOption, IDiagnosticsCommandFactory } from '../../../../client/ap
import { DiagnosticCodes } from '../../../../client/application/diagnostics/constants';
import { DiagnosticCommandPromptHandlerServiceId, MessageCommandPrompt } from '../../../../client/application/diagnostics/promptHandler';
import { DiagnosticScope, IDiagnostic, IDiagnosticCommand, IDiagnosticFilterService, IDiagnosticHandlerService, IDiagnosticsService } from '../../../../client/application/diagnostics/types';
import { IWorkspaceService } from '../../../../client/common/application/types';
import { IServiceContainer } from '../../../../client/ioc/types';

// tslint:disable:max-func-body-length no-any
Expand All @@ -31,6 +32,11 @@ suite('Application Diagnostics - Checks LS not supported', () => {
serviceContainer.setup(s => s.get(TypeMoq.It.isValue(IDiagnosticFilterService))).returns(() => filterService.object);
serviceContainer.setup(s => s.get(TypeMoq.It.isValue(IDiagnosticsCommandFactory))).returns(() => commandFactory.object);
serviceContainer.setup(s => s.get(TypeMoq.It.isValue(IDiagnosticHandlerService), TypeMoq.It.isValue(DiagnosticCommandPromptHandlerServiceId))).returns(() => messageHandler.object);
const workspaceService = TypeMoq.Mock.ofType<IWorkspaceService>();
serviceContainer.setup(s => s.get(TypeMoq.It.isValue(IWorkspaceService)))
.returns(() => workspaceService.object);
workspaceService.setup(w => w.getWorkspaceFolder(TypeMoq.It.isAny()))
.returns(() => undefined);

diagnosticService = new class extends LSNotSupportedDiagnosticService {
public _clear() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
IDiagnosticHandlerService,
IDiagnosticsService
} from '../../../../client/application/diagnostics/types';
import { IApplicationEnvironment } from '../../../../client/common/application/types';
import { IApplicationEnvironment, IWorkspaceService } from '../../../../client/common/application/types';
import { IPlatformService } from '../../../../client/common/platform/types';
import { ICurrentProcess, IPathUtils } from '../../../../client/common/types';
import { EnvironmentVariables } from '../../../../client/common/variables/types';
Expand Down Expand Up @@ -78,6 +78,12 @@ suite('Application Diagnostics - PowerShell Activation', () => {
pathUtils.setup(p => p.delimiter).returns(() => pathDelimiter);
serviceContainer.setup(s => s.get(typemoq.It.isValue(IPathUtils))).returns(() => pathUtils.object);

const workspaceService = typemoq.Mock.ofType<IWorkspaceService>();
serviceContainer.setup(s => s.get(typemoq.It.isValue(IWorkspaceService)))
.returns(() => workspaceService.object);
workspaceService.setup(w => w.getWorkspaceFolder(typemoq.It.isAny()))
.returns(() => undefined);

diagnosticService = new class extends PowerShellActivationHackDiagnosticsService {
public _clear() {
while (BaseDiagnosticsService.handledDiagnosticCodeKeys.length > 0) {
Expand Down

0 comments on commit 2bf402e

Please sign in to comment.