public void Convert_Lab_to_Luv(DataRow row)
        {
            var inputLab    = row.GetLabColor();
            var expectedLuv = row.GetLuvColor();
            var actualLuv   = Converter.ToLuv(inputLab);

            Assert.Equal(actualLuv, expectedLuv, new ColorVectorComparer(new DoubleDeltaComparer(0.00000105)));
        }
        public void Convert_Lab_to_xyY(DataRow row)
        {
            var inputLab    = row.GetLabColor();
            var expectedxyY = row.GetxyYColor();
            var actualxyY   = Converter.ToxyY(inputLab);

            Assert.Equal(actualxyY, expectedxyY, new ColorVectorComparer(new DoubleDeltaComparer(0.000001)));
        }
        public void Convert_Lab_to_LChab(DataRow row)
        {
            var inputLab      = row.GetLabColor();
            var expectedLChab = row.GetLChabColor();
            var actualLChab   = Converter.ToLChab(inputLab);

            Assert.Equal(actualLChab, expectedLChab, new ColorVectorComparer(new DoubleDeltaComparer(0.00017)));
        }
        public void Convert_Lab_to_RGB(DataRow row)
        {
            var inputLab    = row.GetLabColor();
            var expectedRGB = row.GetRGBColor();
            var actualRGB   = Converter.ToRGB(inputLab);

            Assert.Equal(actualRGB, expectedRGB, new ColorVectorComparer(new DoubleDeltaComparer(0.00912)));
        }
        public void Convert_Lab_to_XYZ(DataRow row)
        {
            var inputLab    = row.GetLabColor();
            var expectedXYZ = row.GetXYZColor();
            var actualXYZ   = Converter.ToXYZ(inputLab);

            Assert.Equal(actualXYZ, expectedXYZ, new ColorVectorComparer(new DoubleDeltaComparer(0.000001)));
        }
Beispiel #6
0
        public void Convert_Lab_to_LChab(DataRow row)
        {
            var inputLab      = row.GetLabColor();
            var expectedLChab = row.GetLChabColor();
            var actualLChab   = _converter.ToLChab(inputLab);

            try
            {
                Assert.That(actualLChab, Is.EqualTo(expectedLChab)
                            .Using(new ColorVectorComparer(new DoubleDeltaComparer(0.00017))));
            }
            catch (AssertionException ex) { RethrowException(ex, row); }
        }
Beispiel #7
0
        public void Convert_Lab_to_RGB(DataRow row)
        {
            var inputLab    = row.GetLabColor();
            var expectedRGB = row.GetRGBColor();
            var actualRGB   = _converter.ToRGB(inputLab);

            try
            {
                Assert.That(actualRGB, Is.EqualTo(expectedRGB)
                            .Using(new ColorVectorComparer(new DoubleDeltaComparer(0.00912))));
            }
            catch (AssertionException ex) { RethrowException(ex, row); }
        }
Beispiel #8
0
 private void RethrowException(AssertionException ex, DataRow row)
 {
     throw new AssertionException(string.Format("[{0}]\n{1}", row.Name, ex.Message), ex);
 }