Example #1
0
        private string GetText(IClass clazz)
        {
            var subjectAttribute = clazz.DescendantsAndSelf(x => x.GetContainingType() as IClass)
                                   .Select(x => x.GetAttributeData(MSpecUtility.SubjectAttributeFullName)).WhereNotNull().First();

            var subjectTypes = subjectAttribute.PositionParameters().Select(x => x.TypeValue).WhereNotNull();
            var subjectText  = subjectAttribute.PositionParameters().Select(x => x.ConstantValue.Value as string).WhereNotNull().FirstOrDefault();

            return(MSpecUtility.CreateText(clazz.ToCommon(), subjectTypes.SingleOrDefault()?.ToCommon(), subjectText));
        }