public IEnumerable <TestMethod> BuildFrom(IMethodInfo method, global::NUnit.Framework.Internal.Test suite) { var builder = new NUnitTestCaseBuilder(); foreach (var sourceFilePath in Directory.EnumerateFiles(Path, SearchPattern, SearchOption)) { yield return(builder.BuildTestMethod( method, suite, new TestCaseParameters(new object[] { new AnnotatedSourceFile(sourceFilePath) }))); } }
public TestMethod BuildFrom(IMethodInfo method, global::NUnit.Framework.Internal.Test suite) { var index = suite.TypeInfo.Type.GetMethods() .Where(info => info.GetCustomAttributes <SmokeTestAttribute>().Any()) .OrderBy(info => info.GetCustomAttribute <SmokeTestAttribute>()._lineNumber) .ToList() .IndexOf(method.MethodInfo); var testMethod = _builder.BuildTestMethod(method, suite, new TestCaseParameters { TestName = index.ToString("D3") + " " + method.Name.Replace('_', ' ') }); return(testMethod); }
public void ApplyToTest(global::NUnit.Framework.Internal.Test test) { test.Properties.Set(PropertyNames.Order, _lineNumber); }