public void Search_for_child_tag_returns_tag_and_parent() { var entityUnderTest = new DreamTagSearch(GetDreamTags()); var result = entityUnderTest.SearchForTags("Everest").ToList(); result.Should().HaveCount(2); result.All(x => x.Tag == "Mountain" || x.ParentTag == "Mountain").Should().BeTrue(); }
public void Search_for_parent_tag_returns_tag_and_children() { var entityUnderTest = new DreamTagSearch(GetDreamTags()); var result = entityUnderTest.SearchForTags("Friend").ToList(); result.Should().HaveCount(3); result.All(x => x.Tag == "Friend" || x.ParentTag == "Friend").Should().BeTrue(); }
public TagWizardViewModel([NotNull] IEnumerable <DreamMainTag> originalTags, IEnumerable <TagStatistic> allTagStatistics) { _allTagStatistics = allTagStatistics; var dreamMainTags = originalTags.ToList(); _originalTags = DreamTagParser.TagsToString(dreamMainTags); _tagsToAdd.AddRange(dreamMainTags); _searcher = new DreamTagSearch(_allTagStatistics); TagsToShow = SetTagsToShow(_searcher.AllTags); }
public void Search_for_whitespace_string_returns_all_entries() { var entityUnderTest = new DreamTagSearch(GetDreamTags()); entityUnderTest.SearchForTags(" ").Should().HaveCount(7); }