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

package com.azure.resourcemanager.logic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logic.models.B2BPartnerContent;
import com.azure.resourcemanager.logic.models.BusinessIdentity;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class B2BPartnerContentTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        B2BPartnerContent model =
            BinaryData
                .fromString(
                    "{\"businessIdentities\":[{\"qualifier\":\"xmrhu\",\"value\":\"lw\"},{\"qualifier\":\"cesutrgjupauut\",\"value\":\"woqhihe\"},{\"qualifier\":\"qg\",\"value\":\"zpnfqntcypsxj\"}]}")
                .toObject(B2BPartnerContent.class);
        Assertions.assertEquals("xmrhu", model.businessIdentities().get(0).qualifier());
        Assertions.assertEquals("lw", model.businessIdentities().get(0).value());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        B2BPartnerContent model =
            new B2BPartnerContent()
                .withBusinessIdentities(
                    Arrays
                        .asList(
                            new BusinessIdentity().withQualifier("xmrhu").withValue("lw"),
                            new BusinessIdentity().withQualifier("cesutrgjupauut").withValue("woqhihe"),
                            new BusinessIdentity().withQualifier("qg").withValue("zpnfqntcypsxj")));
        model = BinaryData.fromObject(model).toObject(B2BPartnerContent.class);
        Assertions.assertEquals("xmrhu", model.businessIdentities().get(0).qualifier());
        Assertions.assertEquals("lw", model.businessIdentities().get(0).value());
    }
}
