예제 #1
0
        public void GetCommentIdForProperty_ReturnsCorrectXmlCommentId_ForGivenPropertyInfo(
            Type type,
            string propertyName,
            string expectedCommentId
            )
        {
            var propertyInfo = type.GetProperty(propertyName);

            var commentId = XmlCommentsIdHelper.GetCommentIdForProperty(propertyInfo);

            Assert.Equal(expectedCommentId, commentId);
        }
예제 #2
0
        private void ApplyPropertyComments(Schema propertySchema, PropertyInfo propertyInfo)
        {
            if (propertyInfo == null)
            {
                return;
            }

            var commentId    = XmlCommentsIdHelper.GetCommentIdForProperty(propertyInfo);
            var propertyNode = _navigator.SelectSingleNode(string.Format(MemberXPath, commentId));

            if (propertyNode == null)
            {
                return;
            }

            var propSummaryNode = propertyNode.SelectSingleNode(SummaryTag);

            if (propSummaryNode != null)
            {
                propertySchema.description = propSummaryNode.ExtractContent();
            }
        }