public void RegisteredGlobalServiceInstanceGetsAddedToGlobalServicesCollection() { CompositionContainer rootContainer = new TestableRootCompositionContainer(); CompositionContainer childContainer = rootContainer.Containers.AddNew<CompositionContainer>(); ServiceInfo info = new ServiceInfo(typeof (IMockService), typeof (MockService), ServiceScope.Global); ServiceLoaderService serviceLoader = new ServiceLoaderService(); serviceLoader.Load(childContainer, info); Assert.IsTrue(rootContainer.Services.Contains(typeof (IMockService))); Assert.AreEqual(typeof (MockService), rootContainer.Services.Get<IMockService>(true).GetType()); }
public void NullCompositionContainerThrows() { ServiceLoaderService serviceLoader = new ServiceLoaderService(); serviceLoader.Load(null, new ServiceInfo[0]); }