public List <MemberAccess> GetHiddenDependenciesForTest(MethodReference refernece)
        {
            var m   = refernece.ThreadSafeResolve();
            var ret = new List <MemberAccess>();

            if (!IsTest(refernece))
            {
                return(ret);
            }
            foreach (var method in m.DeclaringType.GetMethodsInHierarchyWithAttribute("SetUpAttribute"))
            {
                ret.Add(MethodBuildingHelper.BuildMemberAccess(refernece, method));
            }
            foreach (var method in m.DeclaringType.GetMethodsInHierarchyWithAttribute("TestFixtureSetUpAttribute"))
            {
                ret.Add(MethodBuildingHelper.BuildMemberAccess(refernece, method));
            }
            foreach (var method in m.DeclaringType.GetMethodsInHierarchyWithAttribute("TearDownAttribute"))
            {
                ret.Add(MethodBuildingHelper.BuildMemberAccess(refernece, method));
            }
            foreach (var method in m.DeclaringType.GetMethodsInHierarchyWithAttribute("TestFixtureTearDownAttribute"))
            {
                ret.Add(MethodBuildingHelper.BuildMemberAccess(refernece, method));
            }
            return(ret);
        }
Пример #2
0
        public List <MemberAccess> GetHiddenDependenciesForTest(MethodReference refernece)
        {
            var method = refernece.DeclaringType.ThreadSafeResolve().Methods.Where((x) => x.Name == ".ctor").FirstOrDefault();

            if (method == null)
            {
                return(new List <MemberAccess>());
            }
            return(new List <MemberAccess>(method.GetInheritanceHierarchy().Select((x) => MethodBuildingHelper.BuildMemberAccess(refernece, method))));
        }