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

« back to all changes in this revision

Viewing changes to src/NUnitFramework/framework/Constraints/ComparisonConstraints.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 2011, 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
 
#if CLR_2_0 || CLR_4_0
10
 
using System.Collections.Generic;
11
 
#endif
12
 
 
13
 
namespace NUnit.Framework.Constraints
14
 
{
15
 
    /// <summary>
16
 
    /// Abstract base class for constraints that compare values to
17
 
    /// determine if one is greater than, equal to or less than
18
 
    /// the other. This class supplies the Using modifiers.
19
 
    /// </summary>
20
 
    public abstract class ComparisonConstraint : Constraint
21
 
    {
22
 
        /// <summary>
23
 
        /// ComparisonAdapter to be used in making the comparison
24
 
        /// </summary>
25
 
        protected ComparisonAdapter comparer = ComparisonAdapter.Default;
26
 
 
27
 
        /// <summary>
28
 
        /// Initializes a new instance of the <see cref="T:ComparisonConstraint"/> class.
29
 
        /// </summary>
30
 
        public ComparisonConstraint(object arg) : base(arg) { }
31
 
 
32
 
        /// <summary>
33
 
        /// Initializes a new instance of the <see cref="T:ComparisonConstraint"/> class.
34
 
        /// </summary>
35
 
        public ComparisonConstraint(object arg1, object arg2) : base(arg1, arg2) { }
36
 
 
37
 
        /// <summary>
38
 
        /// Modifies the constraint to use an IComparer and returns self
39
 
        /// </summary>
40
 
        public ComparisonConstraint Using(IComparer comparer)
41
 
        {
42
 
            this.comparer = ComparisonAdapter.For(comparer);
43
 
            return this;
44
 
        }
45
 
 
46
 
#if CLR_2_0 || CLR_4_0
47
 
        /// <summary>
48
 
        /// Modifies the constraint to use an IComparer&lt;T&gt; and returns self
49
 
        /// </summary>
50
 
        public ComparisonConstraint Using<T>(IComparer<T> comparer)
51
 
        {
52
 
            this.comparer = ComparisonAdapter.For(comparer);
53
 
            return this;
54
 
        }
55
 
 
56
 
        /// <summary>
57
 
        /// Modifies the constraint to use a Comparison&lt;T&gt; and returns self
58
 
        /// </summary>
59
 
        public ComparisonConstraint Using<T>(Comparison<T> comparer)
60
 
        {
61
 
            this.comparer = ComparisonAdapter.For(comparer);
62
 
            return this;
63
 
        }
64
 
#endif
65
 
    }
66
 
}