[NUI] Rebase develnui (DevelNUI only patches --> master) (#3910)
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Devel.Tests.Ubuntu / nunit.framework / Does.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 NUnit.Framework.Constraints;
25
26 namespace NUnit.Framework
27 {
28     /// <summary>
29     /// Helper class with properties and methods that supply
30     /// a number of constraints used in Asserts.
31     /// </summary>
32     public static class Does
33     {
34         #region Not
35
36         /// <summary>
37         /// Returns a ConstraintExpression that negates any
38         /// following constraint.
39         /// </summary>
40         public static ConstraintExpression Not
41         {
42             get { return new ConstraintExpression().Not; }
43         }
44
45         #endregion
46
47         #region Exist
48
49 #if !SILVERLIGHT && !PORTABLE
50         /// <summary>
51         /// Returns a constraint that succeeds if the value
52         /// is a file or directory and it exists.
53         /// </summary>
54         public static FileOrDirectoryExistsConstraint Exist
55         {
56             get { return new FileOrDirectoryExistsConstraint(); }
57         }
58 #endif
59
60         #endregion
61
62         #region Contain
63
64         /// <summary>
65         /// Returns a new CollectionContainsConstraint checking for the
66         /// presence of a particular object in the collection.
67         /// </summary>
68         public static CollectionContainsConstraint Contain(object expected)
69         {
70             return new CollectionContainsConstraint(expected);
71         }
72
73         /// <summary>
74         /// Returns a new ContainsConstraint. This constraint
75         /// will, in turn, make use of the appropriate second-level
76         /// constraint, depending on the type of the actual argument. 
77         /// This overload is only used if the item sought is a string,
78         /// since any other type implies that we are looking for a 
79         /// collection member.
80         /// </summary>
81         public static ContainsConstraint Contain(string expected)
82         {
83             return new ContainsConstraint(expected);
84         }
85
86         #endregion
87
88         #region StartWith
89
90         /// <summary>
91         /// Returns a constraint that succeeds if the actual
92         /// value starts with the substring supplied as an argument.
93         /// </summary>
94         public static StartsWithConstraint StartWith(string expected)
95         {
96             return new StartsWithConstraint(expected);
97         }
98
99         #endregion
100
101         #region EndWith
102
103         /// <summary>
104         /// Returns a constraint that succeeds if the actual
105         /// value ends with the substring supplied as an argument.
106         /// </summary>
107         public static EndsWithConstraint EndWith(string expected)
108         {
109             return new EndsWithConstraint(expected);
110         }
111
112         #endregion
113
114         #region Match
115
116         /// <summary>
117         /// Returns a constraint that succeeds if the actual
118         /// value matches the regular expression supplied as an argument.
119         /// </summary>
120         public static RegexConstraint Match(string pattern)
121         {
122             return new RegexConstraint(pattern);
123         }
124
125         #endregion
126     }
127 }