Mercurial > repos > IBBoard.Tests
changeset 4:a6b26fe532df
Re #24: Add "limit" objects that can be used for numeric limits
* Add initial tests
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 06 Oct 2009 18:53:07 +0000 |
parents | 8c45831988c3 |
children | abf657708a35 |
files | IBBoard.Tests.csproj Limits/NumericSizeConstrainedLimitTest.cs Limits/RoundedPercentageLimitTest.cs |
diffstat | 3 files changed, 54 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/IBBoard.Tests.csproj Tue Oct 06 18:37:31 2009 +0000 +++ b/IBBoard.Tests.csproj Tue Oct 06 18:53:07 2009 +0000 @@ -7,7 +7,7 @@ <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{4160F7B6-4CFA-41FC-B5D7-5C9AE06FEBA7}</ProjectGuid> <OutputType>Library</OutputType> - <AssemblyName>IBBoard.Tests2</AssemblyName> + <RootNamespace>IBBoard</RootNamespace> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -17,6 +17,7 @@ <DefineConstants>DEBUG</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <AssemblyName>IBBoard.Tests</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> @@ -24,9 +25,11 @@ <OutputPath>bin\Release</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <AssemblyName>IBBoard.Tests2</AssemblyName> </PropertyGroup> <ItemGroup> <Compile Include="CustomMath\IBBMathTests.cs" /> + <Compile Include="Limits\NumericSizeConstrainedLimitTest.cs" /> </ItemGroup> <ItemGroup> <Reference Include="System" /> @@ -36,6 +39,7 @@ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <ItemGroup> <Folder Include="CustomMath\" /> + <Folder Include="Limits\" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\IBBoard\IBBoard.csproj"> @@ -43,4 +47,13 @@ <Name>IBBoard</Name> </ProjectReference> </ItemGroup> + <ProjectExtensions> + <MonoDevelop> + <Properties> + <Policies> + <DotNetNamingPolicy DirectoryNamespaceAssociation="PrefixedHierarchical" ResourceNamePolicy="FileFormatDefault" /> + </Policies> + </Properties> + </MonoDevelop> + </ProjectExtensions> </Project> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Limits/NumericSizeConstrainedLimitTest.cs Tue Oct 06 18:53:07 2009 +0000 @@ -0,0 +1,22 @@ +// This file (NumericSizeConstrainedLimitTest.cs) is a part of the IBBoard.Tests project and is copyright 2009 IBBoard +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. + +using System; +using NUnit.Framework; + +namespace IBBoard.Limits +{ + [TestFixture()] + public class NumericSizeConstrainedLimitTest + { + [Test()] + public void TestSizeConstrainedLimits() + { + NumericSizeConstrainedLimit limit = new NumericSizeConstrainedLimit(10); + Assert.AreEqual(10, limit.GetLimit(100)); + Assert.AreEqual(10, limit.GetLimit(10)); + Assert.AreEqual(1, limit.GetLimit(1)); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Limits/RoundedPercentageLimitTest.cs Tue Oct 06 18:53:07 2009 +0000 @@ -0,0 +1,18 @@ +// This file (RoundedPercentageLimitTest.cs) is a part of the IBBoard.Tests project and is copyright 2009 IBBoard +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. + +using System; +using NUnit.Framework; + +namespace IBBoard.Limits +{ + [TestFixture()] + public class RoundedPercentageLimitTest + { + [Test()] + public void TestCase () + { + } + } +}