public void Search_returns_only_distinct_results()
        {
            var store = new TestableStore();

            var duplicatedTag = "alpha";

            var testTags = new[] { duplicatedTag, duplicatedTag, "beta" }.ToList();

            using (var tagsController = new TagsController(store))
            {
                using (var session = store.OpenSession())
                {
                    var entry = new Entry { Tags = new Collection<string>(testTags) };
                    session.Store(entry);
                    session.SaveChanges();

                    RavenControllerTestHelper.SetSessionOnController(tagsController, session);

                    var actionResult = tagsController.Search("alpha");
                    var tags = GetTagsFromResult(actionResult);

                    Assert.Equal(1, tags.Count());
                    Assert.Equal(duplicatedTag, tags.First());
                }
            }
        }
        public void Search_results_include_searched_term()
        {
            var store = new TestableStore();

            using (var tagsController = new TagsController(store))
            {
                using (var session = store.OpenSession())
                {
                    RavenControllerTestHelper.SetSessionOnController(tagsController, session);

                    var actionResult = tagsController.Search("blah");
                    var tags = GetTagsFromResult(actionResult);

                    Assert.Equal(1, tags.Count());
                    Assert.Equal("blah", tags.First());
                }
            }
        }