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

package com.azure.resourcemanager.dataprotection.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardProxyBaseResourceInner;
import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBase;
import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBaseResourceList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ResourceGuardProxyBaseResourceListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ResourceGuardProxyBaseResourceList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"resourceGuardResourceId\":\"tsmypyynpcdp\",\"resourceGuardOperationDetails\":[],\"lastUpdatedTime\":\"zgmwznmabikns\",\"description\":\"gj\"},\"id\":\"bldtlww\",\"name\":\"lkdmtncvokotllxd\",\"type\":\"h\"}],\"nextLink\":\"y\"}")
                .toObject(ResourceGuardProxyBaseResourceList.class);
        Assertions.assertEquals("y", model.nextLink());
        Assertions.assertEquals("tsmypyynpcdp", model.value().get(0).properties().resourceGuardResourceId());
        Assertions.assertEquals("zgmwznmabikns", model.value().get(0).properties().lastUpdatedTime());
        Assertions.assertEquals("gj", model.value().get(0).properties().description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ResourceGuardProxyBaseResourceList model =
            new ResourceGuardProxyBaseResourceList()
                .withNextLink("y")
                .withValue(
                    Arrays
                        .asList(
                            new ResourceGuardProxyBaseResourceInner()
                                .withProperties(
                                    new ResourceGuardProxyBase()
                                        .withResourceGuardResourceId("tsmypyynpcdp")
                                        .withResourceGuardOperationDetails(Arrays.asList())
                                        .withLastUpdatedTime("zgmwznmabikns")
                                        .withDescription("gj"))));
        model = BinaryData.fromObject(model).toObject(ResourceGuardProxyBaseResourceList.class);
        Assertions.assertEquals("y", model.nextLink());
        Assertions.assertEquals("tsmypyynpcdp", model.value().get(0).properties().resourceGuardResourceId());
        Assertions.assertEquals("zgmwznmabikns", model.value().get(0).properties().lastUpdatedTime());
        Assertions.assertEquals("gj", model.value().get(0).properties().description());
    }
}
