package model;

import controllers.MiniProjectController;
import demonstrateur.MiniProject;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * Created by neowutran on 22/01/14.
 */
public class EquipmentTest {

    @BeforeClass
    public static void onlyOnce() {

        try {
            final Method m = MiniProject.class.getDeclaredMethod("loadConfigFile",
                    Path.class);
            m.setAccessible(true);
            m.invoke(null, Paths.get(MiniProject.FOLDER, MiniProject.CONFIG));

        } catch (IllegalAccessException | IllegalArgumentException
                | InvocationTargetException | NoSuchMethodException
                | SecurityException e) {
            e.printStackTrace();
        }

        try {

            SaveLoad.load( SaveLoad.DATA );
        } catch( final MiniProjectException e ) {
            MiniProjectController.LOGGER.severe( java.util.Arrays.toString( e
                    .getStackTrace( ) ) );
        }
    }



    @Test
    public void testSetHealth() throws Exception {
        //TODO
    }

    @Test
    public void testSetUnderRepair() throws Exception {
        //TODO
    }

    @Test
    public void testCheckExistence() throws Exception {
        //TODO
    }

    @Test
    public void testEquals() throws Exception {
        //TODO
    }

    @Test
    public void testSetFeatures() throws Exception {
        //TODO
    }

}

@@ -9,16 +9,50 @@
 model;%0A%0A
+import static org.junit.Assert.*;%0A
 import c
@@ -337,16 +337,67 @@
 e.Paths;
+%0Aimport java.util.ArrayList;%0Aimport java.util.List;
 %0A%0A/**%0A *
@@ -1294,38 +1294,246 @@
 ption %7B%0A        
-//TODO
+Health h = new Health(HealthState.OK);%0A        Equipment e = new Equipment(%22tablet%22, new ArrayList%3CFeature%3E(), new Health(HealthState.NOT_OK), false);%0A        e.setHealth(h);%0A        assertEquals(h, e.getHealth());
 %0A    %7D%0A%0A    @Tes

test EquipmentTest#setHealth