public void PutOffCurrentTask(string[] commands) { string title = null; switch (commands.Length) { case 1: title = manager.PutOffCurrentTask(new Random().Next(2, 4)); break; case 2: string extent = commands[1]; if (extent.Equals(ToBottomFlag)) { title = manager.PutOffCurrentTaskToBottom(); } else { title = manager.PutOffCurrentTask(int.Parse(extent)); } break; default: throw new BadCommandException(commands); } Print($"Task '{title}' is successfully put off ..."); }
public void ZTaskManager_PutOffCurrentTaskToBottom() { // Arrange foreach (var task in tasks) { manager.PushTask(task); } ITask lastTask = tasks[tasks.Count - 1]; // Assume Assume.That(manager.CurrentTask, Is.EqualTo(lastTask)); // Act manager.PutOffCurrentTaskToBottom(); // Assert for (int i = 0; i < tasks.Count - 1; ++i) { var t = manager.CurrentTask; // load current task manager.ArchiveCurrentTask(Category.Obsolete); } Assert.That(manager.CurrentTask, Is.EqualTo(lastTask)); }