package com.oguerreiro.resilient.domain;

import static com.oguerreiro.resilient.domain.VariableClassTestSamples.*;
import static com.oguerreiro.resilient.domain.VariableClassTypeTestSamples.*;
import static org.assertj.core.api.Assertions.assertThat;

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

class VariableClassTest {

    @Test
    void equalsVerifier() throws Exception {
        TestUtil.equalsVerifier(VariableClass.class);
        VariableClass variableClass1 = getVariableClassSample1();
        VariableClass variableClass2 = new VariableClass();
        assertThat(variableClass1).isNotEqualTo(variableClass2);

        variableClass2.setId(variableClass1.getId());
        assertThat(variableClass1).isEqualTo(variableClass2);

        variableClass2 = getVariableClassSample2();
        assertThat(variableClass1).isNotEqualTo(variableClass2);
    }

    @Test
    void variableTest() {
        VariableClass variableClass = getVariableClassRandomSampleGenerator();
        VariableClassType variableClassTypeBack = getVariableClassTypeRandomSampleGenerator();

        variableClass.setVariableClassType(variableClassTypeBack);
        assertThat(variableClass.getVariableClassType()).isEqualTo(variableClassTypeBack);

        variableClass.variableClassType(null);
        assertThat(variableClass.getVariableClassType()).isNull();
    }
}
