package edu.uoc.prezmm.a1list2cook.objects_class;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;

public class StepsTest {

    private Steps object;

    private String code;
    private String name;

    @Before
    public void setUp() {
        object = mock(Steps.class);

        code = "1";
        name = "Step 1";

        object = new Steps(code,name);
    }

    @Test
    //Comprova que s'obte el valor esperat del tipus int
    public void getCode() {
        assertEquals(Integer.parseInt(code),object.getCode());
    }

    @Test
    //Comprova que es pot modificar correctament el valor i retorna un int
    public void setCode() {
        int newValue = 2;
        object.setCode(newValue);
        assertEquals(newValue,object.getCode());
    }

    @Test
    //Comprova que s'obte el valor esperat
    public void getName() {
        assertEquals(name,object.getName());
    }

    @Test
    //Comprova que es pot modificar correctament el valor i retorna un String
    public void setName() {
        String newValue = "Step 2";
        object.setName(newValue);
        assertEquals(newValue,object.getName());
    }
}