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

package com.azure.resourcemanager.apimanagement.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.apimanagement.fluent.models.WikiContractInner;
import com.azure.resourcemanager.apimanagement.models.WikiDocumentationContract;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class WikiContractInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WikiContractInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"documents\":[{\"documentationId\":\"cunnuzdqumoenodn\"},{\"documentationId\":\"enhqhskndnelq\"},{\"documentationId\":\"adlknwfoanni\"}]},\"id\":\"op\",\"name\":\"txiv\",\"type\":\"nrlyxnuc\"}")
                .toObject(WikiContractInner.class);
        Assertions.assertEquals("cunnuzdqumoenodn", model.documents().get(0).documentationId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WikiContractInner model =
            new WikiContractInner()
                .withDocuments(
                    Arrays
                        .asList(
                            new WikiDocumentationContract().withDocumentationId("cunnuzdqumoenodn"),
                            new WikiDocumentationContract().withDocumentationId("enhqhskndnelq"),
                            new WikiDocumentationContract().withDocumentationId("adlknwfoanni")));
        model = BinaryData.fromObject(model).toObject(WikiContractInner.class);
        Assertions.assertEquals("cunnuzdqumoenodn", model.documents().get(0).documentationId());
    }
}
