예제 #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"));
        }