public void GetXmlDocumentation_Method()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("DocumentedMethod", new Type[] { });

            Assert.AreEqual("<summary>\nA documented method.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(method));
        }
        public void FormatId_Indexer()
        {
            PropertyInfo property = typeof(DocumentedClass).GetProperty("Item");

            Assert.AreEqual("P:MbUnit.TestResources.DocumentedClass.Item(System.Int32)",
                            XmlDocumentationUtils.FormatId(property));
        }
        public void FormatId_Event()
        {
            EventInfo @event = typeof(DocumentedClass).GetEvent("DocumentedEvent");

            Assert.AreEqual("E:MbUnit.TestResources.DocumentedClass.DocumentedEvent",
                            XmlDocumentationUtils.FormatId(@event));
        }
        public void GetXmlDocumentation_Event()
        {
            EventInfo @event = typeof(DocumentedClass).GetEvent("DocumentedEvent");

            Assert.AreEqual("<summary>\nA documented event.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(@event));
        }
        public void GetXmlDocumentation_Indexer()
        {
            PropertyInfo property = typeof(DocumentedClass).GetProperty("Item");

            Assert.AreEqual("<summary>\nA documented indexer.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(property));
        }
        public void GetXmlDocumentation_Field()
        {
            FieldInfo field = typeof(DocumentedClass).GetField("DocumentedField");

            Assert.AreEqual("<summary>\nA documented field.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(field));
        }
        public void GetXmlDocumentation_Property()
        {
            PropertyInfo property = typeof(DocumentedClass).GetProperty("DocumentedProperty");

            Assert.AreEqual("<summary>\nA documented property.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(property));
        }
        public void GetXmlDocumentation_Type()
        {
            Type type = typeof(DocumentedClass);

            Assert.AreEqual("<summary>\nA documented class.\n</summary>\n<remarks>\nThe XML documentation of this test is significant.\n  Including the leading whitespace on this line.\n    And the extra 8 trailing spaces on this line!\n</remarks>",
                            XmlDocumentationUtils.GetXmlDocumentation(type));
        }
        public void GetXmlDocumentation_GenericNestedTypeDefinition()
        {
            Type type = typeof(DocumentedClass.GenericNestedClass <>);

            Assert.AreEqual("<summary>\nA documented generic nested class.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(type));
        }
        public void FormatId_ConstructorMethodWithParameters()
        {
            ConstructorInfo method = typeof(DocumentedClass).GetConstructor(new Type[] { typeof(int) });

            Assert.AreEqual("M:MbUnit.TestResources.DocumentedClass.#ctor(System.Int32)",
                            XmlDocumentationUtils.FormatId(method));
        }
        public void FormatId_Finalizer()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("Finalize", BindingFlags.Instance | BindingFlags.NonPublic);

            Assert.AreEqual("M:MbUnit.TestResources.DocumentedClass.Finalize",
                            XmlDocumentationUtils.FormatId(method));
        }
        public void FormatId_ConstructorMethod()
        {
            ConstructorInfo method = typeof(DocumentedClass).GetConstructor(new Type[] { });

            Assert.AreEqual("M:MbUnit.TestResources.DocumentedClass.#ctor",
                            XmlDocumentationUtils.FormatId(method));
        }
        public void FormatId_ExplicitConversionOperatorMethod()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("op_Explicit");

            Assert.AreEqual("M:MbUnit.TestResources.DocumentedClass.op_Explicit(MbUnit.TestResources.DocumentedClass)~System.Double",
                            XmlDocumentationUtils.FormatId(method));
        }
        public void FormatId_OperatorMethod()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("op_Addition");

            Assert.AreEqual("M:MbUnit.TestResources.DocumentedClass.op_Addition(MbUnit.TestResources.DocumentedClass,MbUnit.TestResources.DocumentedClass)",
                            XmlDocumentationUtils.FormatId(method));
        }
        public void FormatId_GenericIndexer()
        {
            PropertyInfo method = typeof(DocumentedClass.GenericNestedClass <int>).GetProperty("Item");

            Assert.AreEqual("P:MbUnit.TestResources.DocumentedClass.GenericNestedClass`1.Item(`0)",
                            XmlDocumentationUtils.FormatId(method));
        }
        public void FormatId_Property()
        {
            PropertyInfo property = typeof(DocumentedClass).GetProperty("DocumentedProperty");

            Assert.AreEqual("P:MbUnit.TestResources.DocumentedClass.DocumentedProperty",
                            XmlDocumentationUtils.FormatId(property));
        }
        public void FormatId_Method()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("DocumentedMethod", new Type[] { });

            Assert.AreEqual("M:MbUnit.TestResources.DocumentedClass.DocumentedMethod",
                            XmlDocumentationUtils.FormatId(method));
        }
        public void FormatId_Field()
        {
            FieldInfo field = typeof(DocumentedClass).GetField("DocumentedField");

            Assert.AreEqual("F:MbUnit.TestResources.DocumentedClass.DocumentedField",
                            XmlDocumentationUtils.FormatId(field));
        }
        public void GetXmlDocumentation_Finalizer()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("Finalize", BindingFlags.Instance | BindingFlags.NonPublic);

            Assert.AreEqual("<summary>\nA documented finalizer.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(method));
        }
        public void FormatId_GenericNestedTypeDefinition()
        {
            Type type = typeof(DocumentedClass.GenericNestedClass <>);

            Assert.AreEqual("T:MbUnit.TestResources.DocumentedClass.GenericNestedClass`1",
                            XmlDocumentationUtils.FormatId(type));
        }
        public void GetXmlDocumentation_ConstructorMethod()
        {
            ConstructorInfo method = typeof(DocumentedClass).GetConstructor(new Type[] { });

            Assert.AreEqual("<summary>\nA documented constructor.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(method));
        }
        public void GetXmlDocumentation_ConstructorMethodWithParameters()
        {
            ConstructorInfo method = typeof(DocumentedClass).GetConstructor(new Type[] { typeof(int) });

            Assert.AreEqual("<summary>\nA documented constructor with parameters.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(method));
        }
        public void GetXmlDocumentation_ExplicitConversionOperatorMethod()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("op_Explicit");

            Assert.AreEqual("<summary>\nA documented explicit conversion operator.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(method));
        }
        public void FormatId_Type()
        {
            Type type = typeof(DocumentedClass);

            Assert.AreEqual("T:MbUnit.TestResources.DocumentedClass",
                            XmlDocumentationUtils.FormatId(type));
        }
        public void GetXmlDocumentation_OperatorMethod()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("op_Addition");

            Assert.AreEqual("<summary>\nA documented operator.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(method));
        }
        public void GetXmlDocumentation_GenericIndexer()
        {
            PropertyInfo method = typeof(DocumentedClass.GenericNestedClass <int>).GetProperty("Item");

            Assert.AreEqual("<summary>\nA documented generic indexer.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(method));
        }
        public void FormatId_OverloadedMethodWithParameters()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("DocumentedMethod",
                                                                  new Type[] { typeof(int), typeof(DocumentedClass), typeof(DocumentedClass.GenericNestedClass <int>) });

            Assert.AreEqual("M:MbUnit.TestResources.DocumentedClass.DocumentedMethod(System.Int32,MbUnit.TestResources.DocumentedClass,MbUnit.TestResources.DocumentedClass.GenericNestedClass{System.Int32})",
                            XmlDocumentationUtils.FormatId(method));
        }
        public void GetXmlDocumentation_GenericMethodDefinitionWithParameters()
        {
            MethodInfo method = typeof(DocumentedClass.GenericNestedClass <int>).
                                GetMethod("DocumentedGenericMethodWithParameters").GetGenericMethodDefinition();

            Assert.AreEqual("<summary>\nA documented generic method with parameters.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(method));
        }
        public void GetXmlDocumentation_OverloadedMethodWithParameters()
        {
            MethodInfo method = typeof(DocumentedClass).GetMethod("DocumentedMethod",
                                                                  new Type[] { typeof(int), typeof(DocumentedClass), typeof(DocumentedClass.GenericNestedClass <int>) });

            Assert.AreEqual("<summary>\nA documented overloaded method with parameters.\n</summary>",
                            XmlDocumentationUtils.GetXmlDocumentation(method));
        }
        public void FormatId_GenericMethodDefinitionWithParameters()
        {
            MethodInfo method = typeof(DocumentedClass.GenericNestedClass <int>).
                                GetMethod("DocumentedGenericMethodWithParameters").GetGenericMethodDefinition();

            Assert.AreEqual("M:MbUnit.TestResources.DocumentedClass.GenericNestedClass`1.DocumentedGenericMethodWithParameters``1(``0,`0,System.Int32)",
                            XmlDocumentationUtils.FormatId(method));
        }