示例#1
0
        public void DocidCheck()
        {
            XmlDocument doc = new System.Xml.XmlDocument();

            doc.LoadXml(XmlConsts.CheckDocidXml);

            //c# MemberSignature is the same,but docid not
            var listA = doc.SelectNodes("/Type/Members/Member[@MemberName='op_Implicit']");

            if (listA.Count == 2)
            {
                var Notequal = DocUtils.DocIdCheck(listA[0], (XmlElement)listA[1]);
                Assert.IsTrue(Notequal);
            }

            //note:c not have docid item in xml
            var b = doc.SelectSingleNode("/Type/Members/Member[@MemberName='op_Implicit']");
            var c = doc.SelectSingleNode("/Type/Members/Member[@MemberName='.ctor']");

            var flg1 = DocUtils.DocIdCheck(b, (XmlElement)c);

            Assert.IsFalse(flg1);

            //Parameter change position
            var flg2 = DocUtils.DocIdCheck(c, (XmlElement)b);

            Assert.IsFalse(flg2);

            // c# MemberSignature is not same,docid also
            var d    = doc.SelectSingleNode("/Type/Members/Member[@MemberName='Value']");
            var flg3 = DocUtils.DocIdCheck(b, (XmlElement)d);

            Assert.IsTrue(flg3);
        }