Example #1
0
        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();
        }
Example #2
0
        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();
        }
Example #3
0
        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);
        }
Example #4
0
        public void Search_for_whitespace_string_returns_all_entries()
        {
            var entityUnderTest = new DreamTagSearch(GetDreamTags());

            entityUnderTest.SearchForTags("  ").Should().HaveCount(7);
        }