package com.adobe.acs.commons.dam.impl;

import static org.junit.Assert.assertEquals;

import com.adobe.acs.commons.dam.ColorConversion;
import org.junit.Before;
import org.junit.Test;

import java.util.Collections;


/**
 * Created by jedelson on 6/11/16.
 */
public class ColorConversionImplTest {

    private ColorConversionImpl impl;

    @Before
    public void setup() throws Exception {
        impl = new ColorConversionImpl();
        impl.activate(Collections.<String, Object>emptyMap());
    }

    @Test
    public void testCmyk() {
        ColorConversion.CMYK cmyk = new ColorConversion.CMYK(0,0,100,0);

        ColorConversion.RGB rgb = impl.toRGB(cmyk);
        assertEquals(255, rgb.red);
        assertEquals(241, rgb.green);
        assertEquals(0, rgb.blue);
    }


    @Test
    public void testLab() {
        ColorConversion.LAB lab = new ColorConversion.LAB(54, -16, -36);

        ColorConversion.RGB rgb = impl.toRGB(lab);
        assertEquals(0, rgb.red);
        assertEquals(140, rgb.green);
        assertEquals(191, rgb.blue);

    }
}

@@ -1,8 +1,651 @@
+/*%0A * #%25L%0A * ACS AEM Commons Bundle%0A * %25%25%0A * Copyright (C) 2016 Adobe%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0A
 package 
@@ -857,52 +857,8 @@
 s;%0A%0A
-%0A/**%0A * Created by jedelson on 6/11/16.%0A */%0A
 publ

fix license header on test