package com.oguerreiro.resilient.domain;

import static com.oguerreiro.resilient.domain.UnitTestSamples.*;
import static com.oguerreiro.resilient.domain.VariableTestSamples.*;
import static com.oguerreiro.resilient.domain.VariableUnitsTestSamples.*;
import static org.assertj.core.api.Assertions.assertThat;

import com.oguerreiro.resilient.web.rest.TestUtil;
import org.junit.jupiter.api.Test;

class VariableUnitsTest {

    @Test
    void equalsVerifier() throws Exception {
        TestUtil.equalsVerifier(VariableUnits.class);
        VariableUnits variableUnits1 = getVariableUnitsSample1();
        VariableUnits variableUnits2 = new VariableUnits();
        assertThat(variableUnits1).isNotEqualTo(variableUnits2);

        variableUnits2.setId(variableUnits1.getId());
        assertThat(variableUnits1).isEqualTo(variableUnits2);

        variableUnits2 = getVariableUnitsSample2();
        assertThat(variableUnits1).isNotEqualTo(variableUnits2);
    }

    @Test
    void variableTest() {
        VariableUnits variableUnits = getVariableUnitsRandomSampleGenerator();
        Variable variableBack = getVariableRandomSampleGenerator();

        variableUnits.setVariable(variableBack);
        assertThat(variableUnits.getVariable()).isEqualTo(variableBack);

        variableUnits.variable(null);
        assertThat(variableUnits.getVariable()).isNull();
    }

    @Test
    void unitTest() {
        VariableUnits variableUnits = getVariableUnitsRandomSampleGenerator();
        Unit unitBack = getUnitRandomSampleGenerator();

        variableUnits.setUnit(unitBack);
        assertThat(variableUnits.getUnit()).isEqualTo(unitBack);

        variableUnits.unit(null);
        assertThat(variableUnits.getUnit()).isNull();
    }
}
