Пример #1
0
 /// <summary>
 /// Initialize instance of a class <see cref="ServerConsole"/>
 /// </summary>
 /// <param name="engine">File system engine</param>
 public ServerConsole(IFSEngine engine)
 {
     _engine = engine;
     _commands.Add("CD", engine.Navigate);
     _commands.Add("MD", engine.CreateDirectory);
     _commands.Add("RD", engine.RemoveDirectory);
     _commands.Add("DELTREE", engine.RemoveTree);
     _commands.Add("MF", engine.CreateFile);
     _commands.Add("DEL", engine.RemoveFile);
     _commands.Add("LOCK", engine.LockFile);
     _commands.Add("UNLOCK", engine.UnlockFile);
     _commands.Add("MOVE", engine.Move);
     _commands.Add("COPY", engine.Copy);
     _commands.Add("PRINT", engine.Print);
 }
Пример #2
0
        public void MyTestInitialize()
        {
            _engine        = new VFSEngine();
            _context       = CommandHelper.CreateCommandContext();
            _rootDirectory = _context.User.CurrentDirectory;

            _file1 = CommandHelper.CreateFile("file1");
            _rootDirectory.AddFile(_file1);

            _child1Directory = CommandHelper.CreateDirectory("child1");
            _child2Directory = CommandHelper.CreateDirectory("child2");
            _child3Directory = CommandHelper.CreateDirectory("child3");
            _rootDirectory.AddDirectory(_child1Directory);
            _rootDirectory.AddDirectory(_child2Directory);
            _rootDirectory.AddDirectory(_child3Directory);

            _child1Directory.AddDirectory(CommandHelper.CreateDirectory("child11"));
            _child1Directory.AddDirectory(CommandHelper.CreateDirectory("child12"));
            _child2Directory.AddDirectory(CommandHelper.CreateDirectory("child21"));
            _child2Directory.AddDirectory(CommandHelper.CreateDirectory("child22"));
        }