Example #1
0
        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);
        }
Example #2
0
        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));
        }
Example #3
0
        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);
        }