public IEnumerable <IMethodInfo> EnumerateTestMethods() { return(from m in _inner.EnumerateTestMethods() let priority = GetPriority(m) orderby priority select m); }
protected IEnumerable <MethodResult> RunClass(Type typeUnderTest) { ITestClassCommand testClassCommand = new TestClassCommand(typeUnderTest); ClassResult classResult = TestClassCommandRunner.Execute( testClassCommand, testClassCommand.EnumerateTestMethods().ToList(), startCallback: null, resultCallback: null); return(classResult.Results.OfType <MethodResult>()); }
public IMessageSinkMessage[] Run(Type feature) { var command = new TestClassCommand(feature); IMessageSinkMessage[] results = null; var thread = new Thread(() => results = TestClassCommandRunner .Execute(command, command.EnumerateTestMethods().ToList(), null, null) .Results .Select(Map) .Where(message => message != null) .ToArray()); thread.Start(); thread.Join(); return(results); }
public virtual IEnumerable <IMethodInfo> EnumerateTestMethods() { var sortedMethods = new SortedDictionary <int, List <IMethodInfo> >(); foreach (var method in _cmd.EnumerateTestMethods()) { var priority = 0; foreach (var attr in method.GetCustomAttributes(typeof(MyFactAttribute))) { priority = attr.GetPropertyValue <int>(MyFactAttribute.PriorityMemberName); } GetOrCreate(sortedMethods, priority).Add(method); } return(sortedMethods.Keys.SelectMany(priority => sortedMethods[priority])); }
public IEnumerable <IMethodInfo> EnumerateTestMethods() { string category; IAttributeInfo sampleTraitAttrib = null; List <IMethodInfo> uncategorisedMethods = new List <IMethodInfo>(); foreach (IMethodInfo method in cmd.EnumerateTestMethods()) { category = string.Empty; foreach (IAttributeInfo attr in method.GetCustomAttributes(typeof(TestCategoryAttribute))) { if (sampleTraitAttrib == null) { sampleTraitAttrib = attr; } category = attr.GetPropertyValue <string>("Value"); } if (!String.IsNullOrEmpty(category)) { yield return(method); } else { uncategorisedMethods.Add(method); } } if (sampleTraitAttrib != null) { foreach (IMethodInfo method in uncategorisedMethods) { yield return(new MethodInfoWithOnlyDefaultCustomAttribute(method, sampleTraitAttrib)); } } else { foreach (IMethodInfo method in uncategorisedMethods) { yield return(method); } } }
public IEnumerable <IMethodInfo> EnumerateTestMethods() { var sortedMethods = new SortedDictionary <int, List <IMethodInfo> >(); foreach (IMethodInfo method in cmd.EnumerateTestMethods()) { int priority = 0; foreach (IAttributeInfo attr in method.GetCustomAttributes(typeof(TestPriorityAttribute))) { priority = attr.GetPropertyValue <int>("Priority"); } GetOrCreate(sortedMethods, priority).Add(method); } foreach (int priority in sortedMethods.Keys) { foreach (IMethodInfo method in sortedMethods[priority]) { yield return(method); } } }
public IEnumerable <IMethodInfo> EnumerateTestMethods() { EnumerateTestMethods__Called = true; return(EnumerateTestMethods__Result ?? testClassCommand.EnumerateTestMethods()); }
public IEnumerable <IMethodInfo> EnumerateTestMethods() { return(_cmd.EnumerateTestMethods()); }
/// <inheritdoc/> public IEnumerable <IMethodInfo> EnumerateTestMethods() { return(_testClassCommand.EnumerateTestMethods()); }
public static IEnumerable <MethodResult> Run(Type featureDefinition) { var feature = new TestClassCommand(featureDefinition); MethodResult[] results = null; var thread = new Thread(() => results = TestClassCommandRunner.Execute(feature, feature.EnumerateTestMethods().ToList(), startCallback: null, resultCallback: null).Results .OfType <MethodResult>().ToArray()); thread.Start(); thread.Join(); return(results); }