Ejemplo n.º 1
0
 public void Register(IBootstrapServiceContainer serviceContainer)
 {
     if (serviceContainer == null)
     {
         throw new ArgumentNullException("serviceContainer");
     }
     serviceContainer.Register <IRegistration>(this);
     serviceContainer.Register <IComponentAssemblyProvider>(this);
 }
        public void ServiceRegistration()
        {
            _bootstrapServiceContainer.Register <ITestService>(new TestServiceDefaultCtor());
            var testService1 = _bootstrapServiceContainer.Get <ITestService>();

            Assert.That(testService1, Is.Not.Null);
            var testService2 = _bootstrapServiceContainer.Get <ITestService>();

            Assert.That(testService2, Is.Not.Null);
            Assert.That(testService1, Is.SameAs(testService2));
        }
Ejemplo n.º 3
0
 public void Register(IBootstrapServiceContainer serviceContainer)
 {
     // Register bootstrap service with given type
     serviceContainer.Register(_bootstrapService);
 }