public void SetUp() { var atom = new Atom( "atom", new[] { new Property("property-name", "property-type", new InheritedPropertyValue("property-name")) }); var parentSpecification = new ContainerSpecification("parent-container"); var grandparentSpecification = new ContainerSpecification("grandparent-container"); grandparentSpecification.AddProperty(new PropertySpecification("property-name", "property-type", string.Empty)); var buildContext = new BuildData(Enumerable.Empty <IContextItem>()); var parent = parentSpecification.Create(); parent.Insert(0, atom); var grandparent = grandparentSpecification.Create(); grandparent.FindOrCreateProperty(new PropertySpecification("property-name", "property-type", string.Empty)); grandparent.Properties.Single().Value = new FixedPropertyValue("property-value"); grandparent.Insert(0, parent); var builder = new Builder(RenderingInstructions.BuildForPreview(), null, null); this.instance = grandparent.Build(builder, new[] { 0 }, buildContext); }
public void SetUp() { var atom = new Atom( "atom", new[] { new Property("property-name", "property-type", new InheritedPropertyValue("property-alias")) }); var containerSpecification = new ContainerSpecification("container"); var container = containerSpecification.Create(); container.Insert(0, atom); var widgetSpecification = new WidgetSpecification( "widget", new[] { new PropertySpecification("property-alias", "property-type", string.Empty) }, new[] { container }); var buildContext = new BuildData(Enumerable.Empty <IContextItem>()); var widget = widgetSpecification.Create(); widget.FindOrCreateProperty(new PropertySpecification("property-alias", "property-type", string.Empty)); widget.Properties.Single().Value = new FixedPropertyValue("property-value"); var builder = new Builder(RenderingInstructions.BuildForPreview(), w => widgetSpecification, null); this.instance = widget.Build(builder, new[] { 0 }, buildContext); }
public void SetUp() { var atom = new Atom( "atom", new[] { new Property("property-name", "property-type", new InheritedPropertyValue("property-alias")) }); var containerSpecification = new ContainerSpecification("container"); var container = containerSpecification.Create(); container.Insert(0, atom); var widgetSpecification = new WidgetSpecification( "widget", new[] { new PropertySpecification("property-alias", "property-type", string.Empty) }, new[] { container }); var buildContext = new BuildData(Enumerable.Empty<IContextItem>()); var widget = widgetSpecification.Create(); widget.FindOrCreateProperty(new PropertySpecification("property-alias", "property-type", string.Empty)); widget.Properties.Single().Value = new FixedPropertyValue("property-value"); var builder = new Builder(RenderingInstructions.BuildForPreview(), w => widgetSpecification, null); this.instance = widget.Build(builder, new[] { 0 }, buildContext); }
public ComponentConfigurer Container(string componentName) { var specification = new ContainerSpecification(componentName); this.configuration.Add(specification); return(new ComponentConfigurer(specification)); }
private void SetUpContainer(string name) { var specification = new ContainerSpecification(name) { ViewName = name }; this.ComponentLibrary.Stub(l => l.Lookup(name)).Return(specification); this.RendererFactory.Stub(f => f.GetContainerRenderer(name)).Return(new DefaultRenderer(specification)); }
public void ContainerIsSafelyPacked() { var specArmored = new ContainerSpecification(ContainerFeature.ARMORED); var specVentilated = new ContainerSpecification(ContainerFeature.VENTILATED); var tnt = new Product(); tnt.Specification = specArmored.And(specVentilated); var drumTNT = new Drum(tnt, 2); var sand = new Product(); var drumSand = new Drum(sand, 4); var biologicalSamples = new Product(); biologicalSamples.Specification = specArmored.Not(); var drumBiologicalSamples = new Drum(biologicalSamples, 2); var ammonia = new Product(); ammonia.Specification = specArmored.Not(); var drumAmmonia = new Drum(ammonia, 2); var drums = new List <Drum>(4) { drumTNT, drumSand, drumBiologicalSamples, drumAmmonia }; var containerCheap = new Container(6); var containerVentilated = new Container(6); containerVentilated.AddFeature(ContainerFeature.VENTILATED); var containerExpensive = new Container(6); containerExpensive.AddFeature(ContainerFeature.ARMORED); var containers = new List <Container>(3) { containerCheap, containerVentilated, containerExpensive }; var packer = new Packer(); packer.Pack(containers, drums); //var drum = new Drum(product1, 5); //var container1 = new Container(5); //container1.AddFeature(ContainerFeature.BLINDADO); //container1.AddDrum(drum); //Assert.True(container1.IsSafelyPacked()); }
public void NewContainerCanAccomodateDrumWithValidSpecification() { var container1 = new Container(4); var specArmored = new ContainerSpecification(ContainerFeature.VENTILATED); var biologicalSamples = new Product(); biologicalSamples.Specification = specArmored.Not(); var drumBiologicalSamples = new Drum(biologicalSamples, 2); Assert.True(container1.CanAccommodate(drumBiologicalSamples)); }
public void SetUp() { var atom = new Atom( "atom", new[] { new Property("property-name", "property-type", new InheritedPropertyValue("property-name")) }); var parentSpecification = new ContainerSpecification("parent-container"); var grandparentSpecification = new ContainerSpecification("grandparent-container"); grandparentSpecification.AddProperty(new PropertySpecification("property-name", "property-type", string.Empty)); var buildContext = new BuildData(Enumerable.Empty<IContextItem>()); var parent = parentSpecification.Create(); parent.Insert(0, atom); var grandparent = grandparentSpecification.Create(); grandparent.FindOrCreateProperty(new PropertySpecification("property-name", "property-type", string.Empty)); grandparent.Properties.Single().Value = new FixedPropertyValue("property-value"); grandparent.Insert(0, parent); var builder = new Builder(RenderingInstructions.BuildForPreview(), null, null); this.instance = grandparent.Build(builder, new[] { 0 }, buildContext); }
public WindsorContainerResolver(ContainerSpecification containerSpecification) { _containerSpecification = containerSpecification; _windsorContainer = new WindsorContainer(); _instanceProvider = new WindsorContainerProvider(_windsorContainer); }
public string Visit(ContainerSpecification containerSpecification) { return("container"); }