예제 #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);
        }
예제 #2
0
파일: CCTTest.cs 프로젝트: ibebbs/Colourful
        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));
        }
예제 #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);
        }