Пример #1
0
 public void LsByFile()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod(7);
     dossier.createNewFile("hui");
     Assert.AreEqual(dossier.ListFile[0].ls(), null);
 }
Пример #2
0
 public void SearchbyFileNoExist()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.mkdir("hui");
     dossier.chmod(7);
     Assert.AreEqual(dossier.search("cuicui").Count, 0);
 }
Пример #3
0
 public void CreateNewFileByDirectoryWithExistName()
 {
     Directory dossier2 = new Directory("dossier", null);
     dossier2.chmod(7);
     dossier2.createNewFile("hui");
     Assert.IsFalse(dossier2.createNewFile("hui"));
 }
Пример #4
0
 public void TestCdFile()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.createNewFile("file");
     Assert.AreEqual(dossier.cd("file"), dossier.files[0]);
 }
Пример #5
0
 public void CdByDirectoryInFileNoExist()
 {
     Directory dossier6 = new Directory("dossier", null);
     dossier6.chmod(7);
     dossier6.createNewFile("hui");
     Assert.AreEqual(dossier6.cd("rfd"), null);
 }
Пример #6
0
 public void CreateNewFileByDirectoryAddList()
 {
     Directory dossier4 = new Directory("dossier", null);
     dossier4.chmod(7);
     dossier4.createNewFile("hui");
     Assert.AreEqual(dossier4.ListFile.Count, 1);
 }
Пример #7
0
 public void DeleteByDirectoryNameNoExist()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.mkdir("hui");
     dossier.chmod(7);
     Assert.IsFalse(dossier.delete("huit"));
 }
Пример #8
0
 public void CdByDirectoryInFile()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod(7);
     dossier.createNewFile("hui");
     Assert.AreEqual(dossier.cd("hui"), dossier.ListFile[0]);
 }
Пример #9
0
 public void MkdirByDirectoryAddList()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod(7);
     dossier.mkdir("hui");
     Assert.AreEqual(dossier.ListFile.Count, 1);
 }
Пример #10
0
 public void RenameToByFile()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod(7);
     dossier.createNewFile("hui");
     Assert.IsFalse(dossier.ListFile[0].renameTo("toto", "hui"));
 }
Пример #11
0
 public void TestCdDirectory()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.mkdir("directory");
     Assert.AreEqual(dossier.cd("directory"), dossier.files[0]);
 }
Пример #12
0
 public void DeleteByDirectoryDeleteList()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.mkdir("hui");
     dossier.chmod(7);
     dossier.delete("hui");
     Assert.AreEqual(dossier.ListFile.Count, 0);
 }
Пример #13
0
        public void DeleteByDirectory()
        {
            Directory dossier = new Directory("dossier", null);
            dossier.chmod(7);
            dossier.mkdir("hui");

            Assert.IsTrue(dossier.delete("hui"));
        }
Пример #14
0
 public void RenameToByDirectory()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod(7);
     dossier.createNewFile("hui");
     dossier.renameTo("hui", "toto");
     Assert.AreEqual("toto", dossier.ListFile[0].Name);
 }
Пример #15
0
 public void TestCreateFile()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.createNewFile("file");
     Assert.AreEqual(dossier.files[0].Nom, "file");
     Assert.AreEqual(dossier.files.Count, 1);
 }
Пример #16
0
 public void LsByDirectoryNoPermit()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod(1);
     dossier.createNewFile("hui");
     dossier.createNewFile("hui");
     dossier.createNewFile("hui");
     dossier.createNewFile("hui");
     Assert.AreEqual(dossier.ls(), null);
 }
Пример #17
0
        public void GetPathByFile()
        {
            Directory dossier = new Directory("C:", null);

            dossier.chmod(7);
            dossier.mkdir("hui");
            File FileCurrent = dossier;
            FileCurrent = dossier.cd("hui");
            FileCurrent.chmod(7);
            FileCurrent.mkdir("toto");
            FileCurrent = FileCurrent.cd("toto");
            FileCurrent.chmod(7);
            Assert.AreEqual(FileCurrent.getPath(), "C:/hui/toto");
        }
Пример #18
0
 public void TestDeleteFalse()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.createNewFile("file");
     Assert.IsFalse(dossier.delete("Fichier"));
 }
Пример #19
0
 public void TestCreateFiledansDirectory()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     Assert.IsTrue(dossier.createNewFile("file"));
 }
Пример #20
0
 public void TestChmod7()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     Assert.AreEqual(dossier.Permission, 7);
 }
Пример #21
0
 public void TestSearchFileExist()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.createNewFile("file");
     Assert.AreEqual(dossier.search("Fichier").Count, 0);
 }
Пример #22
0
 public void TestRenameTo_True()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.createNewFile("file");
     dossier.mkdir("Directory");
     Assert.IsTrue(dossier.renameTo("file", "Fichier"));
 }
Пример #23
0
 public void TestRenameTo_False2()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.createNewFile("file");
     Assert.IsFalse(dossier.renameTo("Directory", "file"));
 }
Пример #24
0
 public void TestRenameTo()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.createNewFile("file");
     dossier.renameTo("file","fichier");
     Assert.AreEqual(dossier.files[0].Nom, "fichier");
 }
Пример #25
0
 public void TestMkdirdansDirectory()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     Assert.IsTrue(dossier.mkdir("dossier"));
 }
Пример #26
0
 public void Testls()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.mkdir("directory");
     dossier.createNewFile("file");
     Assert.AreEqual(dossier.files.Count, 2);
 }
Пример #27
0
 public void TestGetRootFile()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.createNewFile("file");
     Assert.AreEqual(dossier.Nom, dossier.files[0].getRoot());
 }
Пример #28
0
 public void TestGetRootDirectory()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.mkdir("directory");
     Assert.AreEqual(dossier.Nom, dossier.files[0].getRoot());
 }
Пример #29
0
 public void TestGetPath()
 {
     Directory dossier = new Directory("dossier", null);
     File file = dossier;
     dossier.chmod("7");
     dossier.createNewFile("file");
     file = file.cd("file");
     Assert.AreEqual(file.getPath(),"dossier/file");
 }
Пример #30
0
 public void TestgetParentFile()
 {
     Directory dossier = new Directory("dossier", null);
     dossier.chmod("7");
     dossier.createNewFile("file");
     Assert.AreEqual(dossier.files[0].getParent(), dossier);
 }