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

package com.azure.resourcemanager.imagebuilder.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.imagebuilder.models.SharedImageStorageAccountType;
import com.azure.resourcemanager.imagebuilder.models.TargetRegion;
import org.junit.jupiter.api.Assertions;

public final class TargetRegionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TargetRegion model =
            BinaryData
                .fromString("{\"name\":\"dpydn\",\"replicaCount\":1880549577,\"storageAccountType\":\"Premium_LRS\"}")
                .toObject(TargetRegion.class);
        Assertions.assertEquals("dpydn", model.name());
        Assertions.assertEquals(1880549577, model.replicaCount());
        Assertions.assertEquals(SharedImageStorageAccountType.PREMIUM_LRS, model.storageAccountType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TargetRegion model =
            new TargetRegion()
                .withName("dpydn")
                .withReplicaCount(1880549577)
                .withStorageAccountType(SharedImageStorageAccountType.PREMIUM_LRS);
        model = BinaryData.fromObject(model).toObject(TargetRegion.class);
        Assertions.assertEquals("dpydn", model.name());
        Assertions.assertEquals(1880549577, model.replicaCount());
        Assertions.assertEquals(SharedImageStorageAccountType.PREMIUM_LRS, model.storageAccountType());
    }
}
