<?php

namespace Ecomnova\Tests;

use Ecomnova\AddressFields;
use PHPUnit\Framework\TestCase;

class AddressFieldsTest extends TestCase
{
    public function testSettingAndGettingAddressFields()
    {
        $addressFields = new AddressFields(
            'SW1A 1AA',
            'Buckingham Palace',
            '',
            '',
            'London',
            'London',
            'UK'
        );

        $this->assertEquals([
            'postcode' => 'SW1A 1AA',
            'companyName' => 'Buckingham Palace',
            'addressLine1' => '',
            'addressLine2' => '',
            'town' => 'London',
            'county' => 'London',
            'country' => 'UK',
        ], $addressFields->getAddressFields());

        $addressFields = new AddressFields(
            'SW1A 1AA',
            'Buckingham Palace',
            'SomeLine1',
            'SomeLine2',
            'London Town',
            'London County',
            'UK'
        );

        $this->assertEquals([
            'postcode' => 'SW1A 1AA',
            'companyName' => 'Buckingham Palace',
            'addressLine1' => 'SomeLine1',
            'addressLine2' => 'SomeLine2',
            'town' => 'London Town',
            'county' => 'London County',
            'country' => 'UK',
        ], $addressFields->getAddressFields());
    }
}