package io.delphiplatform.api.v3.model.datahealth;

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

import io.delphiplatform.api.exception.InvalidParameterException;

public class DataHealthStatusTest {

    @Test
    void testFromValueException() {
        Throwable exception = Assertions
            .assertThrows(InvalidParameterException.class, () -> DataHealthStatus.fromValue("asd"));

        Assertions.assertEquals(
            "status should be at least one from [missing,pending,partial,complete_minimal,complete_volatile,complete] : unexpected value 'asd'",
            exception.getMessage());

    }

    @Test
    void testFromValueAllValues() {
        for (DataHealthStatus e : DataHealthStatus.values()) {
            DataHealthStatus.fromValue(e.getValue());
        }
        //no exception, everything is fine!
    }


}
