private void SetupTestsWithAttribute(List <string> result) { System.Type type = this.GetType(); foreach (MethodInfo m in type.GetMethods()) { //Debug.Log("Method detail: " + m.Name); foreach (System.Attribute a in m.GetCustomAttributes(true)) { SimpleTDD.Test test = a as SimpleTDD.Test; if (null == test) { continue; } //Debug.Log("Test Method: " + m.Name); result.Add(m.Name); } } }
public string[] GetTestMethods() { List <string> methodList = new List <string>(); System.Type type = this.GetType(); foreach (MethodInfo m in type.GetMethods()) { //Debug.Log("Method detail: " + m.Name); foreach (System.Attribute a in m.GetCustomAttributes(true)) { SimpleTDD.Test test = a as SimpleTDD.Test; if (null == test) { continue; } //Debug.Log("Test Method: " + m.Name); methodList.Add(m.Name); } } return(methodList.ToArray()); }