private MetadataMethodInfoAdapter2(MetadataTypeInfoAdapter2 typeInfo, IMetadataMethod method, ITypeInfo[] substitutions) { this.typeInfo = typeInfo; this.method = method; this.substitutions = substitutions; }
public bool IsValidTestMethod(IProject project, IMetadataMethod metadataMethod) { if (project == null || metadataMethod == null) return false; return IsValidTestMethod(project, metadataMethod.DeclaringType.FullyQualifiedName, metadataMethod.Name); }
private bool IsTestMethod(IMetadataMethod method) { if (method.IsAbstract || !method.IsPublic) { return(false); } return(HasAttributeOrDerivedAttribute(method, UnityTestProvider.UnityTestAttribute)); }
public static MethodModifiers FromMethod(IMetadataMethod method) { if (method == null) { throw new ArgumentNullException(nameof(method)); } return(new MethodModifiers(method.Visibility, method.IsStatic, method.IsAbstract, method.IsVirtual, method.IsFinal, method.IsOverride)); }
public bool IsValidTestMethod(IProject project, IMetadataMethod metadataMethod) { if (project == null || metadataMethod == null) { return(false); } return(IsValidTestMethod(project, metadataMethod.DeclaringType.FullyQualifiedName, metadataMethod.Name)); }
public ReaderProperty(MetadataReader reader, TypeReferenceTypeProvider typeProvider, PropertyDefinition definition, GenericContext genericContext, IMetadataMethod getAccessor, IMetadataMethod setAccessor) { this.reader = reader; this.typeProvider = typeProvider; this.definition = definition; this.genericContext = genericContext; GetAccessor = getAccessor; SetAccessor = setAccessor; }
public ReaderEvent(MetadataReader reader, TypeReferenceTypeProvider typeProvider, EventDefinition definition, GenericContext genericContext, IMetadataMethod addAccessor, IMetadataMethod removeAccessor, IMetadataMethod raiseAccessor) { this.reader = reader; this.typeProvider = typeProvider; this.definition = definition; this.genericContext = genericContext; AddAccessor = addAccessor; RemoveAccessor = removeAccessor; RaiseAccessor = raiseAccessor; }
private static string GetAttributeName(IMetadataCustomAttribute attribute) { IMetadataMethod constructor = attribute.UsedConstructor; if (constructor == null) { return(null); } IMetadataTypeInfo declaringType = constructor.DeclaringType; if (declaringType == null) { return(null); } return(declaringType.FullyQualifiedName); }
private static bool IsTestMethod(IMetadataMethod method) { if (method.IsStatic || method.IsAbstract || !method.IsPublic) { return(false); } if (method.Parameters.Length != 0 || method.GenericArguments.Length != 0) { return(false); } if (!method.ReturnValue.Type.PresentableName.StartsWith("System.Void")) { return(false); } if (method.HasCustomAttribute(TestAttribute.ClrName)) { return(true); } return(false); }
private static bool IsTestMethod(IMetadataMethod method) { if (method.IsStatic || method.IsAbstract || !method.IsPublic) { return(false); } if (method.Parameters.Length != 0 || method.GenericArguments.Length != 0) { return(false); } if (!method.ReturnValue.Type.AssemblyQualifiedName.StartsWith("System.Void")) { return(false); } if (method.HasCustomAttribute(TestAttribute.ClrName)) { return(true); } if (method.Name.StartsWith("test", true, CultureInfo.InvariantCulture)) { IMetadataCustomAttribute[] attributes = method.CustomAttributes; foreach (IMetadataCustomAttribute attribute in attributes) { string name = GetAttributeName(attribute); if (name != null && name.StartsWith("csUnit.")) { return(false); } } return(true); } return(false); }
public MetadataMethodInfoAdapter(IMetadataMethod method) { this.method = method; }
public static CommonMember ToCommon(this IMetadataMethod member) { return(IntrospectionUtility.Instance.GetCommonMember(member)); }
public MetadataMethodInfoAdapter2(MetadataTypeInfoAdapter2 typeInfo, IMetadataMethod method) : this(typeInfo, method, null) { }
private void ExploreMethod(IProject project, IMetadataAssembly metadataAssembly, UnitTestElementConsumer consumer, IMetadataMethod metadataMethod) { if (conventionCheck.IsValidTestMethod(project, metadataMethod)) { bool isParameterised = conventionCheck.IsParameterizedMethod( project, metadataMethod.DeclaringType.FullyQualifiedName, metadataMethod.Name); var methodUnitTestElement = unitTestElementFactory.GetOrCreateTestMethod(project, new ClrTypeName(metadataMethod.DeclaringType.FullyQualifiedName), metadataMethod.Name, metadataAssembly.Location.FullPath, isParameterised); consumer(methodUnitTestElement); } }
public MetadataMethodWrapper(IMetadataMethod metadataMethod) { this.metadataMethod = metadataMethod; }
private bool HasAttributeOrDerivedAttribute(IMetadataMethod method, params IClrTypeName[] attributeClrNames) { return(myUnitTestAttributeCache.HasAttributeOrDerivedAttribute(myProject, method, attributeClrNames)); }
public CommonMember GetCommonMember(IMetadataMethod member) { return(GetCommonMember(member, member.ReturnValue.Type)); }
public static IMethodInfo AsMethodInfo(this IMetadataMethod method) { return(new MetadataMethodInfoAdapter(method)); }