Example #1
0
        public void test_merge_to_restore_remove()
        {
            Guid task_guid = Guid.NewGuid();
            ActionTaskRestore  restore_action = new ActionTaskRestore(task_guid);
            List <EntryAction> actions        = new List <EntryAction>()
            {
                restore_action
            };

            ActionTaskRemove remove_action = new ActionTaskRemove(task_guid);

            remove_action.merge_to(actions);

            Assert.AreEqual(actions.Count, 0);
        }
Example #2
0
        public void test_merge_to_create_remove()
        {
            Guid               task_guid     = Guid.NewGuid();
            Task               task          = new Task(Guid.NewGuid(), "Some task");
            ActionTaskCreate   create_action = new ActionTaskCreate(task_guid, task);
            List <EntryAction> actions       = new List <EntryAction>()
            {
                create_action
            };

            ActionTaskRemove remove_action = new ActionTaskRemove(task_guid);

            remove_action.merge_to(actions);

            Assert.AreEqual(actions.Count, 0);
        }
Example #3
0
        public void test_merge_to_update_remove()
        {
            Guid               task_guid = Guid.NewGuid();
            Task               from = new Task(Guid.NewGuid(), "Some task"), to = new Task(Guid.NewGuid(), "Some updated task");
            ActionTaskUpdate   update_action = new ActionTaskUpdate(task_guid, from, to, true, false, false, false, false);
            List <EntryAction> actions       = new List <EntryAction>()
            {
                update_action
            };

            ActionTaskRemove remove_action = new ActionTaskRemove(task_guid);

            remove_action.merge_to(actions);

            Assert.AreEqual(actions.Count, 1);
            Assert.IsTrue(ReferenceEquals(actions[0], remove_action));
        }