PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/NUnit/interfaces/Extensibility/ITestCaseProvider.cs

#
C# | 60 lines | 15 code | 5 blank | 40 comment | 0 complexity | 551d24a450fb4f3897e57b51e1b9df35 MD5 | raw file
 1// ****************************************************************
 2// Copyright 2008, Charlie Poole
 3// This is free software licensed under the NUnit license. You may
 4// obtain a copy of the license at http://nunit.org
 5// ****************************************************************
 6
 7using System.Collections;
 8using System.Reflection;
 9
10namespace NUnit.Core.Extensibility
11{
12    /// <summary>
13    /// The ITestCaseProvider interface is used by extensions
14    /// that provide data for parameterized tests, along with
15    /// certain flags and other indicators used in the test.
16    /// </summary>
17    public interface ITestCaseProvider
18    {
19        /// <summary>
20        /// Determine whether any test cases are available for a parameterized method.
21        /// </summary>
22        /// <param name="method">A MethodInfo representing a parameterized test</param>
23        /// <returns>True if any cases are available, otherwise false.</returns>
24        bool HasTestCasesFor(MethodInfo method);
25
26        /// <summary>
27        /// Return an IEnumerable providing test cases for use in
28        /// running a paramterized test.
29        /// </summary>
30        /// <param name="method"></param>
31        /// <returns></returns>
32        IEnumerable GetTestCasesFor(MethodInfo method);
33    }
34
35    /// <summary>
36    /// ITestCaseProvider2 extends ITestCaseProvider with methods
37    /// that include the suite for which the test case is being
38    /// built. TestCaseProviders not needing the suite can
39    /// continue to implement ITestCaseBuilder.
40    /// </summary>
41    public interface ITestCaseProvider2 : ITestCaseProvider
42    {
43        /// <summary>
44        /// Determine whether any test cases are available for a parameterized method.
45        /// </summary>
46        /// <param name="method">A MethodInfo representing a parameterized test</param>
47        /// <param name="suite">The suite for which the test case is being built</param>
48        /// <returns>True if any cases are available, otherwise false.</returns>
49        bool HasTestCasesFor(MethodInfo method, Test suite);
50
51        /// <summary>
52        /// Return an IEnumerable providing test cases for use in
53        /// running a paramterized test.
54        /// </summary>
55        /// <param name="method"></param>
56        /// <param name="suite">The suite for which the test case is being built</param>
57        /// <returns></returns>
58        IEnumerable GetTestCasesFor(MethodInfo method, Test suite);
59    }
60}