Mercurial > repos > IBBoard.Tests
annotate Limits/NumericSizeConstrainedLimitTest.cs @ 49:99e4c1949c92 default tip
* Update to v2.6 of NUnit and new syntax/API changes
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 28 Apr 2013 19:32:14 +0100 |
parents | 5507654d189d |
children |
rev | line source |
---|---|
6
9a860452ced0
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
4
diff
changeset
|
1 // This file (NumericSizeConstrainedLimitTest.cs) is a part of the IBBoard.Tests project and is copyright 2009 IBBoard |
4
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 // |
6
9a860452ced0
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
4
diff
changeset
|
3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license. |
4
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System; |
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 using NUnit.Framework; |
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 |
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 namespace IBBoard.Limits |
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 { |
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 [TestFixture()] |
7 | 11 public class NumericSizeConstrainedLimitTest : AbstractLimitTest |
12 { | |
13 public override AbstractLimit GetDefaultLimitObject () | |
14 { | |
10 | 15 return new NumericSizeConstrainedLimit(); |
16 } | |
17 | |
18 [Test()] | |
19 public void TestLimitedConstraint () | |
20 { | |
21 NumericSizeConstrainedLimit limit = new NumericSizeConstrainedLimit(10); | |
22 Assert.AreEqual(10, limit.GetLimit(100)); | |
23 Assert.AreEqual(10, limit.GetLimit(10)); | |
24 Assert.AreEqual(1, limit.GetLimit(1)); | |
7 | 25 } |
26 | |
27 public override double GetSize100ExpectedValue () | |
28 { | |
10 | 29 return 100; |
7 | 30 } |
31 | |
32 public override double GetSize10ExpectedValue () | |
4
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 { |
7 | 34 return 10; |
35 } | |
36 | |
37 public override double GetSize1ExpectedValue () | |
38 { | |
39 return 1; | |
40 } | |
41 | |
42 public override AbstractLimit GetEqualLimitObject () | |
43 { | |
10 | 44 return new NumericSizeConstrainedLimit(); |
7 | 45 } |
46 | |
47 public override AbstractLimit GetUnequalLimitObject () | |
48 { | |
10 | 49 return new NumericSizeConstrainedLimit(10); |
4
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
50 } |
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
51 } |
a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
52 } |