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

package com.azure.resourcemanager.nginx.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress;
import com.azure.resourcemanager.nginx.models.NginxPrivateIpAllocationMethod;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class NginxPrivateIpAddressTests {
    @Test
    public void testDeserialize() {
        NginxPrivateIpAddress model =
            BinaryData
                .fromString(
                    "{\"privateIPAddress\":\"vbqid\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"zyulp\"}")
                .toObject(NginxPrivateIpAddress.class);
        Assertions.assertEquals("vbqid", model.privateIpAddress());
        Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, model.privateIpAllocationMethod());
        Assertions.assertEquals("zyulp", model.subnetId());
    }

    @Test
    public void testSerialize() {
        NginxPrivateIpAddress model =
            new NginxPrivateIpAddress()
                .withPrivateIpAddress("vbqid")
                .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC)
                .withSubnetId("zyulp");
        model = BinaryData.fromObject(model).toObject(NginxPrivateIpAddress.class);
        Assertions.assertEquals("vbqid", model.privateIpAddress());
        Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, model.privateIpAllocationMethod());
        Assertions.assertEquals("zyulp", model.subnetId());
    }
}
