/// <summary> /// Return an IEnumerable providing data for use with the /// supplied parameter. /// </summary> /// <param name="parameter">A ParameterInfo representing one /// argument to a parameterized test</param> /// <returns>An IEnumerable providing the required data</returns> public IEnumerable GetDataFor(ParameterInfo parameter, Test suite) { ArrayList list = new ArrayList(); foreach (IDataPointProvider provider in Extensions) { if (provider is IDataPointProvider2) { IDataPointProvider2 provider2 = (IDataPointProvider2)provider; if (provider2.HasDataFor(parameter, suite)) { foreach (object o in provider2.GetDataFor(parameter, suite)) { list.Add(o); } } } else if (provider.HasDataFor(parameter)) { foreach (object o in provider.GetDataFor(parameter)) { list.Add(o); } } } return(list); }
public bool HasTestCasesFor(System.Reflection.MethodInfo method) { if (method.GetParameters().Length == 0) { return(false); } foreach (ParameterInfo parameter in method.GetParameters()) { if (!dataPointProvider.HasDataFor(parameter)) { return(false); } } return(true); }
/// <summary> /// Determine whether any data is available for a parameter. /// </summary> /// <param name="parameter">A ParameterInfo representing one /// argument to a parameterized test</param> /// <returns>True if any data is available, otherwise false.</returns> public bool HasDataFor(ParameterInfo parameter, Test suite) { foreach (IDataPointProvider provider in Extensions) { if (provider is IDataPointProvider2) { IDataPointProvider2 provider2 = (IDataPointProvider2)provider; if (provider2.HasDataFor(parameter, suite)) { return(true); } } else if (provider.HasDataFor(parameter)) { return(true); } } return(false); }