package com.oguerreiro.resilient.service.mapper;

import static com.oguerreiro.resilient.domain.PeriodAsserts.*;
import static com.oguerreiro.resilient.domain.PeriodTestSamples.*;

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

class PeriodMapperTest {

    private PeriodMapper periodMapper;

    @BeforeEach
    void setUp() {
        periodMapper = new PeriodMapperImpl();
    }

    @Test
    void shouldConvertToDtoAndBack() {
        var expected = getPeriodSample1();
        var actual = periodMapper.toEntity(periodMapper.toDto(expected));
        assertPeriodAllPropertiesEquals(expected, actual);
    }
}
