NUnit.Framework.Internal.TestSuite.CheckSetUpTearDownMethods C# (CSharp) Méthode

CheckSetUpTearDownMethods() protected méthode

Check that setup and teardown methods marked by certain attributes meet NUnit's requirements and mark the tests not runnable otherwise.
protected CheckSetUpTearDownMethods ( Type attrType ) : void
attrType Type The attribute type to check for
Résultat void
        protected void CheckSetUpTearDownMethods(Type attrType)
        {
            foreach (MethodInfo method in Reflect.GetMethodsWithAttribute(TypeInfo.Type, attrType, true))
                if (method.IsAbstract ||
                     !method.IsPublic && !method.IsFamily ||
                     method.GetParameters().Length > 0 ||
                     method.ReturnType != typeof(void)
#if ASYNC
                     &&
                     method.ReturnType != typeof(Task)
#endif
                    )
                {
                    this.Properties.Set(
                        PropertyNames.SkipReason,
                        string.Format("Invalid signature for SetUp or TearDown method: {0}", method.Name));
                    this.RunState = RunState.NotRunnable;
                    break;
                }
        }