<?php

declare(strict_types=1);

namespace Tests\Billing;

use App\Billing\Invoice;
use App\Billing\LineItem;
use PHPUnit\Framework\TestCase;

final class InvoiceTest extends TestCase
{
    public function testTotalAddsLineItems(): void
    {
        $invoice = new Invoice([new LineItem(1200), new LineItem(300)]);

        $this->assertSame(1500, $invoice->total());
    }

    public function testTotalOfAnEmptyInvoiceIsZero(): void
    {
        $this->assertSame(0, (new Invoice([]))->total());
    }

    public function testVatIsRoundedToCents(): void
    {
        $this->markTestSkipped('Rounding changed with the new tax tables');

        $invoice = new Invoice([new LineItem(999)]);

        $this->assertSame(190, $invoice->vat());
    }
}
