-
Notifications
You must be signed in to change notification settings - Fork 5
/
KnownJzczhzTests.cs
47 lines (40 loc) · 1.43 KB
/
KnownJzczhzTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using NUnit.Framework;
using Wacton.Unicolour.Tests.Utils;
namespace Wacton.Unicolour.Tests;
public class KnownJzczhzTests
{
private const double Tolerance = 0.0005;
private static readonly Configuration Jzazbz203Config = new(jzazbzScalar: 203);
[Test]
public void Red()
{
var red = StandardRgb.Red.ConvertToConfiguration(Jzazbz203Config);
TestUtils.AssertTriplet<Jzczhz>(red, new(0.13438, 0.16252, 43.502), Tolerance);
}
[Test]
public void Green()
{
var green = StandardRgb.Green.ConvertToConfiguration(Jzazbz203Config);
TestUtils.AssertTriplet<Jzczhz>(green, new(0.17681, 0.1614, 132.5), Tolerance);
}
[Test]
public void Blue()
{
var blue = StandardRgb.Blue.ConvertToConfiguration(Jzazbz203Config);
TestUtils.AssertTriplet<Jzczhz>(blue, new(0.09577, 0.19029, 257.61), Tolerance);
}
[Test]
public void Black()
{
var black = StandardRgb.Black.ConvertToConfiguration(Jzazbz203Config);
Assert.That(black.Jzczhz.J, Is.EqualTo(0.0).Within(Tolerance));
Assert.That(black.Jzczhz.C, Is.EqualTo(0.0).Within(Tolerance));
}
[Test]
public void White()
{
var white = StandardRgb.White.ConvertToConfiguration(Jzazbz203Config);
Assert.That(white.Jzczhz.J, Is.EqualTo(0.22207).Within(Tolerance));
Assert.That(white.Jzczhz.C, Is.EqualTo(0.0002).Within(Tolerance));
}
}