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

package com.azure.resourcemanager.datamigration.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner;
import com.azure.resourcemanager.datamigration.models.QuotaName;
import org.junit.jupiter.api.Assertions;

public final class QuotaInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        QuotaInner model =
            BinaryData
                .fromString(
                    "{\"currentValue\":78.93295036491774,\"id\":\"ayvvtpgvdf\",\"limit\":80.97390189811352,\"name\":{\"localizedValue\":\"tutqxlngxlefgug\",\"value\":\"krxd\"},\"unit\":\"i\"}")
                .toObject(QuotaInner.class);
        Assertions.assertEquals(78.93295036491774D, model.currentValue());
        Assertions.assertEquals("ayvvtpgvdf", model.id());
        Assertions.assertEquals(80.97390189811352D, model.limit());
        Assertions.assertEquals("tutqxlngxlefgug", model.name().localizedValue());
        Assertions.assertEquals("krxd", model.name().value());
        Assertions.assertEquals("i", model.unit());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        QuotaInner model =
            new QuotaInner()
                .withCurrentValue(78.93295036491774D)
                .withId("ayvvtpgvdf")
                .withLimit(80.97390189811352D)
                .withName(new QuotaName().withLocalizedValue("tutqxlngxlefgug").withValue("krxd"))
                .withUnit("i");
        model = BinaryData.fromObject(model).toObject(QuotaInner.class);
        Assertions.assertEquals(78.93295036491774D, model.currentValue());
        Assertions.assertEquals("ayvvtpgvdf", model.id());
        Assertions.assertEquals(80.97390189811352D, model.limit());
        Assertions.assertEquals("tutqxlngxlefgug", model.name().localizedValue());
        Assertions.assertEquals("krxd", model.name().value());
        Assertions.assertEquals("i", model.unit());
    }
}
