FindExporter() public méthode

public FindExporter ( Type type ) : IExporter
type System.Type
Résultat IExporter
Exemple #1
0
 public void Registration()
 {
     ExportContext context = new ExportContext();
     ThingExporter exporter = new ThingExporter();
     context.Register(exporter);
     Assert.AreSame(exporter, context.FindExporter(typeof(Thing)));
 }
 private static void AssertInStock(Type expected, Type type)
 {
     ExportContext context = new ExportContext();
     ITypeExporter exporter = context.FindExporter(type);
     Assert.IsNotNull(exporter, "No exporter found for {0}", type.FullName);
     Assert.AreSame(type, exporter.InputType, "{0} reported {1} when expecting {2}.", exporter, exporter.InputType, type);
     Assert.IsInstanceOfType(expected, exporter, type.FullName);
 }
Exemple #3
0
        public void Registration()
        {
            ExportContext context  = new ExportContext();
            ThingExporter exporter = new ThingExporter();

            context.Register(exporter);
            Assert.AreSame(exporter, context.FindExporter(typeof(Thing)));
        }
Exemple #4
0
        private static void AssertInStock(Type expected, Type type)
        {
            ExportContext context  = new ExportContext();
            IExporter     exporter = context.FindExporter(type);

            Assert.IsNotNull(exporter, "No exporter found for {0}", type.FullName);
            Assert.AreSame(type, exporter.InputType, "{0} reported {1} when expecting {2}.", exporter, exporter.InputType, type);
            Assert.IsInstanceOfType(expected, exporter, type.FullName);
        }
        public void RegistrationIsPerContext()
        {
            var context  = new ExportContext();
            var exporter = new ThingExporter();

            context.Register(exporter);
            context = new ExportContext();
            Assert.AreNotSame(exporter, context.FindExporter(typeof(Thing)));
        }