changeset 8:43e282ec574c

Re #24: Add "limit" objects * Add test for "unlimited" limit
author IBBoard <dev@ibboard.co.uk>
date Thu, 22 Oct 2009 19:10:02 +0000
parents a2cbd7cb6a5e
children 1ba61db2c7fc
files IBBoard.Tests.csproj Limits/UnlimitedLimitTest.cs
diffstat 2 files changed, 47 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/IBBoard.Tests.csproj	Tue Oct 20 19:49:44 2009 +0000
     1.2 +++ b/IBBoard.Tests.csproj	Thu Oct 22 19:10:02 2009 +0000
     1.3 @@ -31,6 +31,9 @@
     1.4      <Compile Include="CustomMath\IBBMathTests.cs" />
     1.5      <Compile Include="Limits\NumericSizeConstrainedLimitTest.cs" />
     1.6      <Compile Include="Limits\SimpleRoundedPercentageLimitTest.cs" />
     1.7 +    <Compile Include="Limits\AbstractLimitTest.cs" />
     1.8 +    <Compile Include="Limits\AbsoluteNumericLimitTest.cs" />
     1.9 +    <Compile Include="Limits\UnlimitedLimitTest.cs" />
    1.10    </ItemGroup>
    1.11    <ItemGroup>
    1.12      <Reference Include="System" />
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Limits/UnlimitedLimitTest.cs	Thu Oct 22 19:10:02 2009 +0000
     2.3 @@ -0,0 +1,44 @@
     2.4 +// This file (UnlimitedLimitTest.cs) is a part of the IBBoard.Tests project and is copyright 2009 IBBoard
     2.5 +// 
     2.6 +//  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.
     2.7 +
     2.8 +using System;
     2.9 +using NUnit.Framework;
    2.10 +
    2.11 +namespace IBBoard.Limits
    2.12 +{
    2.13 +	[TestFixture()]
    2.14 +	public class UnlimitedLimitTest : AbstractLimitTest
    2.15 +	{
    2.16 +		public override AbstractLimit GetDefaultLimitObject ()
    2.17 +		{
    2.18 +			return new UnlimitedLimit();
    2.19 +		}
    2.20 +		
    2.21 +		public override double GetSize100ExpectedValue ()
    2.22 +		{
    2.23 +			return 100;
    2.24 +		}
    2.25 +		
    2.26 +		public override double GetSize10ExpectedValue ()
    2.27 +		{
    2.28 +			return 10;
    2.29 +		}
    2.30 +		
    2.31 +		public override double GetSize1ExpectedValue ()
    2.32 +		{
    2.33 +			return 1;
    2.34 +		}
    2.35 +		
    2.36 +		public override AbstractLimit GetEqualLimitObject ()
    2.37 +		{
    2.38 +			return new UnlimitedLimit();
    2.39 +		}
    2.40 +		
    2.41 +		public override AbstractLimit GetUnequalLimitObject ()
    2.42 +		{
    2.43 +			//Ugly hack because "unlimited" limits are the one time we don't have an unequal object
    2.44 +			return null;
    2.45 +		}
    2.46 +	}
    2.47 +}