annotate Limits/CompositeMinimumLimitTest.cs @ 28:31fdc90f3556

* Fix license comments at top of files no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Sat, 21 Aug 2010 10:07:09 +0000
parents 57b5d27e95fb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 // This file (CompositeMinimumLimitTest.cs) is a part of the IBBoard.Tests project and is copyright 2010 IBBoard
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 //
28
31fdc90f3556 * Fix license comments at top of files
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU LGPL, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
26
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 using System;
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 using System.Collections.Generic;
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 using NUnit.Framework;
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 namespace IBBoard.Limits
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 {
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 [TestFixture()]
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 public class CompositeMinimumLimitTest : AbstractCompositeLimitTest
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 {
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 protected override AbstractCompositeLimit CreateCompositeLimitWithLimit (ILimit limit)
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 {
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 return new CompositeMinimumLimit(limit);
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 }
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 protected override AbstractCompositeLimit CreateCompositeLimitWithCollection (List<ILimit> limits)
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 {
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 return new CompositeMinimumLimit(limits);
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 }
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 protected override int GetMultipleLimitValue(int numberBeingLimited, int sizeConstrainedLimitNum, int absoluteLimitNum)
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 {
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 int limitedNum = Math.Min(sizeConstrainedLimitNum, numberBeingLimited);
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 limitedNum = Math.Min(limitedNum, absoluteLimitNum);
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 return limitedNum;
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 }
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 }
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 }
57b5d27e95fb Fixes #45: Create composite limit
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32