コード例 #1
0
        public void RegisteredModuleServiceInstanceGetsAddedToModuleServicesCollection()
        {
            CompositionContainer rootContainer  = new TestableRootCompositionContainer();
            CompositionContainer childContainer = rootContainer.Containers.AddNew <CompositionContainer>();
            ServiceInfo          info           = new ServiceInfo(typeof(IMockService), typeof(MockService), ServiceScope.Module);
            ServiceLoaderService serviceLoader  = new ServiceLoaderService();

            serviceLoader.Load(childContainer, info);

            Assert.IsTrue(childContainer.Services.Contains(typeof(IMockService)));
            Assert.AreEqual(typeof(MockService), childContainer.Services.Get <IMockService>(true).GetType());
        }
コード例 #2
0
        public void NullCompositionContainerThrows()
        {
            ServiceLoaderService serviceLoader = new ServiceLoaderService();

            serviceLoader.Load(null, new ServiceInfo[0]);
        }