Ejemplo n.º 1
0
        protected bool HandleRemoveTask(RemoveTaskAction action)
        {
            if (action.TaskAddress == null)
            {
                throw new NullReferenceException();
            }

            return(this.SubTasks.Remove(action.TaskAddress));
        }
Ejemplo n.º 2
0
        public void RemoveSubtask()
        {
            var task    = this.CreateTask(null);
            var subTask = this.CreateTask(null);
            var action  = new AddTaskAction(string.Empty, task.Address, subTask);

            this.permissionManager.ExecuteAction(action);
            Assert.Contains(subTask.Address, task.SubTasks);
            var removeAction = new RemoveTaskAction(string.Empty, task.Address, subTask.Address);

            this.permissionManager.ExecuteAction(removeAction);
            Assert.DoesNotContain(subTask.Address, task.SubTasks);
        }
Ejemplo n.º 3
0
        public void RemoveTask()
        {
            var task      = this.CreateTask(null);
            var addAction = new AddTaskAction(string.Empty, this.taskRegistry.Address, task);

            this.permissionManager.ExecuteAction(addAction);
            var removeAction = new RemoveTaskAction(string.Empty, this.taskRegistry.Address, task.Address);

            this.permissionManager.ExecuteAction(removeAction);
            ISet <Address> tasks = this.taskRegistry.GetAllTasks();

            Assert.DoesNotContain(task.Address, tasks);
        }
Ejemplo n.º 4
0
 private bool HandleRemoveTask(RemoveTaskAction action)
 {
     return(this.tasksAddresses.Remove(action.TaskAddress));
 }