Example #1
0
        public void ParseMemberElement()
        {
            XmlDocumentationsUtility.MemberData memberData;

            memberData = XmlDocumentationsUtility.ParseMemberElement("M:Analysis.DataTypes.SurfaceAnalysisData.BySurfacePointsAndResults" +
                                                                     "(Autodesk.DesignScript.Geometry.Surface,System.Collections.Generic.IEnumerable{Autodesk.DesignScript.Geometry.UV}," +
                                                                     "System.Collections.Generic.IList{System.String},System.Collections.Generic.IList{System.Collections.Generic.IList{System.Double}})");

            Assert.IsTrue(memberData.type == XmlDocumentationsUtility.Type.Method);
            Assert.IsTrue(memberData.TypeName == "Analysis.DataTypes.SurfaceAnalysisData");
            Assert.IsTrue(memberData.MemberName == "BySurfacePointsAndResults");
        }
Example #2
0
        public void RemoveDocumentationForHiddenNodes()
        {
            ZeroTouchModule module = new ZeroTouchModule("ProtoGeometry.dll");

            XmlDocumentationsUtility.RemoveDocumentationForHiddenNodes("ProtoGeometry.xml", module);
            XmlDocument xmlTestFile = new XmlDocument();

            xmlTestFile.Load("ProtoGeometry.xml");

            XmlNodeList elemTestList = xmlTestFile.GetElementsByTagName("member");

            for (int i = 0; i < elemTestList.Count; i++)
            {
                var memberElement = XmlDocumentationsUtility.ParseMemberElement(elemTestList[i].Attributes["name"].Value);

                switch (memberElement.type)
                {
                case XmlDocumentationsUtility.Type.Field:

                case XmlDocumentationsUtility.Type.Property:

                    Assert.IsTrue(module.PropertyExists(memberElement.TypeName, memberElement.MemberName));
                    break;

                case XmlDocumentationsUtility.Type.Method:

                    Assert.IsTrue(module.MethodExists(memberElement.TypeName, memberElement.MemberName));
                    break;

                case XmlDocumentationsUtility.Type.Type:

                    Assert.IsTrue(module.TypeExists(memberElement.TypeName));
                    break;

                default: break;
                }
            }
        }