public void TestExistenceExistant() { Repos MyRepos = new Repos(); MyRepos.Organize("REP1"); // Vérification de la non levée l'exception DirectoryNotFoundExeption }
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 }
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")); }
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")); }
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")); }
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")); }
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")); }
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")); }