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

package com.azure.resourcemanager.vmwarecloudsimple.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.CustomizationPolicyInner;
import com.azure.resourcemanager.vmwarecloudsimple.models.CustomizationPoliciesListResponse;
import com.azure.resourcemanager.vmwarecloudsimple.models.CustomizationPolicyPropertiesType;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CustomizationPoliciesListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CustomizationPoliciesListResponse model =
            BinaryData
                .fromString(
                    "{\"nextLink\":\"hgwxrtfudx\",\"value\":[{\"id\":\"yqagvrvm\",\"location\":\"k\",\"name\":\"ghimdblx\",\"properties\":{\"description\":\"mfnjh\",\"privateCloudId\":\"xw\",\"type\":\"LINUX\",\"version\":\"foqreyfkzik\"},\"type\":\"aw\"}]}")
                .toObject(CustomizationPoliciesListResponse.class);
        Assertions.assertEquals("hgwxrtfudx", model.nextLink());
        Assertions.assertEquals("yqagvrvm", model.value().get(0).id());
        Assertions.assertEquals("k", model.value().get(0).location());
        Assertions.assertEquals("mfnjh", model.value().get(0).description());
        Assertions.assertEquals("xw", model.value().get(0).privateCloudId());
        Assertions.assertEquals(CustomizationPolicyPropertiesType.LINUX, model.value().get(0).typePropertiesType());
        Assertions.assertEquals("foqreyfkzik", model.value().get(0).version());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CustomizationPoliciesListResponse model =
            new CustomizationPoliciesListResponse()
                .withNextLink("hgwxrtfudx")
                .withValue(
                    Arrays
                        .asList(
                            new CustomizationPolicyInner()
                                .withId("yqagvrvm")
                                .withLocation("k")
                                .withDescription("mfnjh")
                                .withPrivateCloudId("xw")
                                .withTypePropertiesType(CustomizationPolicyPropertiesType.LINUX)
                                .withVersion("foqreyfkzik")));
        model = BinaryData.fromObject(model).toObject(CustomizationPoliciesListResponse.class);
        Assertions.assertEquals("hgwxrtfudx", model.nextLink());
        Assertions.assertEquals("yqagvrvm", model.value().get(0).id());
        Assertions.assertEquals("k", model.value().get(0).location());
        Assertions.assertEquals("mfnjh", model.value().get(0).description());
        Assertions.assertEquals("xw", model.value().get(0).privateCloudId());
        Assertions.assertEquals(CustomizationPolicyPropertiesType.LINUX, model.value().get(0).typePropertiesType());
        Assertions.assertEquals("foqreyfkzik", model.value().get(0).version());
    }
}
