<?php

/**
 * GetBinReceivedDocumentResponseTest
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  FattureInCloud
 * @author   Fatture In Cloud API team
 * @link     https://fattureincloud.it
 */

/**
 * Fatture in Cloud API v2 - API Reference
 *
 * Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 500.000 businesses in Italy.   The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol.
 *
 * The version of the OpenAPI document: 2.1.5
 * Contact: info@fattureincloud.it
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.12.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Please update the test case below to test the model.
 */

namespace FattureInCloud\Test\Model;

use FattureInCloud\ObjectSerializer;
use PHPUnit\Framework\TestCase;

/**
 * GetBinReceivedDocumentResponseTest Class Doc Comment
 *
 * @category    Class
 * @description GetBinReceivedDocumentResponse
 * @package     FattureInCloud
 * @author   Fatture In Cloud API team
 * @link     https://fattureincloud.it
 */
class GetBinReceivedDocumentResponseTest extends TestCase
{
    public $array = [];
    public $object;


    /**
     * Setup before running any test case
     */
    public static function setUpBeforeClass(): void
    {
    }

    /**
     * Setup before running each test case
     */
    public function setUp(): void
    {
        $json = '{
            "data": {
                "id": 12345,
                "type": "expense",
                "description": "Soggiorno di lavoro",
                "amortization": 1,
                "rc_center": "",
                "invoice_number": "",
                "is_marked": false,
                "is_detailed": false,
                "e_invoice": false,
                "entity": {
                  "id": 111,
                  "name": "Hotel Rubino Palace"
                },
                "date": "2021-08-15",
                "next_due_date": "2021-08-15",
                "currency": {
                  "id": "EUR",
                  "exchange_rate": "1.00000",
                  "symbol": "€"
                },
                "amount_net": 592,
                "amount_vat": 0,
                "amount_gross": 592,
                "amount_withholding_tax": 0,
                "amount_other_withholding_tax": 0,
                "tax_deductibility": 50,
                "vat_deductibility": 100,
                "payments_list": [
                  {
                    "amount": 592,
                    "due_date": "2021-08-15",
                    "paid_date": "2021-08-15",
                    "id": 777,
                    "payment_terms": {
                      "days": 0,
                      "type": "standard"
                    },
                    "status": "paid",
                    "payment_account": {
                      "id": 222,
                      "name": "Contanti",
                      "virtual": false
                    }
                  }
                ],
                "attachment_url": "spesa_ger5i783t45hu6ti.pdf"
            }
        }';

        $this->array = json_decode($json, true);

        $this->object = ObjectSerializer::deserialize($json, '\FattureInCloud\Model\GetBinReceivedDocumentResponse');
    }

    /**
     * Clean up after running each test case
     */
    public function tearDown(): void
    {
    }

    /**
     * Clean up after running all test cases
     */
    public static function tearDownAfterClass(): void
    {
    }

    /**
     * Test "GetBinReceivedDocumentResponse"
     */
    public function testGetBinReceivedDocumentResponse()
    {
        foreach ($this->array as $key => $value) {
            TestCase::assertArrayHasKey($key, $this->object);
        }
    }

    /**
     * Test attribute "data"
     */
    public function testPropertyData()
    {
        foreach ($this->array['data'] as $key => $value) {
            TestCase::assertArrayHasKey($key, $this->object['data']);
        }
    }
}
