<?php


namespace Tests\Services\OracleDocAsnHeaderService;


use App\Services\OracleDocAsnHerderService;
use Carbon\Carbon;
use Tests\TestCase;

class getWmsAsnOnStartDateCreateOrEditTest extends TestCase
{
    /** @var OracleDocAsnHerderService $service */
    public $service;
    public $startDate;
    public  function setUp(): void
    {
        parent::setUp(); // TODO: Change the autogenerated stub
        $this->service  = app(OracleDocAsnHerderService::class);
        $dataInterval = intval(data_get(config('sync'), 'asn_sync.interval')) * 60 + 5;
        $this->startDate = \Illuminate\Support\Carbon::now()->subSeconds($dataInterval);
    }

    public function testGetWmsAsnOnStartDateCreate(){
        $asnHerders=$this->service->getWmsAsnOnStartDateCreate($this->startDate);
        if ($asnHerders) $this->assertNotNull($asnHerders);
        $this->startDate=null;
        $asnHerders=$this->service->getWmsAsnOnStartDateCreate($this->startDate);
        $this->assertNull($asnHerders);
    }
    public function testGetWmsAsnOnStartDateEdit(){
        $asnHerders=$this->service->getWmsAsnOnStartDateEdit($this->startDate);
        if ($asnHerders) $this->assertNotNull($asnHerders);
        $this->startDate=null;
        $asnHerders=$this->service->getWmsAsnOnStartDateEdit($this->startDate);
        $this->assertNull($asnHerders);
    }
}
