Пример #1
0
        public void TestExistenceExistant()
        {
            Repos MyRepos = new Repos();

            MyRepos.Organize("REP1");
            // Vérification de la non levée l'exception DirectoryNotFoundExeption
        }
Пример #2
0
        public void TestRepertoireInexistant()
        {
            if (System.IO.Directory.Exists("REP1"))
            {
                System.IO.Directory.Delete("REP1", true);
            }
            Assert.IsFalse(System.IO.Directory.Exists("REP1"));
            Repos MyRepos = new Repos();

            MyRepos.Organize("REP1");
            // Vérification de la levée l'exception DirectoryNotFoundException
        }
Пример #3
0
        public void TestCréationdusousRepertoire2()
        {
            if (!System.IO.Directory.Exists("REP1/TXT"))
            {
                System.IO.Directory.CreateDirectory("REP1/TXT");
            }
            System.IO.File.CreateText("REP1/TXT/adel.txt").Close();

            System.IO.File.CreateText("REP1/toto.txt").Close();
            Repos MyRepos = new Repos();

            MyRepos.Organize("REP1");

            Assert.IsTrue(System.IO.Directory.Exists("REP1/TXT"));
            Assert.IsTrue(System.IO.File.Exists("REP1/TXT/adel.txt"));
        }
Пример #4
0
        public void TestDeplacement2Fichiers()
        {
            // ARRANGE

            System.IO.File.CreateText("REP1/test.txt").Close();
            System.IO.File.CreateText("REP1/test1.txt").Close();

            //ACT
            Repos MyRepos = new Repos();

            MyRepos.Organize("REP1");

            //ASSERT
            Assert.IsTrue(System.IO.File.Exists("REP1/TXT/test.txt"));
            Assert.IsTrue(System.IO.File.Exists("REP1/TXT/test1.txt"));
        }
Пример #5
0
        public void TestCréationdusousRepertoire()
        {
            if (System.IO.Directory.Exists("REP1/TXT"))
            {
                System.IO.Directory.Delete("REP1/TXT", true);
            }

            System.IO.File.CreateText("REP1/toto.txt").Close();
            Repos MyRepos = new Repos();

            MyRepos.Organize("REP1");
            //Test
            //RETest
            //ReTest

            Assert.IsTrue(System.IO.Directory.Exists("REP1/TXT"));
        }
Пример #6
0
        public void TestDeplacementExtensionsMajuscules()
        {
            // ARRANGE

            System.IO.File.CreateText("REP1/test.TXT").Close();
            System.IO.File.CreateText("REP1/test1.TxT").Close();
            System.IO.File.CreateText("REP1/test2.tXt").Close();

            //ACT
            Repos MyRepos = new Repos();

            MyRepos.Organize("REP1");

            //ASSERT
            Assert.IsTrue(System.IO.File.Exists("REP1/TXT/test.txt"));
            Assert.IsTrue(System.IO.File.Exists("REP1/TXT/test1.TxT"));
            Assert.IsTrue(System.IO.File.Exists("REP1/TXT/test2.tXt"));
        }
Пример #7
0
        public void TestDeplacementFichierTXTDansunsousRépertoire()
        {
            // ARRANGE

            if (System.IO.Directory.Exists("REP1/SREP"))
            {
                System.IO.Directory.Delete("REP1/SREP", true);
            }
            System.IO.Directory.CreateDirectory("REP1/SREP");
            System.IO.File.CreateText("REP1/SREP/test.txt").Close();

            //ACT
            Repos MyRepos = new Repos();

            MyRepos.Organize("REP1");

            //ASSERT
            Assert.IsTrue(System.IO.File.Exists("REP1/SREP/TXT/test.txt"));
            Assert.IsFalse(System.IO.File.Exists("REP1/SREP/test.txt"));
        }
Пример #8
0
        public void TestDeplacementFichierTXT()
        {
            // ARRANGE

            if (System.IO.File.Exists("REP1/test.txt"))
            {
                System.IO.File.Delete("REP1/test.txt");
            }

            if (System.IO.File.Exists("REP1/TXT/test.txt"))
            {
                System.IO.File.Delete("REP1/TXT/test.txt");
            }
            System.IO.File.CreateText("REP1/test.txt").Close();

            //ACT
            Repos MyRepos = new Repos();

            MyRepos.Organize("REP1");

            //ASSERT
            Assert.IsTrue(System.IO.File.Exists("REP1/TXT/test.txt"));
            Assert.IsFalse(System.IO.File.Exists("REP1/test.txt"));
        }