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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.QuotaBaseProperties;
import com.azure.resourcemanager.machinelearning.models.QuotaUnit;
import com.azure.resourcemanager.machinelearning.models.QuotaUpdateParameters;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class QuotaUpdateParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        QuotaUpdateParameters model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"oaeupfhyhltrpmo\",\"type\":\"mcmatuokthfuiu\",\"limit\":6209557393905029674,\"unit\":\"Count\"}],\"location\":\"kvxod\"}")
                .toObject(QuotaUpdateParameters.class);
        Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).id());
        Assertions.assertEquals("mcmatuokthfuiu", model.value().get(0).type());
        Assertions.assertEquals(6209557393905029674L, model.value().get(0).limit());
        Assertions.assertEquals(QuotaUnit.COUNT, model.value().get(0).unit());
        Assertions.assertEquals("kvxod", model.location());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        QuotaUpdateParameters model =
            new QuotaUpdateParameters()
                .withValue(
                    Arrays
                        .asList(
                            new QuotaBaseProperties()
                                .withId("oaeupfhyhltrpmo")
                                .withType("mcmatuokthfuiu")
                                .withLimit(6209557393905029674L)
                                .withUnit(QuotaUnit.COUNT)))
                .withLocation("kvxod");
        model = BinaryData.fromObject(model).toObject(QuotaUpdateParameters.class);
        Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).id());
        Assertions.assertEquals("mcmatuokthfuiu", model.value().get(0).type());
        Assertions.assertEquals(6209557393905029674L, model.value().get(0).limit());
        Assertions.assertEquals(QuotaUnit.COUNT, model.value().get(0).unit());
        Assertions.assertEquals("kvxod", model.location());
    }
}
