public void ChromaticityFromCCT(double expectedX, double expectedY, double cct) { // action var chromaticity = CCTConverter.GetChromaticityOfCCT(cct); // assert var deltaComparer = new DoubleDeltaComparer(0.02); Assert.Equal(chromaticity.x, expectedX, deltaComparer); Assert.Equal(chromaticity.y, expectedY, deltaComparer); }
public void ChromaticityFromCCT(double expectedX, double expectedY, double cct) { // arrange var approximation = new CCTConverter(); // action xyChromaticityCoordinates chromaticity = approximation.GetChromaticityOfCCT(cct); // assert var deltaComparer = new DoubleDeltaComparer(0.02); Assert.That(chromaticity.x, Is.EqualTo(expectedX).Using(deltaComparer)); Assert.That(chromaticity.y, Is.EqualTo(expectedY).Using(deltaComparer)); }
public void CCTFromChromaticity(double x, double y, double expectedCCT) { // arrange var chromaticity = new xyChromaticityCoordinates(x, y); // action var cct = CCTConverter.GetCCTOfChromaticity(chromaticity); // assert Debug.WriteLine($"CCT {cct} K (difference {Math.Abs(expectedCCT - cct)} K)"); var deltaComparer = new DoubleDeltaComparer(66); Assert.Equal(cct, expectedCCT, deltaComparer); }