[NUI] Rebase develnui (DevelNUI only patches --> master) (#3910)
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Devel.Tests.Ubuntu / nunit.framework / Internal / TestCaseParameters.cs
1 // ***********************************************************************
2 // Copyright (c) 2008-2015 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 NUnit.Framework.Interfaces;
31
32 namespace NUnit.Framework.Internal
33 {
34     /// <summary>
35     /// The TestCaseParameters class encapsulates method arguments and
36     /// other selected parameters needed for constructing
37     /// a parameterized test case.
38     /// </summary>
39     public class TestCaseParameters : TestParameters, ITestCaseData, IApplyToTest
40     {
41         #region Instance Fields
42
43         /// <summary>
44         /// The expected result to be returned
45         /// </summary>
46         private object _expectedResult;
47
48         #endregion
49
50         #region Constructors
51
52         /// <summary>
53         /// Default Constructor creates an empty parameter set
54         /// </summary>
55         public TestCaseParameters() { }
56
57         /// <summary>
58         /// Construct a non-runnable ParameterSet, specifying
59         /// the provider exception that made it invalid.
60         /// </summary>
61         public TestCaseParameters(Exception exception) : base(exception) { }
62
63         /// <summary>
64         /// Construct a parameter set with a list of arguments
65         /// </summary>
66         /// <param name="args"></param>
67         public TestCaseParameters(object[] args) : base(args) { }
68
69         /// <summary>
70         /// Construct a ParameterSet from an object implementing ITestCaseData
71         /// </summary>
72         /// <param name="data"></param>
73         public TestCaseParameters(ITestCaseData data) : base(data)
74         {
75             if (data.HasExpectedResult)
76                 ExpectedResult = data.ExpectedResult;
77         }
78
79         #endregion
80
81         #region ITestCaseData Members
82
83         /// <summary>
84         /// The expected result of the test, which
85         /// must match the method return type.
86         /// </summary>
87         public object ExpectedResult
88         {
89             get { return _expectedResult; }
90             set
91             {
92                 _expectedResult = value;
93                 HasExpectedResult = true;
94             }
95         }
96
97         /// <summary>
98         /// Gets a value indicating whether an expected result was specified.
99         /// </summary>
100         public bool HasExpectedResult { get; set; }
101
102         #endregion
103     }
104 }