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

package com.azure.resourcemanager.advisor.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.advisor.fluent.models.MetadataEntityInner;
import com.azure.resourcemanager.advisor.models.MetadataEntityListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class MetadataEntityListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MetadataEntityListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"fdkfogk\",\"type\":\"gjofjd\",\"name\":\"qs\",\"properties\":{\"displayName\":\"upewnwreitjzy\",\"dependsOn\":[],\"applicableScenarios\":[],\"supportedValues\":[]}}],\"nextLink\":\"rh\"}")
                .toObject(MetadataEntityListResult.class);
        Assertions.assertEquals("fdkfogk", model.value().get(0).id());
        Assertions.assertEquals("gjofjd", model.value().get(0).type());
        Assertions.assertEquals("qs", model.value().get(0).name());
        Assertions.assertEquals("upewnwreitjzy", model.value().get(0).displayName());
        Assertions.assertEquals("rh", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MetadataEntityListResult model =
            new MetadataEntityListResult()
                .withValue(
                    Arrays
                        .asList(
                            new MetadataEntityInner()
                                .withId("fdkfogk")
                                .withType("gjofjd")
                                .withName("qs")
                                .withDisplayName("upewnwreitjzy")
                                .withDependsOn(Arrays.asList())
                                .withApplicableScenarios(Arrays.asList())
                                .withSupportedValues(Arrays.asList())))
                .withNextLink("rh");
        model = BinaryData.fromObject(model).toObject(MetadataEntityListResult.class);
        Assertions.assertEquals("fdkfogk", model.value().get(0).id());
        Assertions.assertEquals("gjofjd", model.value().get(0).type());
        Assertions.assertEquals("qs", model.value().get(0).name());
        Assertions.assertEquals("upewnwreitjzy", model.value().get(0).displayName());
        Assertions.assertEquals("rh", model.nextLink());
    }
}
