package com.oguerreiro.resilient.service.mapper;

import static com.oguerreiro.resilient.domain.UnitConverterAsserts.*;
import static com.oguerreiro.resilient.domain.UnitConverterTestSamples.*;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

class UnitConverterMapperTest {

    private UnitConverterMapper unitConverterMapper;

    @BeforeEach
    void setUp() {
        unitConverterMapper = new UnitConverterMapperImpl();
    }

    @Test
    void shouldConvertToDtoAndBack() {
        var expected = getUnitConverterSample1();
        var actual = unitConverterMapper.toEntity(unitConverterMapper.toDto(expected));
        assertUnitConverterAllPropertiesEquals(expected, actual);
    }
}
