void AddXmlComment(Test test, ICodeElementInfo element)
        {
            string xml = element.GetXmlDocumentation();

            if (!string.IsNullOrEmpty(xml))
            {
                test.Metadata.Add(MetadataKeys.XmlDocumentation, xml);
            }
        }
Ejemplo n.º 2
0
        private static void PopulateFixtureOrTestMetadata(Test test, ICodeElementInfo codeElement)
        {
            foreach (IgnoreAttribute2 attrib in AttributeUtils.GetAttributes <IgnoreAttribute2>(codeElement, true))
            {
                test.Metadata.Add(MetadataKeys.IgnoreReason, attrib.Description ?? "<unknown>");
            }

            string xmlDocumentation = codeElement.GetXmlDocumentation();

            if (xmlDocumentation != null)
            {
                test.Metadata.Add(MetadataKeys.XmlDocumentation, xmlDocumentation);
            }
        }
Ejemplo n.º 3
0
        private static void PopulateCommonMetadata(ICodeElementInfo codeElement, PropertyBag metadata)
        {
            // Add ignore reason.
            foreach (IgnoreAttribute attr in AttributeUtils.GetAttributes <IgnoreAttribute>(codeElement, true))
            {
                metadata.Add(MetadataKeys.IgnoreReason, attr.Reason ?? "<unknown>");
            }

            // Add documentation.
            string xmlDocumentation = codeElement.GetXmlDocumentation();

            if (!String.IsNullOrEmpty(xmlDocumentation))
            {
                metadata.Add(MetadataKeys.XmlDocumentation, xmlDocumentation);
            }
        }
 void AddXmlComment(Test test, ICodeElementInfo element)
 {
   string xml = element.GetXmlDocumentation();
   if (!string.IsNullOrEmpty(xml))
   {
     test.Metadata.Add(MetadataKeys.XmlDocumentation, xml);
   }
 }
Ejemplo n.º 5
0
        protected static void PopulateMetadata(NUnitTest test)
        {
            NUnit.Core.ITest nunitTest = test.Test;

            if (!String.IsNullOrEmpty(nunitTest.Description))
            {
                test.Metadata.Add(MetadataKeys.Description, nunitTest.Description);
            }

            if (!String.IsNullOrEmpty(nunitTest.IgnoreReason))
            {
                test.Metadata.Add(MetadataKeys.IgnoreReason, nunitTest.IgnoreReason);
            }

            if (nunitTest.Categories != null)
            {
                foreach (string category in nunitTest.Categories)
                {
                    if (!string.IsNullOrEmpty(category))
                    {
                        test.Metadata.Add(MetadataKeys.Category, category);
                    }
                }
            }

            if (nunitTest.Properties != null)
            {
                foreach (DictionaryEntry entry in nunitTest.Properties)
                {
                    if (entry.Key != null && entry.Value != null)
                    {
                        string keyString = entry.Key.ToString();
                        if (!keyString.StartsWith("_") && keyString.Length != 0)
                        {
                            ICollection values = entry.Value as ICollection;
                            if (values != null)
                            {
                                foreach (object value in values)
                                {
                                    if (value != null)
                                    {
                                        test.Metadata.Add(keyString, value.ToString());
                                    }
                                }
                            }
                            else
                            {
                                test.Metadata.Add(keyString, entry.Value.ToString());
                            }
                        }
                    }
                }
            }

            ICodeElementInfo codeElement = test.CodeElement;

            if (codeElement != null)
            {
                // Add documentation.
                string xmlDocumentation = codeElement.GetXmlDocumentation();
                if (xmlDocumentation != null)
                {
                    test.Metadata.Add(MetadataKeys.XmlDocumentation, xmlDocumentation);
                }
            }
        }
Ejemplo n.º 6
0
        private static void PopulateFixtureOrTestMetadata(Test test, ICodeElementInfo codeElement)
        {
            foreach (IgnoreAttribute2 attrib in AttributeUtils.GetAttributes<IgnoreAttribute2>(codeElement, true))
            {
                test.Metadata.Add(MetadataKeys.IgnoreReason, attrib.Description ?? "<unknown>");
            }

            string xmlDocumentation = codeElement.GetXmlDocumentation();
            if (xmlDocumentation != null)
                test.Metadata.Add(MetadataKeys.XmlDocumentation, xmlDocumentation);
        }
Ejemplo n.º 7
0
        private static void PopulateCommonMetadata(ICodeElementInfo codeElement, PropertyBag metadata)
        {
            // Add ignore reason.
            foreach (IgnoreAttribute attr in AttributeUtils.GetAttributes<IgnoreAttribute>(codeElement, true))
            {
                metadata.Add(MetadataKeys.IgnoreReason, attr.Reason ?? "<unknown>");
            }

            // Add documentation.
            string xmlDocumentation = codeElement.GetXmlDocumentation();
            if (!String.IsNullOrEmpty(xmlDocumentation))
            {
                metadata.Add(MetadataKeys.XmlDocumentation, xmlDocumentation);
            }
        }