Exemple #1
0
 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);
 }
Exemple #2
0
        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);
            });
        }
Exemple #4
0
        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
            });
        }
Exemple #5
0
        public void ClassDependencyForPropertyMemberTypesAreCreated()
        {
            var expectedDependency = new PropertyTypeDependency(_propertyAMember);

            Assert.True(_classWithPropertyA.HasDependency(expectedDependency));
        }
Exemple #6
0
        public void InheritsTypeDependenciesAsExpected()
        {
            var expectedDependency = new PropertyTypeDependency(_propertyMember);

            Assert.True(_implementsAbstractAttribute.HasDependency(expectedDependency));
        }