示例#1
0
        public void SelectiveImportBasedOnMetadataForExportCollection()
        {
            CompositionContainer container = ContainerFactory.Create();

            MyImporterWithExportCollectionForSelectiveImport importer;
            CompositionBatch batch = new CompositionBatch();

            batch.AddPart(new MyExporterWithNoMetadata());
            batch.AddPart(new MyExporterWithMetadata());
            batch.AddPart(importer = new MyImporterWithExportCollectionForSelectiveImport());

            Assert.Fail();

            //var result = container.TryCompose();

            //Assert.IsTrue(result.Succeeded, "Composition should be successfull in anyway for collection import");
            //Assert.AreEqual(1, result.Issues.Count, "There should be one issue reported however, about the export who has no required metadata");
            //Assert.IsTrue(result.Issues[0].Description.Contains("Foo"), "The missing required metadata is 'Foo'");
            //Assert.AreEqual(1, importer.ValueInfoCol.Count, "The export with required metadata should get bound");
            //Assert.IsNotNull(importer.ValueInfoCol[0], "The import should really get bound");
        }
示例#2
0
        public void SelectiveImportBasedOnMetadataForExportCollection()
        {
            CompositionContainer container = ContainerFactory.Create();

            MyImporterWithExportCollectionForSelectiveImport importer;
            CompositionBatch batch = new CompositionBatch();

            batch.AddPart(new MyExporterWithNoMetadata());
            batch.AddPart(new MyExporterWithMetadata());
            batch.AddPart(importer = new MyImporterWithExportCollectionForSelectiveImport());

            throw new NotImplementedException();

            //var result = container.TryCompose();

            //Assert.True(result.Succeeded, "Composition should be successfull in anyway for collection import");
            //Assert.Equal(1, result.Issues.Count);
            //Assert.True(result.Issues[0].Description.Contains("Foo"), "The missing required metadata is 'Foo'");
            //Assert.Equal(1, importer.ValueInfoCol.Count);
            //Assert.NotNull(importer.ValueInfoCol[0], "The import should really get bound");
        }
示例#3
0
        public void SelectiveImportBasedOnMetadataForExportCollection()
        {
            CompositionContainer container = ContainerFactory.Create();

            MyImporterWithExportCollectionForSelectiveImport importer;
            CompositionBatch batch = new CompositionBatch();
            batch.AddPart(new MyExporterWithNoMetadata());
            batch.AddPart(new MyExporterWithMetadata());
            batch.AddPart(importer = new MyImporterWithExportCollectionForSelectiveImport());

            Assert.Fail();

            //var result = container.TryCompose();

            //Assert.IsTrue(result.Succeeded, "Composition should be successfull in anyway for collection import");
            //Assert.AreEqual(1, result.Issues.Count, "There should be one issue reported however, about the export who has no required metadata");
            //Assert.IsTrue(result.Issues[0].Description.Contains("Foo"), "The missing required metadata is 'Foo'");
            //Assert.AreEqual(1, importer.ValueInfoCol.Count, "The export with required metadata should get bound");
            //Assert.IsNotNull(importer.ValueInfoCol[0], "The import should really get bound");
        }