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

package com.azure.resourcemanager.billing.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.billing.fluent.models.CustomerInner;
import com.azure.resourcemanager.billing.models.AzurePlan;
import com.azure.resourcemanager.billing.models.Reseller;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CustomerInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CustomerInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"billingProfileId\":\"l\",\"billingProfileDisplayName\":\"kx\",\"displayName\":\"skpbhenbtkcxywn\",\"enabledAzurePlans\":[{\"skuId\":\"synlqidybyxczfc\",\"skuDescription\":\"aaxdbabphlwrq\"}],\"resellers\":[{\"resellerId\":\"sthsu\",\"description\":\"cmnyyazttb\"},{\"resellerId\":\"wrqpue\",\"description\":\"kzywbiex\"},{\"resellerId\":\"eyueaxibxujwb\",\"description\":\"walm\"},{\"resellerId\":\"yoxa\",\"description\":\"dkzjancuxrh\"}]},\"id\":\"wbavxbniwdj\",\"name\":\"wz\",\"type\":\"s\"}")
                .toObject(CustomerInner.class);
        Assertions.assertEquals("skpbhenbtkcxywn", model.displayName());
        Assertions.assertEquals("synlqidybyxczfc", model.enabledAzurePlans().get(0).skuId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CustomerInner model =
            new CustomerInner()
                .withDisplayName("skpbhenbtkcxywn")
                .withEnabledAzurePlans(Arrays.asList(new AzurePlan().withSkuId("synlqidybyxczfc")))
                .withResellers(Arrays.asList(new Reseller(), new Reseller(), new Reseller(), new Reseller()));
        model = BinaryData.fromObject(model).toObject(CustomerInner.class);
        Assertions.assertEquals("skpbhenbtkcxywn", model.displayName());
        Assertions.assertEquals("synlqidybyxczfc", model.enabledAzurePlans().get(0).skuId());
    }
}
