[NUI] Rebase develnui (DevelNUI only patches --> master) (#3910)
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Devel.Tests.Ubuntu / nunit.framework / Api / ITestAssemblyRunner.cs
1 // ***********************************************************************
2 // Copyright (c) 2009 Charlie Poole
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to
9 // permit persons to whom the Software is furnished to do so, subject to
10 // the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be
13 // included in all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 // ***********************************************************************
23 #define PORTABLE
24 #define TIZEN
25 #define NUNIT_FRAMEWORK
26 #define NUNITLITE
27 #define NET_4_5
28 #define PARALLEL
29 using System;
30 using System.Collections.Generic;
31 using System.Reflection;
32 using NUnit.Framework.Interfaces;
33
34 namespace NUnit.Framework.Api
35 {
36     /// <summary>
37     /// The ITestAssemblyRunner interface is implemented by classes
38     /// that are able to execute a suite of tests loaded
39     /// from an assembly.
40     /// </summary>
41     public interface ITestAssemblyRunner
42     {
43         #region Properties
44
45         /// <summary>
46         /// Gets the tree of loaded tests, or null if
47         /// no tests have been loaded.
48         /// </summary>
49         ITest LoadedTest { get; }
50
51         /// <summary>
52         /// Gets the tree of test results, if the test
53         /// run is completed, otherwise null.
54         /// </summary>
55         ITestResult Result { get; }
56
57         /// <summary>
58         /// Indicates whether a test has been loaded
59         /// </summary>
60         bool IsTestLoaded { get; }
61
62         /// <summary>
63         /// Indicates whether a test is currently running
64         /// </summary>
65         bool IsTestRunning { get; }
66
67         /// <summary>
68         /// Indicates whether a test run is complete
69         /// </summary>
70         bool IsTestComplete { get; }
71
72         #endregion
73
74         #region Methods
75
76         /// <summary>
77         /// Loads the tests found in an Assembly, returning an
78         /// indication of whether or not the load succeeded.
79         /// </summary>
80         /// <param name="assemblyName">File name of the assembly to load</param>
81         /// <param name="settings">Dictionary of options to use in loading the test</param>
82         /// <returns>An ITest representing the loaded tests</returns>
83         ITest Load(string assemblyName, IDictionary<string, object> settings);
84
85         /// <summary>
86         /// Loads the tests found in an Assembly, returning an
87         /// indication of whether or not the load succeeded.
88         /// </summary>
89         /// <param name="assembly">The assembly to load</param>
90         /// <param name="settings">Dictionary of options to use in loading the test</param>
91         /// <returns>An ITest representing the loaded tests</returns>
92         ITest Load(Assembly assembly, IDictionary<string, object> settings);
93
94         /// <summary>
95         /// Count Test Cases using a filter
96         /// </summary>
97         /// <param name="filter">The filter to apply</param>
98         /// <returns>The number of test cases found</returns>
99         int CountTestCases(ITestFilter filter);
100
101         /// <summary>
102         /// Run selected tests and return a test result. The test is run synchronously,
103         /// and the listener interface is notified as it progresses.
104         /// </summary>
105         /// <param name="listener">Interface to receive ITestListener notifications.</param>
106         /// <param name="filter">A test filter used to select tests to be run</param>
107         ITestResult Run(ITestListener listener, ITestFilter filter);
108
109         /// <summary>
110         /// Run selected tests asynchronously, notifying the listener interface as it progresses.
111         /// </summary>
112         /// <param name="listener">Interface to receive EventListener notifications.</param>
113         /// <param name="filter">A test filter used to select tests to be run</param>
114         void RunAsync(ITestListener listener, ITestFilter filter);
115
116         /// <summary>
117         /// Wait for the ongoing run to complete.
118         /// </summary>
119         /// <param name="timeout">Time to wait in milliseconds</param>
120         /// <returns>True if the run completed, otherwise false</returns>
121         bool WaitForCompletion(int timeout);
122
123         /// <summary>
124         /// Signal any test run that is in process to stop. Return without error if no test is running.
125         /// </summary>
126         /// <param name="force">If true, kill any test-running threads</param>
127         void StopRun(bool force);
128
129         #endregion
130
131                 #if TIZEN
132                 Dictionary<string, ITest> GetTestcaseIDList();
133                 #endif
134     }
135 }