Example #1
0
        public void FailureImportForNoRequiredMetadatForExportCollection()
        {
            CompositionContainer container = ContainerFactory.Create();

            MyImporterWithExportCollection importer;
            CompositionBatch batch = new CompositionBatch();

            batch.AddPart(new MyExporterWithNoMetadata());
            batch.AddPart(importer = new MyImporterWithExportCollection());

            throw new NotImplementedException();

            //var result = container.TryCompose();

            //Assert.True(result.Succeeded, "Composition should be successful because collection import is not required");
            //Assert.Equal(1, result.Issues.Count);
            //Assert.True(result.Issues[0].Description.Contains("Foo"), "The missing required metadata is 'Foo'");
        }
Example #2
0
        public void FailureImportForNoRequiredMetadatForExportCollection()
        {
            CompositionContainer container = ContainerFactory.Create();

            MyImporterWithExportCollection importer;
            CompositionBatch batch = new CompositionBatch();
            batch.AddPart(new MyExporterWithNoMetadata());
            batch.AddPart(importer = new MyImporterWithExportCollection());

            Assert.Fail();

            //var result = container.TryCompose();

            //Assert.IsTrue(result.Succeeded, "Composition should be successful because collection import is not required");
            //Assert.AreEqual(1, result.Issues.Count, "There should be one issue reported");
            //Assert.IsTrue(result.Issues[0].Description.Contains("Foo"), "The missing required metadata is 'Foo'");
        }