Esempio n. 1
0
 public static bool HasMethodSignatureDependency(this IMember member,
                                                 MethodSignatureDependency methodSignatureDependency, bool getBackwardsDependencies = false)
 {
     return(getBackwardsDependencies
         ? member.MemberBackwardsDependencies.OfType <MethodSignatureDependency>()
            .Contains(methodSignatureDependency)
         : member.MemberDependencies.OfType <MethodSignatureDependency>().Contains(methodSignatureDependency));
 }
        private static object[] BuildMethodSignatureDependencyTestData(Type originType,
                                                                       string nameOfOriginMember, Type targetType)
        {
            var originClass        = Architecture.GetClassOfType(originType);
            var originMember       = originClass.GetMethodMembersWithName(nameOfOriginMember).Single();
            var target             = Architecture.GetITypeOfType(targetType);
            var expectedDependency = new MethodSignatureDependency(originMember, target);

            return(new object[] { originMember, expectedDependency });
        }
Esempio n. 3
0
        public bool Equals(MethodSignatureDependency other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Equals(OriginMember, other.OriginMember) && Equals(Target, other.Target));
        }
Esempio n. 4
0
        private static object[] BuildMethodSignatureDependencyTestData(Type originType, string originMemberName,
                                                                       Type targetType)
        {
            var classMemberInfo = BuildMemberDependencyTestData(originType, originMemberName, targetType);

            if (!(classMemberInfo.OriginMember is MethodMember originMember))
            {
                return(new object[] { null, null, null, null });
            }

            var    memberTypeDependency          = new MethodSignatureDependency(originMember, classMemberInfo.TargetClass);
            object duplicateMemberTypeDependency =
                new MethodSignatureDependency(originMember, classMemberInfo.TargetClass);
            var    dependencyReferenceDuplicate = memberTypeDependency;
            object objectReferenceDuplicate     = memberTypeDependency;

            return(new[]
            {
                memberTypeDependency, duplicateMemberTypeDependency, dependencyReferenceDuplicate,
                objectReferenceDuplicate
            });
        }
 public void MethodSignatureDependenciesAreFound(MethodMember originMember,
                                                 MethodSignatureDependency expectedDependency)
 {
     Assert.True(originMember.HasMethodSignatureDependency(expectedDependency));
 }