@@ -6,7 +6,6 @@ import * as chaiAsPromised from 'chai-as-promised';
66import * as TypeMoq from 'typemoq' ;
77import { Disposable , OutputChannel , Uri } from 'vscode' ;
88import { EnumEx } from '../../../client/common/enumUtils' ;
9- import { Installer } from '../../../client/common/installer/installer' ;
109import { ProductInstaller } from '../../../client/common/installer/productInstaller' ;
1110import { IInstallationChannelManager , IModuleInstaller } from '../../../client/common/installer/types' ;
1211import { IDisposableRegistry , ILogger , InstallerResponse , ModuleNamePurpose , Product } from '../../../client/common/types' ;
@@ -19,16 +18,15 @@ suite('Module Installerx', () => {
1918 [ undefined , Uri . file ( 'resource' ) ] . forEach ( resource => {
2019 EnumEx . getNamesAndValues < Product > ( Product ) . forEach ( product => {
2120 let disposables : Disposable [ ] = [ ] ;
22- let installer : Installer ;
21+ let installer : ProductInstaller ;
2322 let installationChannel : TypeMoq . IMock < IInstallationChannelManager > ;
2423 let moduleInstaller : TypeMoq . IMock < IModuleInstaller > ;
2524 let serviceContainer : TypeMoq . IMock < IServiceContainer > ;
26- let productInstallerFactory : ProductInstaller ;
2725 setup ( ( ) => {
2826 serviceContainer = TypeMoq . Mock . ofType < IServiceContainer > ( ) ;
2927 const outputChannel = TypeMoq . Mock . ofType < OutputChannel > ( ) ;
3028
31- installer = new Installer ( serviceContainer . object , outputChannel . object ) ;
29+ installer = new ProductInstaller ( serviceContainer . object , outputChannel . object ) ;
3230
3331 disposables = [ ] ;
3432 serviceContainer . setup ( c => c . get ( TypeMoq . It . isValue ( IDisposableRegistry ) , TypeMoq . It . isAny ( ) ) ) . returns ( ( ) => disposables ) ;
@@ -41,8 +39,6 @@ suite('Module Installerx', () => {
4139 moduleInstaller . setup ( ( x : any ) => x . then ) . returns ( ( ) => undefined ) ;
4240 installationChannel . setup ( i => i . getInstallationChannel ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) ) . returns ( ( ) => Promise . resolve ( moduleInstaller . object ) ) ;
4341 installationChannel . setup ( i => i . getInstallationChannel ( TypeMoq . It . isAny ( ) ) ) . returns ( ( ) => Promise . resolve ( moduleInstaller . object ) ) ;
44-
45- productInstallerFactory = new ProductInstaller ( serviceContainer . object , outputChannel . object ) ;
4642 } ) ;
4743 teardown ( ( ) => {
4844 disposables . forEach ( disposable => {
@@ -91,7 +87,7 @@ suite('Module Installerx', () => {
9187 moduleInstaller . setup ( m => m . installModule ( TypeMoq . It . isValue ( moduleName ) , TypeMoq . It . isValue ( resource ) ) ) . returns ( ( ) => Promise . reject ( new Error ( 'UnitTesting' ) ) ) ;
9288
9389 try {
94- await productInstallerFactory . install ( product . value , resource ) ;
90+ await installer . install ( product . value , resource ) ;
9591 } catch ( ex ) {
9692 moduleInstaller . verify ( m => m . installModule ( TypeMoq . It . isValue ( moduleName ) , TypeMoq . It . isValue ( resource ) ) , TypeMoq . Times . once ( ) ) ;
9793 }
0 commit comments