<?php

namespace Tests\Functional\Repositories;

use Tests\Functional\TestCase;
use App\Repositories\Tradecredits;
use App\Models\Tradecredit;

/**
 * @group Tradecredits
 */
class TradecreditsTest extends TestCase {

    public function testListContent() {
        $repository = new Tradecredits();
        $list = $repository->all()->get();

        $this->assertEquals(Tradecredit::NET_X_DAYS, $list[0]->id);
        $this->assertEquals('livror.labels.payments.types.'.Tradecredit::NET_X_DAYS, $list[0]->i18n);
        $this->assertEquals(Tradecredit::DUE_UPON_RECEPIT, $list[1]->id);
        $this->assertEquals('livror.labels.payments.types.'.Tradecredit::DUE_UPON_RECEPIT, $list[1]->i18n);
        $this->assertEquals(Tradecredit::X_DAYS_END_MONTH, $list[2]->id);
        $this->assertEquals('livror.labels.payments.types.'.Tradecredit::X_DAYS_END_MONTH, $list[2]->i18n);
        $this->assertEquals(Tradecredit::END_MONTH_X_DAYS, $list[3]->id);
        $this->assertEquals('livror.labels.payments.types.'.Tradecredit::END_MONTH_X_DAYS, $list[3]->i18n);
    }
}
