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.º 2
0
 /// <summary>
 /// Retrieves instance of registration service.
 /// </summary>
 /// <returns><see cref="IRegistration"/> implementation.</returns>
 public static IRegistration GetRegistration(this IBootstrapServiceContainer container)
 {
     return(container.Get <IRegistration>());
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Retrieves instance of metainfo container service.
 /// </summary>
 /// <returns><see cref="IMetaInfoContainer"/> implementation.</returns>
 public static IMetaInfoContainer GetMetaInfoContainer(this IBootstrapServiceContainer container)
 {
     return(container.Get <IMetaInfoContainer>());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Retrieves instance of component assembly provider service.
 /// </summary>
 /// <returns><see cref="IComponentAssemblyProvider"/> implementation.</returns>
 public static IComponentAssemblyProvider GetComponentAssemblyProvider(this IBootstrapServiceContainer container)
 {
     return(container.Get <IComponentAssemblyProvider>());
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Retrieves instance of call parameter handler service.
 /// </summary>
 /// <returns><see cref="ICallParameterHandler"/> implementation.</returns>
 public static ICallParameterHandler GetCallParameterHandler(this IBootstrapServiceContainer container)
 {
     return(container.Get <ICallParameterHandler>());
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Retrieves instance of logger service.
 /// </summary>
 /// <returns><see cref="ILogger"/> implementation.</returns>
 public static ILogger GetLogger(this IBootstrapServiceContainer container)
 {
     return(container.Get <ILogger>());
 }