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); }
public void RegistrationIsPerContext() { ImportContext context = new ImportContext(); ThingImporter exporter = new ThingImporter(); context.Register(exporter); context = new ImportContext(); Assert.AreNotSame(exporter, context.FindImporter(typeof(Thing))); }