public void RenameToByFile() { Directory dossier = new Directory("dossier", null); dossier.chmod(7); dossier.createNewFile("hui"); Assert.IsFalse(dossier.ListFile[0].renameTo("toto", "hui")); }
public void LsByFile() { Directory dossier = new Directory("dossier", null); dossier.chmod(7); dossier.createNewFile("hui"); Assert.AreEqual(dossier.ListFile[0].ls(), null); }
public void TestCdDirectory() { Directory dossier = new Directory("dossier", null); dossier.chmod("7"); dossier.mkdir("directory"); Assert.AreEqual(dossier.cd("directory"), dossier.files[0]); }
public void CreateNewFileByDirectoryWithExistName() { Directory dossier2 = new Directory("dossier", null); dossier2.chmod(7); dossier2.createNewFile("hui"); Assert.IsFalse(dossier2.createNewFile("hui")); }
public void CdByDirectoryInFileNoExist() { Directory dossier6 = new Directory("dossier", null); dossier6.chmod(7); dossier6.createNewFile("hui"); Assert.AreEqual(dossier6.cd("rfd"), null); }
public void TestCdFile() { Directory dossier = new Directory("dossier", null); dossier.chmod("7"); dossier.createNewFile("file"); Assert.AreEqual(dossier.cd("file"), dossier.files[0]); }
public void DeleteByDirectoryNameNoExist() { Directory dossier = new Directory("dossier", null); dossier.mkdir("hui"); dossier.chmod(7); Assert.IsFalse(dossier.delete("huit")); }
public void CdByDirectoryInFile() { Directory dossier = new Directory("dossier", null); dossier.chmod(7); dossier.createNewFile("hui"); Assert.AreEqual(dossier.cd("hui"), dossier.ListFile[0]); }
public void MkdirByDirectoryAddList() { Directory dossier = new Directory("dossier", null); dossier.chmod(7); dossier.mkdir("hui"); Assert.AreEqual(dossier.ListFile.Count, 1); }
public void SearchbyFileNoExist() { Directory dossier = new Directory("dossier", null); dossier.mkdir("hui"); dossier.chmod(7); Assert.AreEqual(dossier.search("cuicui").Count, 0); }
public void CreateNewFileByDirectoryAddList() { Directory dossier4 = new Directory("dossier", null); dossier4.chmod(7); dossier4.createNewFile("hui"); Assert.AreEqual(dossier4.ListFile.Count, 1); }
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); }
public void DeleteByDirectoryDeleteList() { Directory dossier = new Directory("dossier", null); dossier.mkdir("hui"); dossier.chmod(7); dossier.delete("hui"); Assert.AreEqual(dossier.ListFile.Count, 0); }
public void DeleteByDirectory() { Directory dossier = new Directory("dossier", null); dossier.chmod(7); dossier.mkdir("hui"); Assert.IsTrue(dossier.delete("hui")); }
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); }
public File(string Nom, Directory parent) { this.Nom = Nom; parent.Fichiers.Add(this); this.parent = parent; string pathEntier = parent.path + "/" + Nom; path = pathEntier; permission = 4; }
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); }
public File(Directory parent,string name) { this.parent = parent; this.name = name; this.permission = 4; isRoot = false; if(this.parent.GetType() != null){ this.parent.childList.Add(this); var fullPath = ""; fullPath = this.parent.path + "/" + name; path = fullPath; } }
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"); }
public void SearchbyFile() { Directory dossier = new Directory("dossier", null); File fileCurrent = dossier; fileCurrent.chmod(7); fileCurrent.mkdir("hui"); fileCurrent = fileCurrent.cd("hui"); fileCurrent.chmod(7); fileCurrent.mkdir("hui"); fileCurrent = fileCurrent.cd("hui"); fileCurrent.chmod(7); fileCurrent.mkdir("hui"); fileCurrent = fileCurrent.cd("hui"); fileCurrent.chmod(1); Assert.AreEqual(dossier.search("hui").Count, 3); }
static Directory WalkThePathLookingForNu(Directory direc, NuConventions conventions) { Directory result = null; if (!direc.IsRoot()) { Directory bro = direc.GetChildDirectory(conventions.ProjectDirectoryName); if (bro.Exists()) { _logger.Debug(x => x.Write("Found the nu folder: {0}", bro.Name)); return bro; } if (direc.HasParentDir) { result = WalkThePathLookingForNu(direc.Parent, conventions); } } return result; }
public Directory(string Name, Directory Parent) : base(Name, Parent) { this.Permission = 4; }
static void Main(string[] args) { //Oui je sais c'est pas C: mais j'm'embrouille moins comme ça Directory C = new Directory("C:"); File Actuel = (Directory)C; commande(Actuel); }
public void TestDeleteFalse() { Directory dossier = new Directory("dossier", null); dossier.chmod("7"); dossier.createNewFile("file"); Assert.IsFalse(dossier.delete("Fichier")); }
public void TestCreateFiledansDirectorySansDroit() { Directory dossier = new Directory("dossier", null); Assert.IsFalse(dossier.createNewFile("file")); }
public void TestCreateFiledansDirectory() { Directory dossier = new Directory("dossier", null); dossier.chmod("7"); Assert.IsTrue(dossier.createNewFile("file")); }
public void TestChmod7() { Directory dossier = new Directory("dossier", null); dossier.chmod("7"); Assert.AreEqual(dossier.Permission, 7); }
public void TestSearchFileExist() { Directory dossier = new Directory("dossier", null); dossier.chmod("7"); dossier.createNewFile("file"); Assert.AreEqual(dossier.search("Fichier").Count, 0); }
public void TestSearchFile() { Directory dossier = new Directory("dossier", null); File file = dossier; file.chmod("7"); file.mkdir("Directory"); file = file.cd("Directory"); file.chmod("7"); file.mkdir("Directory"); file = file.cd("Directory"); file.chmod("7"); file.createNewFile("Directory"); Assert.AreEqual(dossier.search("Directory").Count, 3); }
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")); }