Exemple #1
0
        public void RetrievePluginAssembly_InvalidFilename(string fn)
        {
            IGlobalSettingsStorageProviderV40 prov = GetProvider();

            //Collectors.SettingsProvider = prov;

            prov.RetrievePluginAssembly(fn);
        }
Exemple #2
0
        public void RetrievePluginAssembly_InexistentFilename()
        {
            IGlobalSettingsStorageProviderV40 prov = GetProvider();

            //Collectors.SettingsProvider = prov;

            Assert.IsNull(prov.RetrievePluginAssembly("Inexistent.dll"), "RetrievePluginAssembly should return null");
        }
Exemple #3
0
        public void StorePluginAssembly_RetrievePluginAssembly_ListPluginAssemblies()
        {
            IGlobalSettingsStorageProviderV40 prov = GetProvider();

            //Collectors.SettingsProvider = prov;

            byte[] stuff = new byte[50];
            for (int i = 0; i < stuff.Length; i++)
            {
                stuff[i] = (byte)i;
            }

            Assert.AreEqual(0, prov.ListPluginAssemblies().Length, "Wrong length");

            Assert.IsTrue(prov.StorePluginAssembly("Plugin.dll", stuff), "StorePluginAssembly should return true");

            string[] asms = prov.ListPluginAssemblies();
            Assert.AreEqual(1, asms.Length, "Wrong length");
            Assert.AreEqual("Plugin.dll", asms[0], "Wrong assembly name");

            byte[] output = prov.RetrievePluginAssembly("Plugin.dll");
            Assert.AreEqual(stuff.Length, output.Length, "Wrong content length");
            for (int i = 0; i < stuff.Length; i++)
            {
                Assert.AreEqual(stuff[i], output[i], "Wrong content");
            }

            stuff = new byte[30];
            for (int i = stuff.Length - 1; i >= 0; i--)
            {
                stuff[i] = (byte)i;
            }

            Assert.IsTrue(prov.StorePluginAssembly("Plugin.dll", stuff), "StorePluginAssembly should return true");

            output = prov.RetrievePluginAssembly("Plugin.dll");
            Assert.AreEqual(stuff.Length, output.Length, "Wrong content length");
            for (int i = 0; i < stuff.Length; i++)
            {
                Assert.AreEqual(stuff[i], output[i], "Wrong content");
            }
        }