public void TestSplitString() { List <Document> documents = new List <Document>(); documents.Add(new Document(Shared.DocumentType.Class, "Test", "Test", "ClassName", "T:Test.ClassName")); documents.Add(new Document(Shared.DocumentType.Class, "Test", "Test", "AdvancedSearchOptions", "T:Test.AdvancedSearchOptions")); DocumentPostProcess postProcess = new DocumentPostProcess(documents); Assert.IsNotNull(postProcess); Document searchDoc = new Document(Shared.DocumentType.Custom, "Custom Type"); searchDoc.ClassName = searchDoc.FullMemberName; searchDoc.Returns = "Dictionary<string, AdvancedSearchOptions>"; //searchDoc.LongDescription = "Test <see cref=\"T:Test.ClassName\" /> class"; Assert.IsNotNull(searchDoc); PostProcessResults postProcessResults = postProcess.Process(searchDoc); Assert.IsNotNull(postProcessResults); Assert.AreEqual(1, postProcessResults.DocumentsProcessed); Assert.AreEqual(searchDoc.Returns, "Dictionary<string, <a href=\"/docs/Document/Test/AdvancedSearchOptions/\">AdvancedSearchOptions</a>>"); }
public void ValidatePostProcessResultsProcessSingleDocumentParaTag() { List <Document> documents = new List <Document>(); documents.Add(new Document(Shared.DocumentType.Class, "Test", "Test", "ClassName", "T:Test.ClassName")); DocumentPostProcess postProcess = new DocumentPostProcess(documents); Assert.IsNotNull(postProcess); Document searchDoc = new Document(Shared.DocumentType.Custom, "Custom Type"); searchDoc.LongDescription = "Test <para>This will be a seperate paragraph</para> class"; Assert.IsNotNull(searchDoc); PostProcessResults postProcessResults = postProcess.Process(searchDoc); Assert.IsNotNull(postProcessResults); Assert.AreEqual(1, postProcessResults.DocumentsProcessed); Assert.AreEqual(1, postProcessResults.GetCountValue(Constants.CountValueParaOpen)); Assert.AreEqual(1, postProcessResults.GetCountValue(Constants.CountValueParaClose)); Assert.AreEqual("Test <p>This will be a seperate paragraph</p> class", searchDoc.LongDescription); }
public void ValidatePostProcessResultsProcessSingleDocumentSeeAlsoTagInvalid() { List <Document> documents = new List <Document>(); documents.Add(new Document(Shared.DocumentType.Class, "Test", "Test", "ClassName", "T:Test.ClassName")); DocumentPostProcess postProcess = new DocumentPostProcess(documents); Assert.IsNotNull(postProcess); Document searchDoc = new Document(Shared.DocumentType.Custom, "Custom Type"); searchDoc.ClassName = searchDoc.FullMemberName; searchDoc.LongDescription = "Test <seealso cref=\"T:Test.ClassName /> class"; Assert.IsNotNull(searchDoc); PostProcessResults postProcessResults = postProcess.Process(searchDoc); Assert.IsNotNull(postProcessResults); Assert.AreEqual(1, postProcessResults.DocumentsProcessed); Assert.AreEqual(1, postProcessResults.GetCountValue(Constants.CountValueSeeAlso)); Assert.AreEqual(1, postProcessResults.GetCountValue(Constants.CountValueSeeAlsoNotFound)); Assert.AreEqual(0, searchDoc.SeeAlso.Count); }
public void ValidatePostProcessResultsProcessSingleDocumentSeeTag() { List <Document> documents = new List <Document>(); documents.Add(new Document(Shared.DocumentType.Class, "Test", "Test", "ClassName", "T:Test.ClassName")); DocumentPostProcess postProcess = new DocumentPostProcess(documents); Assert.IsNotNull(postProcess); Document searchDoc = new Document(Shared.DocumentType.Custom, "Custom Type"); searchDoc.ClassName = searchDoc.FullMemberName; searchDoc.LongDescription = "Test <see cref=\"T:Test.ClassName\" /> class"; Assert.IsNotNull(searchDoc); PostProcessResults postProcessResults = postProcess.Process(searchDoc); Assert.IsNotNull(postProcessResults); Assert.AreEqual(1, postProcessResults.DocumentsProcessed); Assert.AreEqual(1, postProcessResults.GetCountValue(Constants.CountValueSee)); Assert.AreEqual("Test <a href=\"/docs/Document/Test/ClassName/\">ClassName</a> class", searchDoc.LongDescription); }
public void PostProcessInvalidParameters() { DocumentPostProcess postProcess = new DocumentPostProcess(GetDocuments()); Assert.IsNotNull(postProcess); postProcess.Process(null); }
public void CreatePostProcessDocument() { Document searchDoc = GetDocuments() .Where(d => d.LongDescription.Contains("<see cref=") && d.AssemblyName == "SearchPlugin") .FirstOrDefault(); Assert.IsNotNull(searchDoc); DocumentPostProcess postProcess = new DocumentPostProcess(GetDocuments()); Assert.IsNotNull(postProcess); }
public void TestSplitConstructorNameWithCurlyBracesRemoveNamespaceConvertBraces() { List <Document> documents = new List <Document>(); documents.Add(new Document(Shared.DocumentType.Class, "Test", "Test", "ClassName", "T:Middleware.Blog.BlogItem")); DocumentMethod documentConstructor = new DocumentMethod(Shared.DocumentType.Constructor, "Test", "Test", "Test", "M:Middleware.Blog.BlogItem.#ctor(System.Collections.Generic.List{Middleware.Blog.BlogComment}@)", "M:Blog.Plugin.Classes.BlogSitemapProvider.Items"); documents[0].Constructors.Add(documentConstructor); DocumentPostProcess postProcess = new DocumentPostProcess(documents); postProcess.Process(); Assert.IsNotNull(postProcess); Assert.AreEqual("M:Middleware.Blog.BlogItem.#ctor(List<BlogComment>@)", documents[0].Constructors[0].MethodName); }
public void TestSplitConstructorValueRemoveNamespace() { List <Document> documents = new List <Document>(); documents.Add(new Document(Shared.DocumentType.Class, "Test", "Test", "ClassName", "T:Test.ClassName")); DocumentMethod documentMethod = new DocumentMethod(Shared.DocumentType.Method, "Test", "Test", "Test", "#ctor(Some.NameSpace.Class)", "M:Blog.Plugin.Classes.BlogSitemapProvider.Items"); documentMethod.Returns = "List<Some.Namespace.Name.ISitemapItem>"; documents[0].Methods.Add(documentMethod); DocumentPostProcess postProcess = new DocumentPostProcess(documents); postProcess.Process(); Assert.IsNotNull(postProcess); Assert.AreEqual("#ctor(Class)", documents[0].Methods[0].MethodName); Assert.AreEqual("List<ISitemapItem>", documents[0].Methods[0].Returns); }
public void ValidatePostProcessResultsProcessSingleDocument() { List <Document> documents = new List <Document>(); documents.Add(new Document(Shared.DocumentType.Class, "Test", "Test", "ClassName", "T:Test.ClassName")); DocumentPostProcess postProcess = new DocumentPostProcess(documents); Assert.IsNotNull(postProcess); Document searchDoc = new Document(Shared.DocumentType.Custom, "Custom Type"); searchDoc.LongDescription = "Test <see cref=\"T:Test.ClassName\" /> class"; Assert.IsNotNull(searchDoc); PostProcessResults postProcessResults = postProcess.Process(searchDoc); Assert.IsNotNull(postProcessResults); Assert.AreEqual(1, postProcessResults.DocumentsProcessed); }