Beispiel #1
0
        public void ExportingStaticMembers(IContainer container)
        {
            var part = container.GetExportedValue <ImportingPart>();

            Assert.Equal(PartWithStaticExports.ExportingProperty, part.ImportOfProperty);
            Assert.Equal(PartWithStaticExports.ExportingField, part.ImportOfField);
            Assert.Equal(PartWithStaticExports.ExportingMethod(), part.ImportOfMethod());
        }
Beispiel #2
0
 public void GetExportsOfExportingStaticMembers(IContainer container)
 {
     Assert.Equal(PartWithStaticExports.ExportingProperty, container.GetExportedValue <string>("Property"));
     Assert.Equal(PartWithStaticExports.ExportingField, container.GetExportedValue <string>("Field"));
     Assert.Equal(PartWithStaticExports.ExportingMethod(), container.GetExportedValue <Func <string> >("Method")());
 }