~ubuntu-branches/debian/sid/nunit/sid

« back to all changes in this revision

Viewing changes to src/NUnitFramework/framework/Text.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2014-09-16 13:43:36 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140916134336-kjxz48tty6lx2ja5
Tags: 2.6.3+dfsg-1
* [c7bd1b5] Imported Upstream version 2.6.3+dfsg
* [bcb4bf8] Move nunit-console-runner to GAC-installed libnunit2.6, 
  don't treat it as a private lib. This lib is signed, and treated 
  as a GAC lib by consumers such as MonoDevelop.
* [7f08e99] Bump version to 2.6.3 as required
* [84535eb] Refreshed patches
* [8479f61] Split package up into per-assembly packages. This makes 
  ABI tracking easier in the future, as we can meaningfully have GAC 
  policy for cases where ABI isn't truly bumped, and no policy for 
  cases where it is. For example, if nunit.framework bumps ABI but 
  nunit.core does not, previously we would need to rebuild everything 
  using NUnit, but under the new split packaging, that rebuild would 
  not be needed for apps only using nunit.core.
* [17a7dc7] Add missing nunit.mocks.dll to nunit.pc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// ****************************************************************
2
 
// Copyright 2009, Charlie Poole
3
 
// This is free software licensed under the NUnit license. You may
4
 
// obtain a copy of the license at http://nunit.org
5
 
// ****************************************************************
6
 
 
7
 
using System;
8
 
using System.Collections;
9
 
using NUnit.Framework.Constraints;
10
 
 
11
 
namespace NUnit.Framework
12
 
{
13
 
    /// <summary>
14
 
    /// Helper class with static methods used to supply constraints
15
 
    /// that operate on strings.
16
 
    /// </summary>
17
 
    [Obsolete("Use Is class for string constraints")]
18
 
    public class Text
19
 
    {
20
 
        #region All
21
 
        
22
 
        /// <summary>
23
 
        /// Returns a ConstraintExpression, which will apply
24
 
        /// the following constraint to all members of a collection,
25
 
        /// succeeding if all of them succeed.
26
 
        /// </summary>
27
 
        [Obsolete("Use Is.All")]
28
 
        public static ConstraintExpression All
29
 
        {
30
 
            get { return new ConstraintExpression().All; }
31
 
        }
32
 
        
33
 
        #endregion
34
 
        
35
 
        #region Contains
36
 
        
37
 
        /// <summary>
38
 
        /// Returns a constraint that succeeds if the actual
39
 
        /// value contains the substring supplied as an argument.
40
 
        /// </summary>
41
 
        [Obsolete("Use Is.StringContaining")]
42
 
        public static SubstringConstraint Contains(string expected)
43
 
        {
44
 
            return new SubstringConstraint(expected);
45
 
        }
46
 
        
47
 
        #endregion
48
 
        
49
 
        #region DoesNotContain
50
 
        
51
 
        /// <summary>
52
 
        /// Returns a constraint that fails if the actual
53
 
        /// value contains the substring supplied as an argument.
54
 
        /// </summary>
55
 
        [Obsolete("Use Is.Not.StringContaining")]
56
 
        public static SubstringConstraint DoesNotContain(string expected)
57
 
        {
58
 
            return new ConstraintExpression().Not.ContainsSubstring(expected);
59
 
        }
60
 
        
61
 
        #endregion
62
 
        
63
 
        #region StartsWith
64
 
        
65
 
        /// <summary>
66
 
        /// Returns a constraint that succeeds if the actual
67
 
        /// value starts with the substring supplied as an argument.
68
 
        /// </summary>
69
 
        [Obsolete("Use Is.StringStarting")]
70
 
        public static StartsWithConstraint StartsWith(string expected)
71
 
        {
72
 
            return new StartsWithConstraint(expected);
73
 
        }
74
 
        
75
 
        #endregion
76
 
        
77
 
        #region DoesNotStartWith
78
 
        
79
 
        /// <summary>
80
 
        /// Returns a constraint that fails if the actual
81
 
        /// value starts with the substring supplied as an argument.
82
 
        /// </summary>
83
 
        public static StartsWithConstraint DoesNotStartWith(string expected)
84
 
        {
85
 
            return new ConstraintExpression().Not.StartsWith(expected);
86
 
        }
87
 
        
88
 
        #endregion
89
 
        
90
 
        #region EndsWith
91
 
        
92
 
        /// <summary>
93
 
        /// Returns a constraint that succeeds if the actual
94
 
        /// value ends with the substring supplied as an argument.
95
 
        /// </summary>
96
 
        [Obsolete("Use Is.StringEnding")]
97
 
        public static EndsWithConstraint EndsWith(string expected)
98
 
        {
99
 
            return new EndsWithConstraint(expected);
100
 
        }
101
 
        
102
 
        #endregion
103
 
        
104
 
        #region DoesNotEndWith
105
 
        
106
 
        /// <summary>
107
 
        /// Returns a constraint that fails if the actual
108
 
        /// value ends with the substring supplied as an argument.
109
 
        /// </summary>
110
 
        public static EndsWithConstraint DoesNotEndWith(string expected)
111
 
        {
112
 
            return new ConstraintExpression().Not.EndsWith(expected);
113
 
        }
114
 
        
115
 
        #endregion
116
 
        
117
 
        #region Matches
118
 
        
119
 
        /// <summary>
120
 
        /// Returns a constraint that succeeds if the actual
121
 
        /// value matches the Regex pattern supplied as an argument.
122
 
        /// </summary>
123
 
        [Obsolete("Use Is.StringMatching")]
124
 
        public static RegexConstraint Matches(string pattern)
125
 
        {
126
 
            return new RegexConstraint(pattern);
127
 
        }
128
 
        
129
 
        #endregion
130
 
        
131
 
        #region DoesNotMatch
132
 
        
133
 
        /// <summary>
134
 
        /// Returns a constraint that fails if the actual
135
 
        /// value matches the pattern supplied as an argument.
136
 
        /// </summary>
137
 
        [Obsolete]
138
 
        public static RegexConstraint DoesNotMatch(string pattern)
139
 
        {
140
 
            return new ConstraintExpression().Not.Matches(pattern);
141
 
        }
142
 
        
143
 
        #endregion
144
 
        
145
 
    }
146
 
}
 
