Open.Testing.Models.MethodInfo.IsTestMethod C# (CSharp) Method

IsTestMethod() public static method

Determines whether the specified DictionaryEntry represents a valid test-method.
public static IsTestMethod ( DictionaryEntry item ) : bool
item System.Collections.DictionaryEntry The Dictionaty item to examine.
return bool
        public static bool IsTestMethod(DictionaryEntry item)
        {
            // Setup initial conditions.
            string key = item.Key;
            if (Type.GetScriptType(item.Value) != KeyFunction) return false;

            // Check for special methods.
            if (MethodHelper.IsConstructor(key)) return false;
            if (MethodHelper.IsSpecial(key)) return false;

            // Check for non-method signatures.
            if (key.StartsWith(KeyField)) return false;
            if (key.StartsWith(KeyGetter)) return false;
            if (key.StartsWith(KeySetter)) return false;

            // Finish up.
            return true;
        }