System.ASSERT.AssertIsFriend C# (CSharp) Method

AssertIsFriend() private static method

private static AssertIsFriend ( Type friends, StackTrace st ) : bool
friends Type
st System.Diagnostics.StackTrace
return bool
        private static bool AssertIsFriend(Type[] friends, StackTrace st)
        {
            Type declaringType = st.GetFrame(1).GetMethod().DeclaringType;
            Type type2 = st.GetFrame(2).GetMethod().DeclaringType;
            bool flag = true;
            foreach (Type type3 in friends)
            {
                if ((type2 != type3) && (type2 != declaringType))
                {
                    flag = false;
                }
            }
            if (flag)
            {
                Assert(false, Environment.GetResourceString("RtType.InvalidCaller"), st.ToString());
            }
            return true;
        }