Esempio n. 1
0
 public void Registration()
 {
     ImportContext context = new ImportContext();
     ThingImporter importer = new ThingImporter();
     context.Register(importer);
     Assert.AreSame(importer, context.FindImporter(typeof(Thing)));
 }
 private static void AssertInStock(Type expected, Type type)
 {
     ImportContext context = new ImportContext();
     IImporter importer = context.FindImporter(type);
     Assert.IsNotNull(importer, "No importer found for {0}", type.FullName);
     Assert.IsInstanceOfType(expected, importer, type.FullName);
 }
Esempio n. 3
0
 public void RegistrationIsPerContext()
 {
     ImportContext context = new ImportContext();
     ThingImporter exporter = new ThingImporter();
     context.Register(exporter);
     context = new ImportContext();
     Assert.AreNotSame(exporter, context.FindImporter(typeof(Thing)));
 }
Esempio n. 4
0
        private static void AssertInStock(Type expected, Type type)
        {
            ImportContext context  = new ImportContext();
            IImporter     importer = context.FindImporter(type);

            Assert.IsNotNull(importer, "No importer found for {0}", type.FullName);
            Assert.IsInstanceOfType(expected, importer, type.FullName);
        }
Esempio n. 5
0
        public void Registration()
        {
            ImportContext context  = new ImportContext();
            ThingImporter importer = new ThingImporter();

            context.Register(importer);
            Assert.AreSame(importer, context.FindImporter(typeof(Thing)));
        }
Esempio n. 6
0
        public void RegistrationIsPerContext()
        {
            ImportContext context  = new ImportContext();
            ThingImporter exporter = new ThingImporter();

            context.Register(exporter);
            context = new ImportContext();
            Assert.AreNotSame(exporter, context.FindImporter(typeof(Thing)));
        }