public void ItShouldCheckForTags() { Tag tag1 = new Tag("urgent"); Tag tag2 = new Tag("important"); TagList testTaglist = new TagList(); testTaglist.AddTag(ref tag1); testTaglist.AddTag(ref tag2); bool expected = true; bool actual = testTaglist.HasTag("important"); Assert.AreEqual(expected, actual); }
public void Execute(ArgumentList arguments, TaskList tasks, TagList tags, TagFolder folder) { FileIO loader = new FileIO(); TaskTagger tagTasks = new TaskTagger(tasks.GetTasks()); if (tagTasks.DeleteTag(arguments.GetParameter(1)) || tags.HasTag(arguments.GetParameter(1))) { Tag tagToRemove = tags.GetTag(tags.GetTagIndex(arguments.GetParameter(1))); tags.RemoveTag(ref tagToRemove); loader.SaveTags(tags); loader.SaveTasks(tagTasks.GetTasks()); Console.WriteLine("Tag {0} deleted", arguments.GetParameter(1)); } else Console.WriteLine("No tag with that name available"); }