fable-serviceproviderbase
Advanced tools
Comparing version 3.0.5 to 3.0.6
{ | ||
"name": "fable-serviceproviderbase", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"description": "Simple base classes for fable services.", | ||
@@ -5,0 +5,0 @@ "main": "source/Fable-ServiceProviderBase.js", |
@@ -31,4 +31,4 @@ /** | ||
this.log = this.fable.log; | ||
this.servicesMap = this.fable.serviceMap; | ||
this.services = this.fable.services; | ||
this.defaultServices = this.fable.defaultServices; | ||
} | ||
@@ -35,0 +35,0 @@ |
@@ -123,9 +123,9 @@ /** | ||
// The passed-in magic stuff should work too. | ||
tmpSimpleService.log.info(`There were almost ${tmpSimpleService.defaultServices.DataFormat.formatterDollars(9821229.37)} dollars just lying here!`); | ||
tmpSimpleService.log.info(`There were almost ${tmpSimpleService.services.DataFormat.formatterDollars(9821229.37)} dollars just lying here!`); | ||
Expect(testFable.serviceManager.defaultServices['SimpleService']).to.be.an('object'); | ||
Expect(testFable.serviceManager.services['SimpleService']).to.be.an('object'); | ||
testFable.serviceManager.defaultServices.SimpleService.doSomething(); | ||
testFable.serviceManager.services.SimpleService.doSomething(); | ||
Expect(testFable.serviceManager.defaultServices['SimpleService'].Hash).to.equal('SimpleService-123'); | ||
Expect(testFable.serviceManager.services['SimpleService'].Hash).to.equal('SimpleService-123'); | ||
} | ||
@@ -161,3 +161,3 @@ ); | ||
Expect(testFable.services.SimpleService['SimpleService-99']).to.be.an('undefined'); | ||
Expect(testFable.serviceMap.SimpleService['SimpleService-99']).to.be.an('undefined'); | ||
@@ -179,21 +179,21 @@ Expect(tmpService).to.be.an('object'); | ||
testFable.serviceManager.instantiateServiceProvider('SimpleService', {SomeOption: true}); | ||
testFable.serviceManager.defaultServices.SimpleService.doSomething(); | ||
testFable.serviceManager.services.SimpleService.doSomething(); | ||
testFable.serviceManager.instantiateServiceProvider('DatabaseService', {ConnectionString: 'mongodb://localhost:27017/test'}, 'PrimaryConnection'); | ||
Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
testFable.serviceManager.instantiateServiceProvider('DatabaseService', {ConnectionString: 'mongodb://localhost:27017/test'}, 'SecondaryConnection'); | ||
Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
testFable.serviceManager.defaultServices.DatabaseService.connect(); | ||
testFable.serviceManager.defaultServices.DatabaseService.commit('Test Record'); | ||
testFable.serviceManager.services.DatabaseService.connect(); | ||
testFable.serviceManager.services.DatabaseService.commit('Test Record'); | ||
testFable.serviceManager.setDefaultServiceInstantiation('DatabaseService', 'SecondaryConnection'); | ||
testFable.serviceManager.defaultServices.DatabaseService.connect(); | ||
testFable.serviceManager.defaultServices.DatabaseService.commit('Another Test Record'); | ||
testFable.serviceManager.services.DatabaseService.connect(); | ||
testFable.serviceManager.services.DatabaseService.commit('Another Test Record'); | ||
Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('SecondaryConnection'); | ||
Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('SecondaryConnection'); | ||
} | ||
@@ -243,6 +243,6 @@ ); | ||
Expect(testFable.services.MockCoreService['MockCoreService-2']).to.be.an('object'); | ||
Expect(testFable.defaultServices.MockCoreService).to.be.an('object'); | ||
Expect(testFable.serviceMap.MockCoreService['MockCoreService-2']).to.be.an('object'); | ||
Expect(testFable.services.MockCoreService).to.be.an('object'); | ||
Expect(testFable.defaultServices.MockCoreService.fable.log).to.be.an('object'); | ||
Expect(testFable.services.MockCoreService.fable.log).to.be.an('object'); | ||
} | ||
@@ -274,21 +274,21 @@ ) | ||
testFable.serviceManager.instantiateServiceProvider('SimpleService', {SomeOption: true}); | ||
testFable.serviceManager.defaultServices.SimpleService.doSomething(); | ||
testFable.serviceManager.services.SimpleService.doSomething(); | ||
testFable.serviceManager.instantiateServiceProvider('DatabaseService', {ConnectionString: 'mongodb://localhost:27017/test'}, 'PrimaryConnection'); | ||
Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
testFable.serviceManager.instantiateServiceProvider('DatabaseService', {ConnectionString: 'mongodb://localhost:27017/test'}, 'SecondaryConnection'); | ||
Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
testFable.serviceManager.defaultServices.DatabaseService.connect(); | ||
testFable.serviceManager.defaultServices.DatabaseService.commit('Test Record'); | ||
testFable.serviceManager.services.DatabaseService.connect(); | ||
testFable.serviceManager.services.DatabaseService.commit('Test Record'); | ||
Expect(testFable.serviceManager.setDefaultServiceInstantiation('DatabaseService', 'TertiaryConnection')).to.be.false; | ||
testFable.serviceManager.defaultServices.DatabaseService.connect(); | ||
testFable.serviceManager.defaultServices.DatabaseService.commit('Another Test Record'); | ||
testFable.serviceManager.services.DatabaseService.connect(); | ||
testFable.serviceManager.services.DatabaseService.commit('Another Test Record'); | ||
Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection'); | ||
} | ||
@@ -295,0 +295,0 @@ ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17402