Beispiel #1
0
        public void DeactivatingOnePlugInDoesntAffectOthers()
        {
            var manager = new PlugInManager(null, new NullLoggerFactory(), this.CreateServiceProvider());
            var plugIn  = new ExamplePlugIn();

            manager.RegisterPlugInAtPlugInPoint <IExamplePlugIn>(plugIn);
            manager.RegisterPlugIn <IExamplePlugIn, ExamplePlugIn.NestedPlugIn>();
            manager.DeactivatePlugIn <ExamplePlugIn.NestedPlugIn>();
            manager.ActivatePlugIn <ExamplePlugIn.NestedPlugIn>();
            manager.DeactivatePlugIn <ExamplePlugIn.NestedPlugIn>();

            var player  = TestHelper.GetPlayer();
            var command = "test";
            var args    = new MyEventArgs();

            var point = manager.GetPlugInPoint <IExamplePlugIn>();

            point !.DoStuff(player, command, args);
            Assert.That(plugIn.WasExecuted, Is.True);
        }