예제 #1
0
        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&lt;string, AdvancedSearchOptions&gt;";
            //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&lt;string, <a href=\"/docs/Document/Test/AdvancedSearchOptions/\">AdvancedSearchOptions</a>&gt;");
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        public void PostProcessInvalidParameters()
        {
            DocumentPostProcess postProcess = new DocumentPostProcess(GetDocuments());

            Assert.IsNotNull(postProcess);

            postProcess.Process(null);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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&lt;BlogComment&gt;@)", documents[0].Constructors[0].MethodName);
        }
예제 #8
0
        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&lt;Some.Namespace.Name.ISitemapItem&gt;";
            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&lt;ISitemapItem&gt;", documents[0].Methods[0].Returns);
        }
예제 #9
0
        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);
        }