public void SelectiveImportBySTM_Export() { CompositionContainer container = ContainerFactory.Create(); CompositionBatch batch = new CompositionBatch(); MyImporterWithExportStronglyTypedMetadata importer; batch.AddPart(new MyExporterWithNoMetadata()); batch.AddPart(new MyExporterWithMetadata()); batch.AddPart(importer = new MyImporterWithExportStronglyTypedMetadata()); Assert.Fail(); //var result = container.TryCompose(); //Assert.IsTrue(result.Succeeded, "Composition should be successful becasue one of two exports does not have required metadata"); //Assert.AreEqual(1, result.Issues.Count, "There should be an issue reported about the export who has no required metadata"); //Assert.IsNotNull(importer.ValueInfo, "The valid export should really get bound"); //Assert.AreEqual("Bar", importer.ValueInfo.Metadata.Foo, "The value of metadata 'Foo' should be 'Bar'"); }
public void SelectiveImportBySTM_Export() { CompositionContainer container = ContainerFactory.Create(); CompositionBatch batch = new CompositionBatch(); MyImporterWithExportStronglyTypedMetadata importer; batch.AddPart(new MyExporterWithNoMetadata()); batch.AddPart(new MyExporterWithMetadata()); batch.AddPart(importer = new MyImporterWithExportStronglyTypedMetadata()); throw new NotImplementedException(); //var result = container.TryCompose(); //Assert.True(result.Succeeded, "Composition should be successful becasue one of two exports does not have required metadata"); //Assert.Equal(1, result.Issues.Count); //Assert.NotNull(importer.ValueInfo, "The valid export should really get bound"); //Assert.Equal("Bar", importer.ValueInfo.Metadata.Foo); }
public void SelectiveImportBySTM_Export() { CompositionContainer container = ContainerFactory.Create(); CompositionBatch batch = new CompositionBatch(); MyImporterWithExportStronglyTypedMetadata importer; batch.AddPart(new MyExporterWithNoMetadata()); batch.AddPart(new MyExporterWithMetadata()); batch.AddPart(importer = new MyImporterWithExportStronglyTypedMetadata()); Assert.Fail(); //var result = container.TryCompose(); //Assert.IsTrue(result.Succeeded, "Composition should be successful becasue one of two exports does not have required metadata"); //Assert.AreEqual(1, result.Issues.Count, "There should be an issue reported about the export who has no required metadata"); //Assert.IsNotNull(importer.ValueInfo, "The valid export should really get bound"); //Assert.AreEqual("Bar", importer.ValueInfo.Metadata.Foo, "The value of metadata 'Foo' should be 'Bar'"); }