1
// ****************************************************************
 
2
// Copyright 2009, Charlie Poole
 
3
// This is free software licensed under the NUnit license. You may
 
4
// obtain a copy of the license at http://nunit.org
 
5
// ****************************************************************
 
6
 
 
7
using System;
 
8
using System.Collections;
 
9
using NUnit.Framework.Constraints;
 
10
 
 
11
namespace NUnit.Framework
 
12
{
 
13
    /// <summary>
 
14
    /// Helper class with static methods used to supply constraints
 
15
    /// that operate on strings.
 
16
    /// </summary>
 
17
    [Obsolete("Use Is class for string constraints")]
 
18
    public class Text
 
19
    {
 
20
        #region All
 
21
        
 
22
        /// <summary>
 
23
        /// Returns a ConstraintExpression, which will apply
 
24
        /// the following constraint to all members of a collection,
 
25
        /// succeeding if all of them succeed.
 
26
        /// </summary>
 
27
        [Obsolete("Use Is.All")]
 
28
        public static ConstraintExpression All
 
29
        {
 
30
            get { return new ConstraintExpression().All; }
 
31
        }
 
32
        
 
33
        #endregion
 
34
        
 
35
        #region Contains
 
36
        
 
37
        /// <summary>
 
38
        /// Returns a constraint that succeeds if the actual
 
39
        /// value contains the substring supplied as an argument.
 
40
        /// </summary>
 
41
        [Obsolete("Use Is.StringContaining")]
 
42
        public static SubstringConstraint Contains(string expected)
 
43
        {
 
44
            return new SubstringConstraint(expected);
 
45
        }
 
46
        
 
47
        #endregion
 
48
        
 
49
        #region DoesNotContain
 
50
        
 
51
        /// <summary>
 
52
        /// Returns a constraint that fails if the actual
 
53
        /// value contains the substring supplied as an argument.
 
54
        /// </summary>
 
55
        [Obsolete("Use Is.Not.StringContaining")]
 
56
        public static SubstringConstraint DoesNotContain(string expected)
 
57
        {
 
58
            return new ConstraintExpression().Not.ContainsSubstring(expected);
 
59
        }
 
60
        
 
61
        #endregion
 
62
        
 
63
        #region StartsWith
 
64
        
 
65
        /// <summary>
 
66
        /// Returns a constraint that succeeds if the actual
 
67
        /// value starts with the substring supplied as an argument.
 
68
        /// </summary>
 
69
        [Obsolete("Use Is.StringStarting")]
 
70
        public static StartsWithConstraint StartsWith(string expected)
 
71
        {
 
72
            return new StartsWithConstraint(expected);
 
73
        }
 
74
        
 
75
        #endregion
 
76
        
 
77
        #region DoesNotStartWith
 
78
        
 
79
        /// <summary>
 
80
        /// Returns a constraint that fails if the actual
 
81
        /// value starts with the substring supplied as an argument.
 
82
        /// </summary>
 
83
        public static StartsWithConstraint DoesNotStartWith(string expected)
 
84
        {
 
85
            return new ConstraintExpression().Not.StartsWith(expected);
 
86
        }
 
87
        
 
88
        #endregion
 
89
        
 
90
        #region EndsWith
 
91
        
 
92
        /// <summary>
 
93
        /// Returns a constraint that succeeds if the actual
 
94
        /// value ends with the substring supplied as an argument.
 
95
        /// </summary>
 
96
        [Obsolete("Use Is.StringEnding")]
 
97
        public static EndsWithConstraint EndsWith(string expected)
 
98
        {
 
99
            return new EndsWithConstraint(expected);
 
100
        }
 
101
        
 
102
        #endregion
 
103
        
 
104
        #region DoesNotEndWith
 
105
        
 
106
        /// <summary>
 
107
        /// Returns a constraint that fails if the actual
 
108
        /// value ends with the substring supplied as an argument.
 
109
        /// </summary>
 
110
        public static EndsWithConstraint DoesNotEndWith(string expected)
 
111
        {
 
112
            return new ConstraintExpression().Not.EndsWith(expected);
 
113
        }
 
114
        
 
115
        #endregion
 
116
        
 
117
        #region Matches
 
118
        
 
119
        /// <summary>
 
120
        /// Returns a constraint that succeeds if the actual
 
121
        /// value matches the Regex pattern supplied as an argument.
 
122
        /// </summary>
 
123
        [Obsolete("Use Is.StringMatching")]
 
124
        public static RegexConstraint Matches(string pattern)
 
125
        {
 
126
            return new RegexConstraint(pattern);
 
127
        }
 
128
        
 
129
        #endregion
 
130
        
 
131
        #region DoesNotMatch
 
132
        
 
133
        /// <summary>
 
134
        /// Returns a constraint that fails if the actual
 
135
        /// value matches the pattern supplied as an argument.
 
136
        /// </summary>
 
137
        [Obsolete]
 
138
        public static RegexConstraint DoesNotMatch(string pattern)
 
139
        {
 
140
            return new ConstraintExpression().Not.Matches(pattern);
 
141
        }
 
142
        
 
143
        #endregion
 
144
        
 
145
    }
 
146
}