Esempio n. 1
0
        public void TestMethod1()
        {
            ServeurPlugin sp = new ServeurPlugin();

            PluginModel p = new PluginModel("PluginTest3", "Test3", "7.1.3.5", "Ceci est un test", "/test", true);
            IList<String> l = new List<String>();
            l.Add("contenudufichier");
            File.WriteAllLines("Test3", l);
            sp.AddPlugin(p, File_DAL.getPlugin("Test3"));
        }
Esempio n. 2
0
        public void TestDownloadPlugin()
        {
            ServeurPlugin sp = new ServeurPlugin();

            PluginModel p = new PluginModel("id", "Test3", "7.1.3.5", "Ceci est un test", "/test", true);
            IList<String> l = new List<String>();
            l.Add("totovaalaplage");
            File.WriteAllLines("testDownload", l);
            MemoryStream initStream = File_DAL.getPlugin("testDownload");
            sp.AddPlugin(p, initStream);

            MemoryStream stream = sp.DownloadPlugin("Test3_7.1.3.5");
            Assert.AreEqual(initStream.Length, stream.Length);
            int count = 0;
            while (count < stream.Length)
            {
                Assert.AreEqual(initStream.ReadByte(), stream.ReadByte());
                count++;
            }
        }