[NUI] Rebase develnui (DevelNUI only patches --> master) (#3910)
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Devel.Tests.Ubuntu / nunit.framework / Assert / Assert.Types.cs
1 // ***********************************************************************
2 // Copyright (c) 2014 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
24 using System;
25
26 namespace NUnit.Framework
27 {
28     public partial class Assert
29     {
30         #region IsAssignableFrom
31
32         /// <summary>
33         /// Asserts that an object may be assigned a  value of a given Type.
34         /// </summary>
35         /// <param name="expected">The expected Type.</param>
36         /// <param name="actual">The object under examination</param>
37         /// <param name="message">The message to display in case of failure</param>
38         /// <param name="args">Array of objects to be used in formatting the message</param>
39         public static void IsAssignableFrom(Type expected, object actual, string message, params object[] args)
40         {
41             Assert.That(actual, Is.AssignableFrom(expected) ,message, args);
42         }
43
44         /// <summary>
45         /// Asserts that an object may be assigned a  value of a given Type.
46         /// </summary>
47         /// <param name="expected">The expected Type.</param>
48         /// <param name="actual">The object under examination</param>
49         public static void IsAssignableFrom(Type expected, object actual)
50         {
51             Assert.That(actual, Is.AssignableFrom(expected) ,null, null);
52         }
53
54         #endregion
55
56         #region IsAssignableFrom<TExpected>
57
58         /// <summary>
59         /// Asserts that an object may be assigned a  value of a given Type.
60         /// </summary>
61         /// <typeparam name="TExpected">The expected Type.</typeparam>
62         /// <param name="actual">The object under examination</param>
63         /// <param name="message">The message to display in case of failure</param>
64         /// <param name="args">Array of objects to be used in formatting the message</param>
65         public static void IsAssignableFrom<TExpected>(object actual, string message, params object[] args)
66         {
67             Assert.That(actual, Is.AssignableFrom(typeof(TExpected)) ,message, args);
68         }
69
70         /// <summary>
71         /// Asserts that an object may be assigned a  value of a given Type.
72         /// </summary>
73         /// <typeparam name="TExpected">The expected Type.</typeparam>
74         /// <param name="actual">The object under examination</param>
75         public static void IsAssignableFrom<TExpected>(object actual)
76         {
77             Assert.That(actual, Is.AssignableFrom(typeof(TExpected)) ,null, null);
78         }
79
80         #endregion
81
82         #region IsNotAssignableFrom
83
84         /// <summary>
85         /// Asserts that an object may not be assigned a  value of a given Type.
86         /// </summary>
87         /// <param name="expected">The expected Type.</param>
88         /// <param name="actual">The object under examination</param>
89         /// <param name="message">The message to display in case of failure</param>
90         /// <param name="args">Array of objects to be used in formatting the message</param>
91         public static void IsNotAssignableFrom(Type expected, object actual, string message, params object[] args)
92         {
93             Assert.That(actual, Is.Not.AssignableFrom(expected) ,message, args);
94         }
95
96         /// <summary>
97         /// Asserts that an object may not be assigned a  value of a given Type.
98         /// </summary>
99         /// <param name="expected">The expected Type.</param>
100         /// <param name="actual">The object under examination</param>
101         public static void IsNotAssignableFrom(Type expected, object actual)
102         {
103             Assert.That(actual, Is.Not.AssignableFrom(expected) ,null, null);
104         }
105
106         #endregion
107
108         #region IsNotAssignableFrom<TExpected>
109
110         /// <summary>
111         /// Asserts that an object may not be assigned a  value of a given Type.
112         /// </summary>
113         /// <typeparam name="TExpected">The expected Type.</typeparam>
114         /// <param name="actual">The object under examination</param>
115         /// <param name="message">The message to display in case of failure</param>
116         /// <param name="args">Array of objects to be used in formatting the message</param>
117         public static void IsNotAssignableFrom<TExpected>(object actual, string message, params object[] args)
118         {
119             Assert.That(actual, Is.Not.AssignableFrom(typeof(TExpected)) ,message, args);
120         }
121
122         /// <summary>
123         /// Asserts that an object may not be assigned a  value of a given Type.
124         /// </summary>
125         /// <typeparam name="TExpected">The expected Type.</typeparam>
126         /// <param name="actual">The object under examination</param>
127         public static void IsNotAssignableFrom<TExpected>(object actual)
128         {
129             Assert.That(actual, Is.Not.AssignableFrom(typeof(TExpected)) ,null, null);
130         }
131
132         #endregion
133
134         #region IsInstanceOf
135
136         /// <summary>
137         /// Asserts that an object is an instance of a given type.
138         /// </summary>
139         /// <param name="expected">The expected Type</param>
140         /// <param name="actual">The object being examined</param>
141         /// <param name="message">The message to display in case of failure</param>
142         /// <param name="args">Array of objects to be used in formatting the message</param>
143         public static void IsInstanceOf(Type expected, object actual, string message, params object[] args)
144         {
145             Assert.That(actual, Is.InstanceOf(expected) ,message, args);
146         }
147
148         /// <summary>
149         /// Asserts that an object is an instance of a given type.
150         /// </summary>
151         /// <param name="expected">The expected Type</param>
152         /// <param name="actual">The object being examined</param>
153         public static void IsInstanceOf(Type expected, object actual)
154         {
155             Assert.That(actual, Is.InstanceOf(expected) ,null, null);
156         }
157
158         #endregion
159
160         #region IsInstanceOf<TExpected>
161
162         /// <summary>
163         /// Asserts that an object is an instance of a given type.
164         /// </summary>
165         /// <typeparam name="TExpected">The expected Type</typeparam>
166         /// <param name="actual">The object being examined</param>
167         /// <param name="message">The message to display in case of failure</param>
168         /// <param name="args">Array of objects to be used in formatting the message</param>
169         public static void IsInstanceOf<TExpected>(object actual, string message, params object[] args)
170         {
171             Assert.That(actual, Is.InstanceOf(typeof(TExpected)) ,message, args);
172         }
173
174         /// <summary>
175         /// Asserts that an object is an instance of a given type.
176         /// </summary>
177         /// <typeparam name="TExpected">The expected Type</typeparam>
178         /// <param name="actual">The object being examined</param>
179         public static void IsInstanceOf<TExpected>(object actual)
180         {
181             Assert.That(actual, Is.InstanceOf(typeof(TExpected)) ,null, null);
182         }
183
184         #endregion
185
186         #region IsNotInstanceOf
187
188         /// <summary>
189         /// Asserts that an object is not an instance of a given type.
190         /// </summary>
191         /// <param name="expected">The expected Type</param>
192         /// <param name="actual">The object being examined</param>
193         /// <param name="message">The message to display in case of failure</param>
194         /// <param name="args">Array of objects to be used in formatting the message</param>
195         public static void IsNotInstanceOf(Type expected, object actual, string message, params object[] args)
196         {
197             Assert.That(actual, Is.Not.InstanceOf(expected) ,message, args);
198         }
199
200         /// <summary>
201         /// Asserts that an object is not an instance of a given type.
202         /// </summary>
203         /// <param name="expected">The expected Type</param>
204         /// <param name="actual">The object being examined</param>
205         public static void IsNotInstanceOf(Type expected, object actual)
206         {
207             Assert.That(actual, Is.Not.InstanceOf(expected) ,null, null);
208         }
209
210         #endregion
211
212         #region IsNotInstanceOf<TExpected>
213
214         /// <summary>
215         /// Asserts that an object is not an instance of a given type.
216         /// </summary>
217         /// <typeparam name="TExpected">The expected Type</typeparam>
218         /// <param name="actual">The object being examined</param>
219         /// <param name="message">The message to display in case of failure</param>
220         /// <param name="args">Array of objects to be used in formatting the message</param>
221         public static void IsNotInstanceOf<TExpected>(object actual, string message, params object[] args)
222         {
223             Assert.That(actual, Is.Not.InstanceOf(typeof(TExpected)) ,message, args);
224         }
225
226         /// <summary>
227         /// Asserts that an object is not an instance of a given type.
228         /// </summary>
229         /// <typeparam name="TExpected">The expected Type</typeparam>
230         /// <param name="actual">The object being examined</param>
231         public static void IsNotInstanceOf<TExpected>(object actual)
232         {
233             Assert.That(actual, Is.Not.InstanceOf(typeof(TExpected)) ,null, null);
234         }
235
236         #endregion
237     }
238 }