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); }
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(); 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))); }