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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
11 public class NumericSizeConstrainedLimitTest : AbstractLimitTest
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
12 {
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
13 public override AbstractLimit GetDefaultLimitObject ()
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
14 {
10
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
15 return new NumericSizeConstrainedLimit();
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
16 }
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
17
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
18 [Test()]
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
19 public void TestLimitedConstraint ()
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
20 {
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
21 NumericSizeConstrainedLimit limit = new NumericSizeConstrainedLimit(10);
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
22 Assert.AreEqual(10, limit.GetLimit(100));
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
23 Assert.AreEqual(10, limit.GetLimit(10));
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
24 Assert.AreEqual(1, limit.GetLimit(1));
7
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
25 }
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
26
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
27 public override double GetSize100ExpectedValue ()
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
28 {
10
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
29 return 100;
7
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
30 }
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
31
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
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
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
34 return 10;
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
35 }
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
36
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
37 public override double GetSize1ExpectedValue ()
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
38 {
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
39 return 1;
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
40 }
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
41
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
42 public override AbstractLimit GetEqualLimitObject ()
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
43 {
10
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
44 return new NumericSizeConstrainedLimit();
7
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
45 }
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
46
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
47 public override AbstractLimit GetUnequalLimitObject ()
a2cbd7cb6a5e Re #24: Create limit objects
IBBoard <dev@ibboard.co.uk>
parents: 6
diff changeset
48 {
10
5507654d189d Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 7
diff changeset
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 }