/**
 * Copyright © CENRA (2016)
 *
 * remi.clement@espaces-naturels.fr
 *
 * This software is a multi-platform and portable application based on
 * the scientifical toolbox to monitor wetlands. With this toolbox it’s
 * possible to calculate indicators «RhoMéO» to monitor quality,
 * fonctionalities and urban and agricultural pressures of wetlands.
 * Indicators are calculated using naturalist data entered and/or imported,
 * and geographic data downloaded from a geographic server.
 *
 * This software is governed by the CeCILL license under French law and
 * abiding by the rules of distribution of free software.  You can  use,
 * modify and/ or redistribute the software under the terms of the CeCILL
 * license as circulated by CEA, CNRS and INRIA at the following URL
 * "http://www.cecill.info".
 *
 * As a counterpart to the access to the source code and  rights to copy,
 * modify and redistribute granted by the license, users are provided only
 * with a limited warranty  and the software's author,  the holder of the
 * economic rights,  and the successive licensors  have only  limited
 * liability.
 *
 * In this respect, the user's attention is drawn to the risks associated
 * with loading,  using,  modifying and/or developing or reproducing the
 * software by the user in light of its specific status of free software,
 * that may mean  that it is complicated to manipulate,  and  that  also
 * therefore means  that it is reserved for developers  and  experienced
 * professionals having in-depth computer knowledge. Users are therefore
 * encouraged to load and test the software's suitability as regards their
 * requirements in conditions enabling the security of their systems and/or
 * data to be ensured and,  more generally, to use and operate it in the
 * same conditions as regards security.
 *
 * The fact that you are presently reading this means that you have had
 * knowledge of the CeCILL license and that you accept its terms.
*/
package fr.cenra.rhomeo.protocol;

import fr.cenra.rhomeo.RhomeoTestCase;
import fr.cenra.rhomeo.api.data.Protocol;
import fr.cenra.rhomeo.api.process.Indicator;
import fr.cenra.rhomeo.protocol.p01.I01;
import fr.cenra.rhomeo.protocol.p01.P01;
import fr.cenra.rhomeo.protocol.p02.I02;
import fr.cenra.rhomeo.protocol.p02.P02;
import fr.cenra.rhomeo.protocol.p05.I05;
import fr.cenra.rhomeo.protocol.p05.I09;
import fr.cenra.rhomeo.protocol.p05.P05;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

/**
 *
 * @author Samuel Andrés (Geomatys)
 */
public class IndicatorsTest extends RhomeoTestCase {

    @Autowired
    private Map<String, Indicator> indicators;

    @Autowired
    private Map<String, Protocol> protocols;

    @Test
    public void testName(){

        Assert.assertEquals(I01.NAME, indicators.get(I01.NAME).getName());
        Assert.assertEquals(I02.NAME, indicators.get(I02.NAME).getName());
//        Assert.assertEquals(I03.NAME, indicators.get(I03.NAME).getName());
//        Assert.assertEquals(I04.NAME, indicators.get(I04.NAME).getName());
        Assert.assertEquals(I05.NAME, indicators.get(I05.NAME).getName());
//        Assert.assertEquals(I06.NAME, indicators.get(I06.NAME).getName());
//        Assert.assertEquals(I07.NAME, indicators.get(I07.NAME).getName());
//        Assert.assertEquals(I08.NAME, indicators.get(I08.NAME).getName());
        Assert.assertEquals(I09.NAME, indicators.get(I09.NAME).getName());
//        Assert.assertEquals(I10.NAME, indicators.get(I10.NAME).getName());
//        Assert.assertEquals(I11.NAME, indicators.get(I11.NAME).getName());
//        Assert.assertEquals(I12.NAME, indicators.get(I12.NAME).getName());
//        Assert.assertEquals(I13.NAME, indicators.get(I13.NAME).getName());
    }

