public void LoadAndRemoveAllPlugins()
        {
            var col = new PluginsCollection();
            var plug = col.LoadPlugin(TEST_PLUGIN1_ASSEMBLY, TEST_PLUGIN1_FULLNAME);

            Assert.NotNull(plug);
            Assert.True(col.Any());

            col.StopAndRemoveAll();
            Assert.Equal(col.Count(), 0);
        }
Beispiel #2
0
        public void LoadAndRemoveAllPlugins()
        {
            var col  = new PluginsCollection();
            var plug = col.LoadPlugin(TEST_PLUGIN1_ASSEMBLY, TEST_PLUGIN1_FULLNAME);

            Assert.NotNull(plug);
            Assert.True(col.Any());

            col.StopAndRemoveAll();
            Assert.Equal(col.Count(), 0);
        }
Beispiel #3
0
        public void LoadAndRemovePluginAndGCCollect()
        {
            var col  = new PluginsCollection();
            var plug = col.LoadPlugin(TEST_PLUGIN1_ASSEMBLY, TEST_PLUGIN1_FULLNAME);

            Assert.NotNull(plug);
            Assert.True(col.Any());

            col.RemovePlugin(plug);
            Assert.Equal(col.Count(), 0);

            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();

            Assert.Throws <AppDomainUnloadedException>(() => plug.GetFields());
            Assert.Throws <AppDomainUnloadedException>(() => plug.Close());
        }
        public void LoadAndRemovePluginAndGCCollect()
        {
            var col = new PluginsCollection();
            var plug = col.LoadPlugin(TEST_PLUGIN1_ASSEMBLY, TEST_PLUGIN1_FULLNAME);

            Assert.NotNull(plug);
            Assert.True(col.Any());

            col.RemovePlugin(plug);
            Assert.Equal(col.Count(), 0);

            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();

            Assert.Throws<AppDomainUnloadedException>(() => plug.GetFields());
            Assert.Throws<AppDomainUnloadedException>(() => plug.Close());
        }