public void StdDirDaddyNotNull() { Dir422 dir = new StdFSDir(good_path); int x = 0; Assert.AreEqual("CS422", dir.Parent.Name); }
public void GetDirectorieS() { StdFSDir dir = new StdFSDir(good_path, false); IList <Dir422> directories = dir.GetDirs(); Assert.AreEqual(6, directories.Count); }
public void CreateDirWithEmptyNameShouldReturnNull() { StdFSDir dir = new StdFSDir(); dir = (StdFSDir)dir.CreateDir(""); Assert.Null(dir); }
public void GetFilesS() { StdFSDir dir = new StdFSDir(good_path, false); IList <File422> files = dir.GetFiles(); Assert.AreEqual(4, files.Count); }
public void CreateDirWithBackwardSlashInNameShouldReturnNull() { StdFSDir dir = new StdFSDir(); dir = (StdFSDir)dir.CreateDir("\\bad\\name"); Assert.Null(dir); }
public void GetDirWithForwardSlashInNameShouldReturnNull() { StdFSDir dir = new StdFSDir(); dir = (StdFSDir)dir.GetDir("/bad/name"); Assert.Null(dir); }
public void GetFileS() { StdFSDir dir = new StdFSDir(good_path, false); File422 gotten_file = dir.GetFile("f1"); Assert.AreEqual("f1", gotten_file.Name); }
public void GetFileDosentExistF() { StdFSDir dir = new StdFSDir(good_path, false); File422 gotten_file = dir.GetFile("f7"); Assert.Null(gotten_file); }
public void GetDirS() { StdFSDir dir = new StdFSDir(good_path, false); Dir422 gotten_dir = dir.GetDir("d6"); Assert.AreEqual("d6", gotten_dir.Name); }
public void GetDirDosentExistF() { StdFSDir dir = new StdFSDir(good_path, false); Dir422 gotten_dir = dir.GetDir("d7"); Assert.Null(gotten_dir); }
public void GetParentS() { StdFSDir son = new StdFSDir(good_path); //StdFSDir dad = son.Parent; Assert.AreEqual("CS422", son.Parent.Name); }
public void GetDir() { StdFSDir dir = (StdFSDir)_root.GetDir("Dir1"); Assert.NotNull(dir); Assert.AreEqual("Dir1", dir.Name); Assert.AreEqual(_rootPath + "/Dir1", dir.Path); Assert.AreEqual(_root, dir.Parent); }
public void CreateDirS() { StdFSDir dir = new StdFSDir(good_path, false); dir.CreateDir("d6"); Dir422 gotten_file = dir.GetDir("d6"); Assert.AreEqual("d6", gotten_file.Name); }
public void CreateFileS() { StdFSDir dir = new StdFSDir(good_path); dir.CreateFile("f4"); File422 gotten_file = dir.GetFile("f4"); Assert.AreEqual("f4", gotten_file.Name); }
public void GetFileContainsPathCharF() { StdFSDir dir = new StdFSDir(good_path, false); File422 gotten_file = dir.GetFile("f/3"); Assert.Null(gotten_file); gotten_file = dir.GetFile("f\\3"); Assert.Null(gotten_file); }
public void GetDirContainsPathCharF() { StdFSDir dir = new StdFSDir(good_path, false); Dir422 gotten_dir = dir.GetDir("d/3"); Assert.Null(gotten_dir); gotten_dir = dir.GetDir("d\\3"); Assert.Null(gotten_dir); }
public void Init() { StandardFileSystem sys = new StandardFileSystem(); sys = StandardFileSystem.Create("FSROOT"); _root = (StdFSDir)sys.GetRoot(); File.Create(_rootPath + "/file1").Close(); Directory.CreateDirectory(_rootPath + "/Dir1"); Directory.CreateDirectory(_rootPath + "/Dir1" + "/SubDir1"); File.Create(_rootPath + "/Dir1/subfile1").Close(); Console.WriteLine("Setup Complete"); Console.WriteLine("Root: " + _root); }
public void GetDirs() { List <Dir422> expected = new List <Dir422>(); // set up a dir list to compare Dir422 dir1 = new StdFSDir(_rootPath + "/Dir1", "Dir1", _root); expected.Add(dir1); // expected.Add(new StdFSDir("dir2",root)); // expected.Add(new StdFSDir("dir3",root)); // expected.Add(new StdFSDir("dir4",root)); List <Dir422> dirs = (List <Dir422>)_root.GetDirs(); Assert.NotNull(dirs); Assert.AreEqual(expected.Count, dirs.Count); Assert.AreEqual(expected[0].Name, dirs[0].Name); //This for some reason fails on same types??? //Assert.AreEqual(expected, dirs); }
public void GetFileNameFromFullPathTest() { string returned = StdFSDir.GetFileNameFromFullPath(_rootPath); Assert.AreEqual("FSROOT", returned); }
public void GetFileNameFromFullPathEndingInslashShouldBeSafe() { string returned = StdFSDir.GetFileNameFromFullPath(_rootPath + "/"); Assert.AreEqual("FSROOT", returned); }
public void GetName() { StdFSDir dir = new StdFSDir(); Assert.AreEqual("", dir.Name); }
public void GetDirThatDoesntExist() { StdFSDir dir = (StdFSDir)_root.GetDir("Dir2"); Assert.Null(dir); }