public void Init()
        {
            //Init...
            _sys     = new StandardFileSystem();
            _sys     = StandardFileSystem.Create("FSROOT");
            _service = new FilesWebService(_sys);
            _request = new CS422.WebRequest();
            _root    = _sys.GetRoot();

            //Set up the filesystem
            //Create Files
            FileStream file = File.Create(_rootPath + "/file1");
            String     s    = "this is a file with content";

            byte[] buffer = Encoding.ASCII.GetBytes(s);
            file.Write(buffer, 0, s.Length);
            file.Close();
            File.Create(_rootPath + "/file2").Close();

            //Create Directory
            Directory.CreateDirectory(_rootPath + "/Dir1");

            //Create subDirs
            Directory.CreateDirectory(_rootPath + "/Dir1/SubDir1");
            Directory.CreateDirectory(_rootPath + "/Dir1/SubDir2");
            Directory.CreateDirectory(_rootPath + "/Dir1/SubDir1/DoubleSubDir1");

            //Create subFiles
            File.Create(_rootPath + "/Dir1/subfile1").Close();
            File.Create(_rootPath + "/Dir1/SubDir1/doubleSubFile1").Close();

            Console.WriteLine("Setup Complete");
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public void StartFileSystemTest()
 {
     Assert.NotNull(_sys);
     Assert.AreEqual("FSROOT", _sys.GetRoot().Name);
 }
Exemple #4
0
        public void RootParentNull()
        {
            StandardFileSystem root = StandardFileSystem.Create(good_path);

            Assert.IsNull(root.GetRoot().Parent);
        }