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

package com.azure.resourcemanager.signalr.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.signalr.fluent.models.CustomDomainInner;
import com.azure.resourcemanager.signalr.models.CustomDomainList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CustomDomainListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CustomDomainList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"provisioningState\":\"Running\",\"domainName\":\"gynduha\"},\"id\":\"hqlkthumaqo\",\"name\":\"bgycduiertgccym\",\"type\":\"aolps\"},{\"properties\":{\"provisioningState\":\"Creating\",\"domainName\":\"fmmdnbbg\"},\"id\":\"zpswiydmc\",\"name\":\"yhz\",\"type\":\"xssadbzmnvdf\"},{\"properties\":{\"provisioningState\":\"Moving\",\"domainName\":\"ao\"},\"id\":\"vxzbncb\",\"name\":\"ylpstdbhhxsrzdz\",\"type\":\"cers\"}],\"nextLink\":\"ntnev\"}")
                .toObject(CustomDomainList.class);
        Assertions.assertEquals("gynduha", model.value().get(0).domainName());
        Assertions.assertEquals("ntnev", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CustomDomainList model =
            new CustomDomainList()
                .withValue(
                    Arrays
                        .asList(
                            new CustomDomainInner().withDomainName("gynduha"),
                            new CustomDomainInner().withDomainName("fmmdnbbg"),
                            new CustomDomainInner().withDomainName("ao")))
                .withNextLink("ntnev");
        model = BinaryData.fromObject(model).toObject(CustomDomainList.class);
        Assertions.assertEquals("gynduha", model.value().get(0).domainName());
        Assertions.assertEquals("ntnev", model.nextLink());
    }
}
