public void PartAOptionalDependsOnPartBAndPartC_PartCGetRecurrected() { var container = new CompositionContainer(new TypeCatalog(typeof(PartA2), typeof(PartB))); var partA = container.GetExportedValue <PartA2>(); Assert.Null(partA.ImportB); Assert.Null(partA.ImportC); var partC = new PartC(); container.ComposeParts(partC); Assert.Equal(partA.ImportB, partC.ImportB); Assert.Equal(partA.ImportC, partC); }
public void PartAOptionalDependsOnPartBAndPartC_PartCGetRecurrected() { var container = new CompositionContainer(new TypeCatalog(typeof(PartA2), typeof(PartB))); var partA = container.GetExportedValue<PartA2>(); Assert.IsNull(partA.ImportB); Assert.IsNull(partA.ImportC); var partC = new PartC(); container.ComposeParts(partC); Assert.AreEqual(partA.ImportB, partC.ImportB); Assert.AreEqual(partA.ImportC, partC); }
public override string ToString() { return(string.Format("{0}.{1}.{2}.{3}", PartA.ToString(), PartB.ToString(), PartC.ToString(), PartD.ToString())); }
public void SetPartC(PartC partC) { this.partC = partC; }