Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var loader = new PluginLoader();

            loader.AddAssembly(Assembly.GetExecutingAssembly());

            var id = 1;

            loader.LoadTypesWithBase <Plugin>(p =>
            {
                p.Id = id++;
            });
        }
Ejemplo n.º 2
0
        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)));
        }