Esempio n. 1
0
 public void Testchmod5()
 {
     //test chmod 3 (chiffre)
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     Assert.IsFalse(fileCurrent.chmod("-1"));
 }
Esempio n. 2
0
 public void Testchmod7()
 {
     //test chmod 1
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     Assert.IsTrue(fileCurrent.chmod("7"));
 }
Esempio n. 3
0
 public void Testls1()
 {
     //test ls 1
     Repertoire C = new Repertoire("C:", null);
     Fichier filecurrent = C;
     Assert.AreEqual(0, C.ls().Count);
 }
Esempio n. 4
0
 public void Testparent1()
 {
     //test parent 1
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     Assert.AreEqual(null, fileCurrent.getParent());
 }
Esempio n. 5
0
 public void Testname1()
 {
     //test name 1
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     Assert.AreEqual(C.Nom, fileCurrent.getName());
 }
Esempio n. 6
0
 public void Testchmod2()
 {
     //test chmod 2 (lettre)
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     Assert.IsFalse(fileCurrent.chmod("testfalse"));
 }
Esempio n. 7
0
 public void Testcreate2()
 {
     //test create 2
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     Assert.IsFalse(fileCurrent.createNewFile("C2"));
 }
Esempio n. 8
0
 public void Testmkdir1()
 {
     //test mkdir 1
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     Assert.IsFalse(fileCurrent.mkdir("C2"));
 }
Esempio n. 9
0
 public void Testparent2_1()
 {
     //test parent 2.1
     Repertoire C = new Repertoire("C:", null);
     Fichier C2 = new Fichier("C2", C);
     Fichier fileCurrent = C2;
     Assert.AreEqual(C, fileCurrent.getParent());
 }
Esempio n. 10
0
 public void Testmkdir2()
 {
     //test mkdir 2
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     Assert.IsTrue(fileCurrent.mkdir("C2"));
 }
Esempio n. 11
0
 public void Testcd1()
 {
     //test cd 1
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent = fileCurrent.cd("toto");
     Assert.AreEqual(C, fileCurrent);
 }
Esempio n. 12
0
 public void Testcreate1()
 {
     //test create 1
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     Assert.IsTrue(fileCurrent.createNewFile("C2"));
 }
Esempio n. 13
0
 public void Testname2()
 {
     //test name 2
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("1");
     Assert.AreEqual(null, fileCurrent.getName());
 }
Esempio n. 14
0
 public void Testdelete1()
 {
     //test delete 1
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     Assert.IsFalse(fileCurrent.delete("toto"));
 }
Esempio n. 15
0
 public void Testfiledirectory2()
 {
     //test file&directory 1
     Repertoire C = new Repertoire("C:", null);
     Fichier D = new Fichier("D", C);
     Fichier fileCurrent = C;
     Assert.IsTrue(fileCurrent.isDirectory());
 }
Esempio n. 16
0
 public void Testdelete2()
 {
     //test delete 2
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.mkdir("toto");
     Assert.IsTrue(fileCurrent.delete("toto"));
 }
Esempio n. 17
0
 public void Testparent3_1()
 {
     //test parent 3.1
     Repertoire C = new Repertoire("C:", null);
     Fichier C2 = new Fichier("C2", C);
     Fichier fileCurrent = C2;
     fileCurrent.chmod("1");
     Assert.AreEqual(null, fileCurrent.getParent());
 }
Esempio n. 18
0
 public void Testls2()
 {
     //test ls 2
     Repertoire C = new Repertoire("C:", null);
     Fichier filecurrent = C;
     filecurrent.chmod("7");
     filecurrent.mkdir("toto");
     Assert.AreEqual(1, C.ls().Count);
 }
Esempio n. 19
0
 public void Testrename2_3()
 {
     //test rename 2.3
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.createNewFile("toto");
     Assert.IsTrue(fileCurrent.renameTo("toto", "tata"));
 }
Esempio n. 20
0
 public void Testsearch2_1()
 {
     //test search 2
     Repertoire C = new Repertoire("C:", null);
     Fichier filecurrent = C;
     filecurrent.chmod("7");
     filecurrent.mkdir("titi");
     Assert.AreEqual(0, C.search("tata").Count);
 }
Esempio n. 21
0
 public void Testcd2()
 {
     //test cd 2
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.mkdir("toto");
     fileCurrent = fileCurrent.cd("toto");
     Assert.AreEqual(C.fichieR[0], fileCurrent);
 }
Esempio n. 22
0
 public void Testrename3_2()
 {
     //test rename 3.2
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.createNewFile("toto");
     fileCurrent.mkdir("tata");
     Assert.IsFalse(fileCurrent.renameTo("toto", "tata"));
 }
Esempio n. 23
0
 public void Testpath1_2()
 {
     //test path 1.2, donne la même chose que le testpath1_1, pas de diff file/directory
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.createNewFile("toto");
     fileCurrent = fileCurrent.cd("toto");
     Assert.AreEqual("C:\\toto", fileCurrent.getPath());
 }
Esempio n. 24
0
 public void Testpath1_1()
 {
     //test path 1.1
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.mkdir("toto");
     fileCurrent = fileCurrent.cd("toto");
     Assert.AreEqual("C:\\toto", fileCurrent.getPath());
 }
Esempio n. 25
0
 public void Testroot3()
 {
     //test root 3
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.mkdir("toto");
     fileCurrent = fileCurrent.cd("toto");
     Assert.AreEqual("Vous êtes déjà dans un fichier racine", fileCurrent.getRoot());
 }
Esempio n. 26
0
 public void Testls6()
 {
     //test ls 6
     Repertoire C = new Repertoire("C:", null);
     Fichier filecurrent = C;
     filecurrent.chmod("7");
     filecurrent.mkdir("toto");
     filecurrent.createNewFile("tata");
     Assert.AreEqual(2, C.ls().Count);
 }
Esempio n. 27
0
 public void Testls4()
 {
     //test ls 4
     Repertoire C = new Repertoire("C:", null);
     Fichier filecurrent = C;
     filecurrent.chmod("7");
     filecurrent.createNewFile("toto");
     filecurrent = filecurrent.cd("toto");
     //un ls dans un fichier renvoie un consolewriteline et un null
     Assert.AreEqual(null, filecurrent.ls());
 }
Esempio n. 28
0
 public void Testroot3_1()
 {
     //test root 3.1
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.mkdir("toto");
     fileCurrent = fileCurrent.cd("toto");
     fileCurrent.chmod("1");
     Assert.AreEqual(null, fileCurrent.getRoot());
 }
Esempio n. 29
0
 public void Testroot2()
 {
     //test root 2
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.mkdir("toto");
     fileCurrent = fileCurrent.cd("toto");
     fileCurrent.chmod("7");
     fileCurrent.createNewFile("tata");
     fileCurrent = fileCurrent.cd("tata");
     Assert.AreEqual("toto", fileCurrent.getRoot());
 }
Esempio n. 30
0
 public void Testcd4()
 {
     //test cd 3
     Repertoire C = new Repertoire("C:", null);
     Fichier fileCurrent = C;
     fileCurrent.chmod("7");
     fileCurrent.createNewFile("tata");
     fileCurrent = fileCurrent.cd("tata");
     fileCurrent.chmod("7");
     fileCurrent.createNewFile("toto");
     fileCurrent = fileCurrent.cd("toto");
     Assert.AreEqual(C.fichieR[0], fileCurrent);
 }