コード例 #1
0
 public IEnumerable <XunitAttributeInfo> GetCustomAttributes(Type attributeType)
 {
     foreach (IAttributeInfo attribute in target.GetAttributeInfos(Reflector.Wrap(attributeType), true))
     {
         yield return(new XunitAttributeInfoAdapter(attribute));
     }
 }
コード例 #2
0
ファイル: MSTestExplorer.cs プロジェクト: citizenmatt/gallio
        private static bool IsFixture(ITypeInfo type)
        {
            IEnumerable <IAttributeInfo> attributes = type.GetAttributeInfos(null, true);

            foreach (IAttributeInfo attribute in attributes)
            {
                if (attribute.Type.FullName.CompareTo(MSTestAttributes.TestClassAttribute) == 0)
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
ファイル: MSTestExplorer.cs プロジェクト: citizenmatt/gallio
        private static void PopulateTestClassMetadata(ITypeInfo typeInfo, MSTest typeTest)
        {
            IEnumerable <IAttributeInfo> attributes = typeInfo.GetAttributeInfos(null, true);

            foreach (IAttributeInfo attribute in attributes)
            {
                switch (attribute.Type.FullName)
                {
                case MSTestAttributes.DeploymentItemAttribute:
                    AddDeploymentItem(attribute, typeTest);
                    break;

                case MSTestAttributes.IgnoreAttribute:
                    typeTest.Metadata.Add(MetadataKeys.IgnoreReason, Resources.MSTestExplorer_IgnoreAttributeWasAppliedToClass);
                    break;

                default:
                    break;
                }
            }
        }
コード例 #4
0
        private static bool IsFixture(ITypeInfo type)
        {
            IEnumerable<IAttributeInfo> attributes = type.GetAttributeInfos(null, true);
            foreach (IAttributeInfo attribute in attributes)
            {
                if (attribute.Type.FullName.CompareTo(MSTestAttributes.TestClassAttribute) == 0)
                {
                    return true;
                }
            }

            return false;
        }
コード例 #5
0
 private static void PopulateTestClassMetadata(ITypeInfo typeInfo, MSTest typeTest)
 {
     IEnumerable<IAttributeInfo> attributes = typeInfo.GetAttributeInfos(null, true);
     foreach (IAttributeInfo attribute in attributes)
     {
         switch (attribute.Type.FullName)
         {
             case MSTestAttributes.DeploymentItemAttribute:
                 AddDeploymentItem(attribute, typeTest);
                 break;
             case MSTestAttributes.IgnoreAttribute:
                 typeTest.Metadata.Add(MetadataKeys.IgnoreReason, Resources.MSTestExplorer_IgnoreAttributeWasAppliedToClass);
                 break;
             default:
                 break;
         }
     }
 }