package com.agileboot.domain.collaboration.record.enumtype;

import java.util.Arrays;
import java.util.Collections;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class SettlementStatusEnumTest {

    @Test
    void aggregateShouldIgnoreNoneStatus() {
        String status = SettlementStatusEnum.aggregate(Arrays.asList("NONE", "SETTLED"));

        Assertions.assertEquals("SETTLED", status);
    }

    @Test
    void aggregateShouldReturnPartialWhenStatusesAreMixed() {
        String status = SettlementStatusEnum.aggregate(Arrays.asList("SETTLED", "UNSETTLED"));

        Assertions.assertEquals("PARTIAL", status);
    }

    @Test
    void aggregateShouldReturnNoneWhenNoEffectiveStatusExists() {
        String status = SettlementStatusEnum.aggregate(Collections.singletonList("NONE"));

        Assertions.assertEquals("NONE", status);
    }

    @Test
    void aggregateShouldReturnNoneWhenStatusListIsEmpty() {
        String status = SettlementStatusEnum.aggregate(Collections.emptyList());

        Assertions.assertEquals("NONE", status);
    }

}
