public PropertyMember(IType declaringType, string name, string fullName, ITypeInstance <IType> type, bool isCompilerGenerated) { Name = name; FullName = fullName; _typeInstance = type; DeclaringType = declaringType; IsCompilerGenerated = isCompilerGenerated; PropertyTypeDependency = new PropertyTypeDependency(this); }
public bool Equals(PropertyTypeDependency other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(_originMember, other._originMember)); }
public void Execute() { _type.GetFieldMembers().ForEach(field => { var dependency = new FieldTypeDependency(field); AddDependencyIfMissing(field, dependency); }); _type.GetPropertyMembers().ForEach(property => { var dependency = new PropertyTypeDependency(property); AddDependencyIfMissing(property, dependency); }); }
private static object[] BuildPropertyDependencyTestData(Type originType, string originMemberName, Type targetType) { var classMemberInfo = BuildMemberDependencyTestData(originType, originMemberName, targetType); if (!(classMemberInfo.OriginMember is PropertyMember originMember)) { return(new object[] { null, null, null, null }); } var memberTypeDependency = new PropertyTypeDependency(originMember); object duplicateMemberTypeDependency = new PropertyTypeDependency(originMember); var dependencyReferenceDuplicate = memberTypeDependency; object objectReferenceDuplicate = memberTypeDependency; return(new[] { memberTypeDependency, duplicateMemberTypeDependency, dependencyReferenceDuplicate, objectReferenceDuplicate }); }
public void ClassDependencyForPropertyMemberTypesAreCreated() { var expectedDependency = new PropertyTypeDependency(_propertyAMember); Assert.True(_classWithPropertyA.HasDependency(expectedDependency)); }
public void InheritsTypeDependenciesAsExpected() { var expectedDependency = new PropertyTypeDependency(_propertyMember); Assert.True(_implementsAbstractAttribute.HasDependency(expectedDependency)); }