public void ContentType_ShouldBeEmployee(PersonIndexingProvider provider, [Content] Item dictionaryRoot)
 {
     Context.Site = new FakeSiteContext(new StringDictionary()
     {
         ["dictionaryPath"] = dictionaryRoot.Paths.FullPath,
         ["database"]       = "master"
     });
     provider.ContentType.Should().Be("Employee");
 }
        public void SupportedTemplatesShouldReturnAtLeastOneTemplate()
        {
            var provider           = new PersonIndexingProvider();
            var templates          = provider.SupportedTemplates;
            var supportedTemplates = templates as ID[] ?? templates.ToArray();

            supportedTemplates.Should().NotBeNull();
            supportedTemplates.Should().HaveCount(c => c > 0);
        }
        public void SupportedTemplatesShouldOnlyReturnTemplatesInModule()
        {
            var provider           = new PersonIndexingProvider();
            var templates          = provider.SupportedTemplates;
            var supportedTemplates = templates as ID[] ?? templates.ToArray();

            supportedTemplates.Should().NotBeNull();
            var templatesInModule = GetTemplatesInModule();

            supportedTemplates.Should().OnlyContain(t => templatesInModule.Contains(t));
        }
        public void GetQueryPredicate_PersonItemWithWrongContent_ShouldReturnFalse(string fieldName, PersonIndexingProvider provider, IQuery query, string queryText, string contentText)
        {
            var item = Substitute.For <SearchResultItem>();

            query.QueryText.Returns(queryText);
            item[fieldName].Returns(contentText);
            provider.GetQueryPredicate(query).Compile().Invoke(item).Should().BeFalse();
        }
 public void GetQueryPredicate_WrongTemplate_ShouldReturnFalse(PersonIndexingProvider provider, IQuery query)
 {
     provider.GetQueryPredicate(query).Compile().Invoke(new SearchResultItem()).Should().BeFalse();
 }
 public void SupportedTemplates_ContainsNewsArticleTemplate(PersonIndexingProvider provider)
 {
     provider.SupportedTemplates.Should().Contain(Templates.Employee.ID);
 }