// 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.CustomerProperties;
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 CustomerPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CustomerProperties model =
            BinaryData
                .fromString(
                    "{\"billingProfileId\":\"pgn\",\"billingProfileDisplayName\":\"txhp\",\"displayName\":\"bzpfzab\",\"enabledAzurePlans\":[{\"skuId\":\"hxw\",\"skuDescription\":\"tyq\"}],\"resellers\":[{\"resellerId\":\"bovpl\",\"description\":\"bhvgy\"},{\"resellerId\":\"uosvmkfssxqukk\",\"description\":\"l\"}]}")
                .toObject(CustomerProperties.class);
        Assertions.assertEquals("bzpfzab", model.displayName());
        Assertions.assertEquals("hxw", model.enabledAzurePlans().get(0).skuId());
    }

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