    @Test
    public void testRemark(){

        Assert.assertEquals(I01.REMARKS, indicators.get(I01.NAME).getRemarks());
        Assert.assertEquals(I02.REMARKS, indicators.get(I02.NAME).getRemarks());
//        Assert.assertEquals(I03.REMARKS, indicators.get(I03.NAME).getRemarks());
//        Assert.assertEquals(I04.REMARKS, indicators.get(I04.NAME).getRemarks());
        Assert.assertEquals(I05.REMARKS, indicators.get(I05.NAME).getRemarks());
//        Assert.assertEquals(I06.REMARKS, indicators.get(I06.NAME).getRemarks());
//        Assert.assertEquals(I07.REMARKS, indicators.get(I07.NAME).getRemarks());
//        Assert.assertEquals(I08.REMARKS, indicators.get(I08.NAME).getRemarks());
        Assert.assertEquals(I09.REMARKS, indicators.get(I09.NAME).getRemarks());
//        Assert.assertEquals(I10.REMARKS, indicators.get(I10.NAME).getRemarks());
//        Assert.assertEquals(I11.REMARKS, indicators.get(I11.NAME).getRemarks());
//        Assert.assertEquals(I12.REMARKS, indicators.get(I12.NAME).getRemarks());
//        Assert.assertEquals(I13.REMARKS, indicators.get(I13.NAME).getRemarks());
    }

    @Test
    public void testProtocol(){

        Assert.assertNotNull(indicators.get(I01.NAME).getProtocol());
        Assert.assertNotNull(indicators.get(I02.NAME).getProtocol());
//        Assert.assertNotNull(indicators.get(I03.NAME).getProtocol());
//        Assert.assertNotNull(indicators.get(I04.NAME).getProtocol());
        Assert.assertNotNull(indicators.get(I05.NAME).getProtocol());
//        Assert.assertNotNull(indicators.get(I06.NAME).getProtocol());
//        Assert.assertNotNull(indicators.get(I07.NAME).getProtocol());
//        Assert.assertNotNull(indicators.get(I08.NAME).getProtocol());
        Assert.assertNotNull(indicators.get(I09.NAME).getProtocol());
//        Assert.assertNotNull(indicators.get(I10.NAME).getProtocol());
//        Assert.assertNotNull(indicators.get(I11.NAME).getProtocol());
//        Assert.assertNotNull(indicators.get(I12.NAME).getProtocol());
//        Assert.assertNotNull(indicators.get(I13.NAME).getProtocol());

        Assert.assertSame(protocols.get(P01.NAME), indicators.get(I01.NAME).getProtocol());
        Assert.assertSame(protocols.get(P02.NAME), indicators.get(I02.NAME).getProtocol());
//        Assert.assertSame(protocols.get(P03.NAME), indicators.get(I03.NAME).getProtocol());
//        Assert.assertSame(protocols.get(P04.NAME), indicators.get(I04.NAME).getProtocol());
        Assert.assertSame(protocols.get(P05.NAME), indicators.get(I05.NAME).getProtocol());
//        Assert.assertSame(protocols.get(P02.NAME), indicators.get(I06.NAME).getProtocol());
//        Assert.assertSame(protocols.get(P04.NAME), indicators.get(I07.NAME).getProtocol());
//        Assert.assertSame(protocols.get(P02.NAME), indicators.get(I08.NAME).getProtocol());
        Assert.assertSame(protocols.get(P05.NAME), indicators.get(I09.NAME).getProtocol());
//        Assert.assertSame(protocols.get(P06.NAME), indicators.get(I10.NAME).getProtocol());
//        Assert.assertSame(protocols.get(P07.NAME), indicators.get(I11.NAME).getProtocol());
//        Assert.assertSame(protocols.get(P08.NAME), indicators.get(I12.NAME).getProtocol());
//        Assert.assertSame(protocols.get(P09.NAME), indicators.get(I13.NAME).getProtocol());
    }
}
