Пример #1
0
        private void TestMethodMember(string methodName, string theXml)
        {
            TypeDefinition theclass = GetTypeDef <ConcreteClass>();

            XmlDocument document = new XmlDocument();

            document.LoadXml(theXml);

            var member = DocumentationEnumerator.GetMember(theclass, new DocumentationMember(document.FirstChild, FrameworkTypeEntry.Empty));

            Assert.NotNull(member, "didn't find the node");
            Assert.AreEqual(methodName, member.Name);
        }
Пример #2
0
        private void testReturnType(string methName, string r)
        {
            TypeDefinition theclass = GetTypeDef <ConcreteClass>();

            XmlDocument doc = new XmlDocument();

            doc.LoadXml(@"<Member MemberName=""" + methName + @""">
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>" + r + @"</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name=""value"" Type=""mdoc.Test.EnumeratorTests+ConcreteClass"" />
      </Parameters>
    </Member>");

            DocumentationMember docmember = new DocumentationMember(doc.DocumentElement, typeEntry: null);
            var result = DocumentationEnumerator.GetMember(theclass, docmember) as MethodReference;

            Assert.IsNotNull(result);
            Assert.AreEqual(methName, result.Name);
            Assert.AreEqual(r, result.ReturnType.FullName);
        }