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

package com.azure.resourcemanager.redisenterprise.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.redisenterprise.models.Capability;
import com.azure.resourcemanager.redisenterprise.models.LocationInfo;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class LocationInfoTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LocationInfo model =
            BinaryData
                .fromString(
                    "{\"location\":\"iyqzrnk\",\"capabilities\":[{\"name\":\"xlwhzlsicoh\",\"value\":false},{\"name\":\"wvl\",\"value\":true},{\"name\":\"w\",\"value\":false},{\"name\":\"nmmqhgyxzkon\",\"value\":false}]}")
                .toObject(LocationInfo.class);
        Assertions.assertEquals("iyqzrnk", model.location());
        Assertions.assertEquals("xlwhzlsicoh", model.capabilities().get(0).name());
        Assertions.assertEquals(false, model.capabilities().get(0).value());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LocationInfo model =
            new LocationInfo()
                .withLocation("iyqzrnk")
                .withCapabilities(
                    Arrays
                        .asList(
                            new Capability().withName("xlwhzlsicoh").withValue(false),
                            new Capability().withName("wvl").withValue(true),
                            new Capability().withName("w").withValue(false),
                            new Capability().withName("nmmqhgyxzkon").withValue(false)));
        model = BinaryData.fromObject(model).toObject(LocationInfo.class);
        Assertions.assertEquals("iyqzrnk", model.location());
        Assertions.assertEquals("xlwhzlsicoh", model.capabilities().get(0).name());
        Assertions.assertEquals(false, model.capabilities().get(0).value());
    }
}
