<?php declare(strict_types=1);

require_once __DIR__ . '/../../../src/storage/file/QrbFilePaths.php';

use PHPUnit\Framework\TestCase;

final class QrbFilePathsTest extends TestCase
{
    private QrbStorage $qrbStorage;
    
    protected function setUp(): void
    {
        $this->qrbStorage = new QrbFileStorage();
    }
    
    protected function tearDown() : void
    {
        $this->qrbStorage->deleteData();
    }
    
    public function testGetDataPath()
    {
        $this->assertEquals(QrbFiles::fixPath(__DIR__ . "/../../../data"), 
                            QrbFilePaths::getDataPath());
    }

    public function testGetProfilePath()
    {
        $this->assertEquals(QrbFiles::fixPath(__DIR__ . "/../../../data/QrbFilePathsTest"), 
                            QrbFilePaths::getProfilePath("QrbFilePathsTest"));
    }

    public function testGetInputPath()
    {
        $this->assertEquals(QrbFiles::fixPath(__DIR__ . "/../../../data/QrbFilePathsTest/input"), 
                            QrbFilePaths::getInputPath("QrbFilePathsTest"));
    }

    public function testGetOutputPath()
    {
        $this->assertEquals(QrbFiles::fixPath(__DIR__ . "/../../../data/QrbFilePathsTest/output"), 
                            QrbFilePaths::getOutputPath("QrbFilePathsTest"));
    }

    public function testGetOutputPathOfRun()
    {
        $this->assertEquals(QrbFiles::fixPath(__DIR__ . "/../../../data/QrbFilePathsTest/output/RunSubDir"), 
                            QrbFilePaths::getOutputPathOfRun("QrbFilePathsTest", "RunSubDir"));
    }

    public function testGetRelativeOutputPathOfRun()
    {
        $this->assertEquals("data/QrbFilePathsTest/output/RunSubDir", 
                            QrbFilePaths::getRelativeOutputPathOfRun("QrbFilePathsTest", "RunSubDir"));
    }
}

?>
