Mercurial > repos > IBBoard.Tests
comparison Limits/NumericSizeConstrainedLimitTest.cs @ 7:a2cbd7cb6a5e
Re #24: Create limit objects
* Extract out common tests
* Make old tests use new abstract
* Add tests for new class
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 20 Oct 2009 19:49:44 +0000 |
parents | 9a860452ced0 |
children | 5507654d189d |
comparison
equal
deleted
inserted
replaced
6:9a860452ced0 | 7:a2cbd7cb6a5e |
---|---|
6 using NUnit.Framework; | 6 using NUnit.Framework; |
7 | 7 |
8 namespace IBBoard.Limits | 8 namespace IBBoard.Limits |
9 { | 9 { |
10 [TestFixture()] | 10 [TestFixture()] |
11 public class NumericSizeConstrainedLimitTest | 11 public class NumericSizeConstrainedLimitTest : AbstractLimitTest |
12 { | 12 { |
13 [Test()] | 13 public override AbstractLimit GetDefaultLimitObject () |
14 public void TestSizeConstrainedLimits() | |
15 { | 14 { |
16 NumericSizeConstrainedLimit limit = new NumericSizeConstrainedLimit(10); | 15 return new NumericSizeConstrainedLimit(10); |
17 Assert.AreEqual(10, limit.GetLimit(100)); | 16 } |
18 Assert.AreEqual(10, limit.GetLimit(10)); | 17 |
19 Assert.AreEqual(1, limit.GetLimit(1)); | 18 public override double GetSize100ExpectedValue () |
19 { | |
20 return 10; | |
21 } | |
22 | |
23 public override double GetSize10ExpectedValue () | |
24 { | |
25 return 10; | |
26 } | |
27 | |
28 public override double GetSize1ExpectedValue () | |
29 { | |
30 return 1; | |
31 } | |
32 | |
33 public override AbstractLimit GetEqualLimitObject () | |
34 { | |
35 return new NumericSizeConstrainedLimit(10); | |
36 } | |
37 | |
38 public override AbstractLimit GetUnequalLimitObject () | |
39 { | |
40 return new NumericSizeConstrainedLimit(100); | |
20 } | 41 } |
21 } | 42 } |
22 } | 43 } |