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

package com.azure.resourcemanager.quota.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.quota.models.LimitJsonObject;
import com.azure.resourcemanager.quota.models.ResourceName;
import com.azure.resourcemanager.quota.models.SubRequest;
import org.junit.jupiter.api.Assertions;

public final class SubRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SubRequest model =
            BinaryData
                .fromString(
                    "{\"name\":{\"value\":\"jwnzlljfmp\",\"localizedValue\":\"ebvmgxsabkyqd\"},\"resourceType\":\"jitcjczdzevn\",\"unit\":\"krwpdap\",\"provisioningState\":\"InProgress\",\"message\":\"dkvwrwjfe\",\"subRequestId\":\"nhutjeltmrldhugj\",\"limit\":{\"limitObjectType\":\"LimitJsonObject\"}}")
                .toObject(SubRequest.class);
        Assertions.assertEquals("jwnzlljfmp", model.name().value());
        Assertions.assertEquals("krwpdap", model.unit());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SubRequest model =
            new SubRequest()
                .withName(new ResourceName().withValue("jwnzlljfmp"))
                .withUnit("krwpdap")
                .withLimit(new LimitJsonObject());
        model = BinaryData.fromObject(model).toObject(SubRequest.class);
        Assertions.assertEquals("jwnzlljfmp", model.name().value());
        Assertions.assertEquals("krwpdap", model.unit());
    }
}
