public void FeatureContainerReturnsSwitchableAndUnswitchableFeatures() { // TODO: Ensure that standard IOC tests (elsewhere) require both parent and child registrations to be returned var containerFeature = new ContainerFeature<StructureMapContainer>(); var application = CreateApplication(containerFeature, _nonSwitchable, _switchableOff, _switchableOn); var request = Mock.Of<IRequest>(); var features = application.Features.GetFeatureSet(request); var services = features.Container.GetAll<IService>(); CollectionAssert.AreEquivalent( new string[] { "On", "NonSwitchable" }, services.Select(x => x.Name) ); }
public void AddFeature(ContainerFeature feature) { Features.Add(feature); }
public void ApplicationContainerReturnsOnlyNonSwitchableServices() { var containerFeature = new ContainerFeature<StructureMapContainer>(); var application = CreateApplication(containerFeature, _nonSwitchable, _switchableOff, _switchableOn); var services = application.Container.GetAll<IService>(); Assert.AreEqual("NonSwitchable", services.Single().Name); }
public ContainerSpecification(ContainerFeature required) { requiredFeature = required; }