// 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 com.azure.resourcemanager.logic.models.PartnerContent;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PartnerContentTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PartnerContent model =
            BinaryData
                .fromString("{\"b2b\":{\"businessIdentities\":[{\"qualifier\":\"nytx\",\"value\":\"fq\"}]}}")
                .toObject(PartnerContent.class);
        Assertions.assertEquals("nytx", model.b2B().businessIdentities().get(0).qualifier());
        Assertions.assertEquals("fq", model.b2B().businessIdentities().get(0).value());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PartnerContent model =
            new PartnerContent()
                .withB2B(
                    new B2BPartnerContent()
                        .withBusinessIdentities(
                            Arrays.asList(new BusinessIdentity().withQualifier("nytx").withValue("fq"))));
        model = BinaryData.fromObject(model).toObject(PartnerContent.class);
        Assertions.assertEquals("nytx", model.b2B().businessIdentities().get(0).qualifier());
        Assertions.assertEquals("fq", model.b2B().businessIdentities().get(0).value());
    }
}
