~a-schlapsi/nunit-3.0/linux-makefile

« back to all changes in this revision

Viewing changes to src/framework/Constraints/Constraint.cs

  • Committer: Andreas Schlapsi
  • Date: 2010-10-05 22:15:56 UTC
  • mfrom: (18.1.227 work)
  • Revision ID: a.schlapsi@gmx.at-20101005221556-gi6plm10hid84qrf
Merged with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
        #region Constructors
87
87
        /// <summary>
88
88
        /// Construct a constraint with no arguments
89
 
        /// </summary>
90
 
        public Constraint()
 
89
        /// </summary>
 
90
        protected Constraint()
91
91
        {
92
92
            argcnt = 0;
93
93
        }
94
94
 
95
95
        /// <summary>
96
96
        /// Construct a constraint with one argument
97
 
        /// </summary>
98
 
        public Constraint(object arg)
 
97
        /// </summary>
 
98
        protected Constraint(object arg)
99
99
        {
100
100
            argcnt = 1;
101
101
            this.arg1 = arg;
103
103
 
104
104
        /// <summary>
105
105
        /// Construct a constraint with two arguments
106
 
        /// </summary>
107
 
        public Constraint(object arg1, object arg2)
 
106
        /// </summary>
 
107
        protected Constraint(object arg1, object arg2)
108
108
        {
109
109
            argcnt = 2;
110
110
            this.arg1 = arg1;
186
186
            return Matches(del());
187
187
        }
188
188
 
189
 
#if CLR_2_0
 
189
#if CLR_2_0 || CLR_4_0
190
190
        /// <summary>
191
191
        /// Test whether the constraint is satisfied by a given reference.
192
192
        /// The default implementation simply dereferences the value but
239
239
        /// <returns></returns>
240
240
        public override string ToString()
241
241
        {
 
242
            string rep = GetStringRepresentation();
 
243
 
 
244
            return this.builder == null ? rep : string.Format("<unresolved {0}>", rep);
 
245
        }
 
246
 
 
247
        /// <summary>
 
248
        /// Returns the string representation of this constraint
 
249
        /// </summary>
 
250
        /// <returns></returns>
 
251
        protected virtual string GetStringRepresentation()
 
252
        {
242
253
            switch (argcnt)
243
254
            {
244
255
                default:
251
262
            }
252
263
        }
253
264
 
254
 
        private string _displayable(object o)
 
265
        private static string _displayable(object o)
255
266
        {
256
267
            if (o == null) return "null";
257
268
 
387
398
        }
388
399
        #endregion
389
400
    }
390
 
}
 
401
}
 
 
b'\\ No newline at end of file'