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

package com.azure.resourcemanager.storagecache.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.storagecache.fluent.models.UsageModelInner;
import com.azure.resourcemanager.storagecache.models.UsageModelDisplay;
import org.junit.jupiter.api.Assertions;

public final class UsageModelInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        UsageModelInner model =
            BinaryData
                .fromString(
                    "{\"display\":{\"description\":\"yp\"},\"modelName\":\"bpizcdrqjsdpydn\",\"targetType\":\"hxdeoejz\"}")
                .toObject(UsageModelInner.class);
        Assertions.assertEquals("yp", model.display().description());
        Assertions.assertEquals("bpizcdrqjsdpydn", model.modelName());
        Assertions.assertEquals("hxdeoejz", model.targetType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        UsageModelInner model =
            new UsageModelInner()
                .withDisplay(new UsageModelDisplay().withDescription("yp"))
                .withModelName("bpizcdrqjsdpydn")
                .withTargetType("hxdeoejz");
        model = BinaryData.fromObject(model).toObject(UsageModelInner.class);
        Assertions.assertEquals("yp", model.display().description());
        Assertions.assertEquals("bpizcdrqjsdpydn", model.modelName());
        Assertions.assertEquals("hxdeoejz", model.targetType());
    }
}
