public void UnknownHandler_GetNameByType()
 {
     Test(() =>
     {
         SetContentHandlerAndResetManagers("UnknownGetNameByType", () =>
         {
             // This should not throw an exception. The returned type is irrelevant:
             // it will be one of the descendants of the Folder content type.
             var _ = ContentTypeManager.GetContentTypeNameByType(typeof(Folder));
         });
     });
 }
Exemplo n.º 2
0
        private Query CreateTypeIsQuery(Type targetType)
        {
            var contentTypeName = ContentTypeManager.GetContentTypeNameByType(targetType);

            if (contentTypeName == null)
            {
                throw new ApplicationException(String.Format("Unknown Content Type: ", targetType.FullName));
            }
            var term = CreateTerm("TypeIs", ConvertValue("TypeIs", contentTypeName));

            return(new TermQuery(term));
        }