Exemplo n.º 1
0
        public void TaskIsDisposed()
        {
            TestArgumentProvider arguments = new TestArgumentProvider();

            arguments.Command = "TaskIsDisposed";

            SimpleTaskRegistry taskRegistry = new SimpleTaskRegistry();
            TestTask           task         = new TestTask();

            taskRegistry.RegisterTask(() => task, "TaskIsDisposed");

            TaskExecution execution = Substitute.ForPartsOf <TaskExecution>(arguments, taskRegistry, null);

            execution.ExecuteTask();
            task.DisposeCount.Should().Be(1);
        }
Exemplo n.º 2
0
        public override void Initialize()
        {
            SimpleTaskRegistry registry = this.GetTaskRegistry();

            // Debugger.Launch();

            registry.RegisterTask(() => new DirectoryTask(), "directory", "dir", "ls");
            registry.RegisterTask(() => new ChangeDirectoryTask(), "changedirectory", "chdir", "cd");
            registry.RegisterTask(() => new PrintCurrentDirectoryTask(), "printcurrentdirectory", "pwd", "pcd");
            registry.RegisterTask(() => new MakeDirectoryTask(), "makedirectory", "mkdir", "md");
            registry.RegisterTask(() => new RemoveDirectoryTask(), "removedirectory", "rmdir", "rd");
            registry.RegisterTask(() => new FileInfoTask(), "fileinfo", "fi");
            registry.RegisterTask(() => new ListStreamsTask(), "liststreams", "streams");
            registry.RegisterTask(() => new TypeTask(), "type");
            registry.RegisterTask(() => new EchoTask(), "echo");
            registry.RegisterTask(() => new CopyTask(), "copy", "cp");
            registry.RegisterTask(() => new FullPathTask(), "fullpath", "fp");
            registry.RegisterTask(() => new LongPathTask(), "longpath", "lp");
            registry.RegisterTask(() => new ShortPathTask(), "shortpath", "sp");
            registry.RegisterTask(() => new FinalPathTask(), "finalpath", "final");
            registry.RegisterTask(() => new MountPointTask(), "volumepathname", "vpn");
            registry.RegisterTask(() => new VolumeNameTask(), "volumename", "vn");
            registry.RegisterTask(() => new VolumeMountPointsTask(), "volumemountpoints", "mountpoints", "mp");
            registry.RegisterTask(() => new VolumeInformationTask(), "volumeinformation", "volumeinfo", "vi");
            registry.RegisterTask(() => new DosAliasTask(), "dosalias", "da");
            registry.RegisterTask(() => new LogicalDriveStringsTask(), "logicaldrivestrings", "lds");
            registry.RegisterTask(() => new TestTask(), "test");

            base.Initialize();
        }