[NUI] Rebase develnui (DevelNUI only patches --> master) (#3910)
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Devel.Tests.Ubuntu / nunit.framework / Internal / Commands / TestCommand.cs
1 // ***********************************************************************
2 // Copyright (c) 2010 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.Threading;
30
31 namespace NUnit.Framework.Internal.Commands
32 {
33     /// <summary>
34     /// TestCommand is the abstract base class for all test commands
35     /// in the framework. A TestCommand represents a single stage in
36     /// the execution of a test, e.g.: SetUp/TearDown, checking for
37     /// Timeout, verifying the returned result from a method, etc.
38     /// 
39     /// TestCommands may decorate other test commands so that the
40     /// execution of a lower-level command is nested within that
41     /// of a higher level command. All nested commands are executed
42     /// synchronously, as a single unit. Scheduling test execution
43     /// on separate threads is handled at a higher level, using the
44     /// task dispatcher.
45     /// </summary>
46     public abstract class TestCommand
47     {
48         /// <summary>
49         /// Construct a TestCommand for a test.
50         /// </summary>
51         /// <param name="test">The test to be executed</param>
52         public TestCommand(Test test)
53         {
54             this.Test = test;
55         }
56
57         #region Public Methods
58
59         /// <summary>
60         /// Gets the test associated with this command.
61         /// </summary>
62         public Test Test { get; private set; }
63
64         /// <summary>
65         /// Runs the test in a specified context, returning a TestResult.
66         /// </summary>
67         /// <param name="context">The TestExecutionContext to be used for running the test.</param>
68         /// <returns>A TestResult</returns>
69         public abstract TestResult Execute(TestExecutionContext context);
70
71         #endregion
72
73         #region tronghieu.d - Declear ManualResetEvent object for block current thread to handle result from invoking test method.
74
75         public ManualResetEvent _testMethodRunComplete = new ManualResetEvent(false);
76
77         #endregion
78     }
79 }