// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.newrelicobservability.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner;
import com.azure.resourcemanager.newrelicobservability.models.BillingSource;
import org.junit.jupiter.api.Assertions;

public final class OrganizationResourceInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OrganizationResourceInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"organizationId\":\"okaj\",\"organizationName\":\"npime\",\"billingSource\":\"AZURE\"},\"id\":\"xgcp\",\"name\":\"dg\",\"type\":\"aajrm\"}")
                .toObject(OrganizationResourceInner.class);
        Assertions.assertEquals("okaj", model.organizationId());
        Assertions.assertEquals("npime", model.organizationName());
        Assertions.assertEquals(BillingSource.AZURE, model.billingSource());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OrganizationResourceInner model =
            new OrganizationResourceInner()
                .withOrganizationId("okaj")
                .withOrganizationName("npime")
                .withBillingSource(BillingSource.AZURE);
        model = BinaryData.fromObject(model).toObject(OrganizationResourceInner.class);
        Assertions.assertEquals("okaj", model.organizationId());
        Assertions.assertEquals("npime", model.organizationName());
        Assertions.assertEquals(BillingSource.AZURE, model.billingSource());
    }
}
