public void ZTaskManager_SelectTasks(TaskFlag flag, IEnumerable <ITask> expectedResult)
        {
            // Arrange
            foreach (var task in tasks)
            {
                manager.PushTask(task);
            }
            foreach (var task in pTasks)
            {
                manager.PushTaskWithPriority(task);
            }

            manager.Update();

            // Assert
            Assert.That(manager.SelectTasks(flag), Is.EquivalentTo(expectedResult));
        }
        public void View_SelectedTasks(string[] commands)
        {
            // Arrange
            bool     detail    = false;
            TaskFlag selection = TaskFlag.None;

            // Collect selection flags
            for (int i = 1; i < commands.Length; ++i)
            {
                switch (commands[i])
                {
                case PrioritizedTaskFlag:
                    selection = selection | TaskFlag.Prioritized;
                    break;

                case NonPrioritizedTaskFlag:
                    selection = selection | TaskFlag.NonPrioritized;
                    break;

                case UrgentTaskFlag:
                    selection = selection | TaskFlag.Urgent;
                    break;

                case DangerTaskFlag:
                    selection = selection | TaskFlag.Danger;
                    break;

                case ScheduledTaskFlag:
                    selection = selection | TaskFlag.Scheduled;
                    break;

                case NonScheduledTaskFlag:
                    selection = selection | TaskFlag.NonScheduled;
                    break;

                case ShowDetail:
                    detail = true;
                    break;

                default:
                    throw new Exception("Bad selection command");
                }
            }

            // Select tasks and Print
            var selectedTasks = manager.SelectTasks(selection);

            if (selectedTasks.Any())
            {
                if (detail)
                {
                    Print(FormatUtil.BreakLine);
                    ConsoleUtil.WriteTasksInDetail(selectedTasks);
                    detail = false;
                }
                else
                {
                    for (int i = 0; i < selectedTasks.Count; ++i)
                    {
                        Print($"{i}. {selectedTasks[i].Title}");
                    }
                }
            }
        }