Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit dd531f2

Browse files
committed
Moved Tests to another project, removed dependencies
1 parent 1b48d34 commit dd531f2

File tree

10 files changed

+120
-72
lines changed

10 files changed

+120
-72
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ ColorSharp/obj/*
22
ColorSharp\obj\*
33
ColorSharp/bin/*
44
ColorSharp\bin\*
5+
ColorSharpTests/obj/*
6+
ColorSharpTests\obj\*
7+
ColorSharpTests/bin/*
8+
ColorSharpTests\bin\*
59
ColorSharp/colorsharp.snk
610
ColorSharp\colorsharp.snk
711
packages/*
812
packages\*
913
ColorSharp.userprefs
10-
ColorSharp.userprefs
1114
ColorSharp*.nupkg

ColorSharp.sln

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2012
44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorSharp", "ColorSharp\ColorSharp.csproj", "{960524F3-F375-4CDE-A82A-609CC32048E4}"
55
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorSharpTests", "ColorSharpTests\ColorSharpTests.csproj", "{1EC57B2E-C96F-411B-A238-B8E490634009}"
7+
EndProject
68
Global
79
GlobalSection(SolutionConfigurationPlatforms) = preSolution
810
Debug|Any CPU = Debug|Any CPU
911
Release|Any CPU = Release|Any CPU
1012
Release_x86_64|Any CPU = Release_x86_64|Any CPU
1113
EndGlobalSection
1214
GlobalSection(ProjectConfigurationPlatforms) = postSolution
15+
{1EC57B2E-C96F-411B-A238-B8E490634009}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16+
{1EC57B2E-C96F-411B-A238-B8E490634009}.Debug|Any CPU.Build.0 = Debug|Any CPU
17+
{1EC57B2E-C96F-411B-A238-B8E490634009}.Release_x86_64|Any CPU.ActiveCfg = Release|Any CPU
18+
{1EC57B2E-C96F-411B-A238-B8E490634009}.Release_x86_64|Any CPU.Build.0 = Release|Any CPU
19+
{1EC57B2E-C96F-411B-A238-B8E490634009}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{1EC57B2E-C96F-411B-A238-B8E490634009}.Release|Any CPU.Build.0 = Release|Any CPU
1321
{960524F3-F375-4CDE-A82A-609CC32048E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1422
{960524F3-F375-4CDE-A82A-609CC32048E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
1523
{960524F3-F375-4CDE-A82A-609CC32048E4}.Release_x86_64|Any CPU.ActiveCfg = Release_x86_64|Any CPU

ColorSharp/ColorSharp.csproj

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
<HintPath>..\packages\MathNet.Numerics.Signed.3.2.3\lib\net40\MathNet.Numerics.dll</HintPath>
4747
</Reference>
4848
<Reference Include="System.Numerics" />
49-
<Reference Include="nunit.framework">
50-
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
51-
</Reference>
5249
</ItemGroup>
5350
<ItemGroup>
5451
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -69,27 +66,19 @@
6966
<Compile Include="src\InternalUtils\Comparers.cs" />
7067
<Compile Include="src\InternalUtils\Structs.cs" />
7168
<Compile Include="src\ColorSpaces\ColorConversionStrategy.cs" />
72-
<Compile Include="tests\ColorSpaces\CIExyYTest.cs" />
73-
<Compile Include="tests\ColorSpaces\CIEXYZTest.cs" />
74-
<Compile Include="tests\LightSpectrums\RegularLightSpectrumTest.cs" />
7569
</ItemGroup>
7670
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
7771
<ItemGroup>
7872
<Folder Include="src\" />
79-
<Folder Include="tests\" />
8073
<Folder Include="src\ColorSpaces\" />
8174
<Folder Include="src\LightSpectrums\" />
8275
<Folder Include="src\MatchingFunctions\" />
8376
<Folder Include="src\InternalUtils\" />
84-
<Folder Include="tests\ColorSpaces\" />
85-
<Folder Include="tests\MatchingFunctions\" />
86-
<Folder Include="tests\LightSpectrums\" />
8777
</ItemGroup>
8878
<ItemGroup>
8979
<None Include="packages.config" />
9080
<None Include="ColorSharp.nuspec" />
9181
<None Include="build_nuget_pkg.sh" />
9282
<None Include="colorsharp.pub" />
93-
<None Include="tests\MatchingFunctions\EMPTY" />
9483
</ItemGroup>
9584
</Project>

ColorSharp/packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="MathNet.Numerics.Signed" version="3.2.3" targetFramework="net40" />
4-
<package id="NUnit" version="2.6.3" targetFramework="net40" />
54
</packages>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{1EC57B2E-C96F-411B-A238-B8E490634009}</ProjectGuid>
7+
<OutputType>Library</OutputType>
8+
<RootNamespace>Litipk.ColorSharpTests</RootNamespace>
9+
<AssemblyName>ColorSharpTests</AssemblyName>
10+
<ReleaseVersion>0.5.2</ReleaseVersion>
11+
</PropertyGroup>
12+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
13+
<DebugSymbols>true</DebugSymbols>
14+
<DebugType>full</DebugType>
15+
<Optimize>false</Optimize>
16+
<OutputPath>bin\Debug</OutputPath>
17+
<DefineConstants>DEBUG;</DefineConstants>
18+
<ErrorReport>prompt</ErrorReport>
19+
<WarningLevel>4</WarningLevel>
20+
<ConsolePause>false</ConsolePause>
21+
</PropertyGroup>
22+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
23+
<DebugType>full</DebugType>
24+
<Optimize>true</Optimize>
25+
<OutputPath>bin\Release</OutputPath>
26+
<ErrorReport>prompt</ErrorReport>
27+
<WarningLevel>4</WarningLevel>
28+
<ConsolePause>false</ConsolePause>
29+
</PropertyGroup>
30+
<ItemGroup>
31+
<Reference Include="System" />
32+
<Reference Include="nunit.framework">
33+
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
34+
</Reference>
35+
</ItemGroup>
36+
<ItemGroup>
37+
<Compile Include="tests\ColorSpaces\CIExyYTest.cs" />
38+
<Compile Include="tests\ColorSpaces\CIEXYZTest.cs" />
39+
<Compile Include="tests\LightSpectrums\RegularLightSpectrumTest.cs" />
40+
</ItemGroup>
41+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
42+
<ItemGroup>
43+
<None Include="packages.config" />
44+
<None Include="tests\MatchingFunctions\EMPTY" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<ProjectReference Include="..\ColorSharp\ColorSharp.csproj">
48+
<Project>{960524F3-F375-4CDE-A82A-609CC32048E4}</Project>
49+
<Name>ColorSharp</Name>
50+
</ProjectReference>
51+
</ItemGroup>
52+
</Project>

ColorSharpTests/packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="NUnit" version="2.6.3" targetFramework="net45" />
4+
</packages>

ColorSharp/tests/ColorSpaces/CIEXYZTest.cs renamed to ColorSharpTests/tests/ColorSpaces/CIEXYZTest.cs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,26 @@
2828

2929

3030
using NUnit.Framework;
31+
using Litipk.ColorSharp.ColorSpaces;
3132

3233

33-
namespace Litipk.ColorSharp
34+
namespace Litipk.ColorSharpTests
3435
{
35-
namespace ColorSpaces
36+
[TestFixture]
37+
public class CIEXYZTest
3638
{
37-
[TestFixture]
38-
public class CIEXYZTest
39+
[Test]
40+
public void TestConversions()
3941
{
40-
[Test]
41-
public void TestConversions()
42-
{
43-
Assert.AreEqual (
44-
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIExyY> (),
45-
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<SRGB> ().ConvertTo<CIExyY> ()
46-
);
42+
Assert.AreEqual (
43+
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIExyY> (),
44+
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<SRGB> ().ConvertTo<CIExyY> ()
45+
);
4746

48-
Assert.AreEqual (
49-
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<SRGB> (),
50-
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIExyY> ().ConvertTo<SRGB> ()
51-
);
52-
}
47+
Assert.AreEqual (
48+
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<SRGB> (),
49+
new CIEXYZ (50.0, 60.0, 30.0).ConvertTo<CIExyY> ().ConvertTo<SRGB> ()
50+
);
5351
}
5452
}
5553
}

ColorSharp/tests/ColorSpaces/CIExyYTest.cs renamed to ColorSharpTests/tests/ColorSpaces/CIExyYTest.cs

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,41 +28,38 @@
2828

2929

3030
using NUnit.Framework;
31+
using Litipk.ColorSharp.ColorSpaces;
3132

32-
33-
namespace Litipk.ColorSharp
33+
namespace Litipk.ColorSharpTests
3434
{
35-
namespace ColorSpaces
35+
[TestFixture]
36+
public class CIExyYTest
3637
{
37-
[TestFixture]
38-
public class CIExyYTest
38+
[Test]
39+
public void TestConversions()
3940
{
40-
[Test]
41-
public void TestConversions()
42-
{
43-
Assert.AreEqual (
44-
new CIExyY (0.5, 0.5, 100.0).ConvertTo<SRGB>(),
45-
new CIExyY (0.5, 0.5, 100.0).ConvertTo<CIEXYZ>().ConvertTo<SRGB>()
46-
);
47-
}
41+
Assert.AreEqual (
42+
new CIExyY (0.5, 0.5, 100.0).ConvertTo<SRGB>(),
43+
new CIExyY (0.5, 0.5, 100.0).ConvertTo<CIEXYZ>().ConvertTo<SRGB>()
44+
);
45+
}
4846

49-
[Test]
50-
public void TestIsInsideColorSpace()
51-
{
52-
Assert.IsFalse (new CIExyY (0.05, 0.25, 100.0).IsInsideColorSpace ());
53-
Assert.IsFalse (new CIExyY (0.25, 0.75, 100.0).IsInsideColorSpace ());
54-
Assert.IsFalse (new CIExyY (0.30, 0.05, 100.0).IsInsideColorSpace ());
55-
Assert.IsFalse (new CIExyY (0.40, 0.10, 100.0).IsInsideColorSpace ());
56-
Assert.IsFalse (new CIExyY (0.50, 0.15, 100.0).IsInsideColorSpace ());
57-
Assert.IsFalse (new CIExyY (0.65, 0.20, 100.0).IsInsideColorSpace ());
58-
Assert.IsFalse (new CIExyY (0.80, 0.80, 100.0).IsInsideColorSpace ());
47+
[Test]
48+
public void TestIsInsideColorSpace()
49+
{
50+
Assert.IsFalse (new CIExyY (0.05, 0.25, 100.0).IsInsideColorSpace ());
51+
Assert.IsFalse (new CIExyY (0.25, 0.75, 100.0).IsInsideColorSpace ());
52+
Assert.IsFalse (new CIExyY (0.30, 0.05, 100.0).IsInsideColorSpace ());
53+
Assert.IsFalse (new CIExyY (0.40, 0.10, 100.0).IsInsideColorSpace ());
54+
Assert.IsFalse (new CIExyY (0.50, 0.15, 100.0).IsInsideColorSpace ());
55+
Assert.IsFalse (new CIExyY (0.65, 0.20, 100.0).IsInsideColorSpace ());
56+
Assert.IsFalse (new CIExyY (0.80, 0.80, 100.0).IsInsideColorSpace ());
5957

60-
Assert.IsTrue (new CIExyY (0.05, 0.30, 100.0).IsInsideColorSpace ());
61-
Assert.IsTrue (new CIExyY (0.10, 0.65, 100.0).IsInsideColorSpace ());
62-
Assert.IsTrue (new CIExyY (0.20, 0.10, 100.0).IsInsideColorSpace ());
63-
Assert.IsTrue (new CIExyY (0.65, 0.25, 100.0).IsInsideColorSpace ());
64-
Assert.IsTrue (new CIExyY (0.70, 0.25, 100.0).IsInsideColorSpace ());
65-
}
58+
Assert.IsTrue (new CIExyY (0.05, 0.30, 100.0).IsInsideColorSpace ());
59+
Assert.IsTrue (new CIExyY (0.10, 0.65, 100.0).IsInsideColorSpace ());
60+
Assert.IsTrue (new CIExyY (0.20, 0.10, 100.0).IsInsideColorSpace ());
61+
Assert.IsTrue (new CIExyY (0.65, 0.25, 100.0).IsInsideColorSpace ());
62+
Assert.IsTrue (new CIExyY (0.70, 0.25, 100.0).IsInsideColorSpace ());
6663
}
6764
}
6865
}

ColorSharp/tests/LightSpectrums/RegularLightSpectrumTest.cs renamed to ColorSharpTests/tests/LightSpectrums/RegularLightSpectrumTest.cs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,24 @@
2828

2929

3030
using NUnit.Framework;
31+
using Litipk.ColorSharp.LightSpectrums;
3132

3233

33-
namespace Litipk.ColorSharp
34+
namespace Litipk.ColorSharpTests
3435
{
35-
namespace LightSpectrums
36+
[TestFixture]
37+
public class RegularLightSpectrumTest
3638
{
37-
[TestFixture]
38-
public class RegularLightSpectrumTest
39+
[Test]
40+
public void TestEvaluateAt()
3941
{
40-
[Test]
41-
public void TestEvaluateAt()
42-
{
43-
var ls = new RegularLightSpectrum (100.0, 200.0, new [] { 20.0, 50.0, 20.0 });
42+
var ls = new RegularLightSpectrum (100.0, 200.0, new [] { 20.0, 50.0, 20.0 });
4443

45-
Assert.AreEqual (20.0, ls.EvaluateAt (100.0), 0.00001);
46-
Assert.AreEqual (35.0, ls.EvaluateAt (125.0), 0.00001);
47-
Assert.AreEqual (50.0, ls.EvaluateAt (150.0), 0.00001);
48-
Assert.AreEqual (35.0, ls.EvaluateAt (175.0), 0.00001);
49-
Assert.AreEqual (20.0, ls.EvaluateAt (200.0), 0.00001);
50-
}
44+
Assert.AreEqual (20.0, ls.EvaluateAt (100.0), 0.00001);
45+
Assert.AreEqual (35.0, ls.EvaluateAt (125.0), 0.00001);
46+
Assert.AreEqual (50.0, ls.EvaluateAt (150.0), 0.00001);
47+
Assert.AreEqual (35.0, ls.EvaluateAt (175.0), 0.00001);
48+
Assert.AreEqual (20.0, ls.EvaluateAt (200.0), 0.00001);
5149
}
5250
}
5351
}

0 commit comments

Comments
 (0)