static void Main(string[] args) { var loader = new PluginLoader(); loader.AddAssembly(Assembly.GetExecutingAssembly()); var id = 1; loader.LoadTypesWithBase <Plugin>(p => { p.Id = id++; }); }
public void Test_Discovering_Comparers_Is_Implemented() { var mockIo = Substitute.For <IIO>(); var pl = new PluginLoader(mockIo); pl.AddAssembly(Assembly.GetExecutingAssembly()); var comparers = pl.DiscoverAndInitializePlugins(); Assert.That(comparers, Has.Count.EqualTo(1)); Assert.That(comparers.First().GetType(), Is.EqualTo(typeof(DummyComparer))); }