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

package com.azure.resourcemanager.sqlvirtualmachine.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.sqlvirtualmachine.models.MultiSubnetIpConfiguration;
import com.azure.resourcemanager.sqlvirtualmachine.models.PrivateIpAddress;
import org.junit.jupiter.api.Assertions;

public final class MultiSubnetIpConfigurationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MultiSubnetIpConfiguration model =
            BinaryData
                .fromString(
                    "{\"privateIpAddress\":{\"ipAddress\":\"djpslw\",\"subnetResourceId\":\"dpvwryoqpsoaccta\"},\"sqlVirtualMachineInstance\":\"akl\"}")
                .toObject(MultiSubnetIpConfiguration.class);
        Assertions.assertEquals("djpslw", model.privateIpAddress().ipAddress());
        Assertions.assertEquals("dpvwryoqpsoaccta", model.privateIpAddress().subnetResourceId());
        Assertions.assertEquals("akl", model.sqlVirtualMachineInstance());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MultiSubnetIpConfiguration model =
            new MultiSubnetIpConfiguration()
                .withPrivateIpAddress(
                    new PrivateIpAddress().withIpAddress("djpslw").withSubnetResourceId("dpvwryoqpsoaccta"))
                .withSqlVirtualMachineInstance("akl");
        model = BinaryData.fromObject(model).toObject(MultiSubnetIpConfiguration.class);
        Assertions.assertEquals("djpslw", model.privateIpAddress().ipAddress());
        Assertions.assertEquals("dpvwryoqpsoaccta", model.privateIpAddress().subnetResourceId());
        Assertions.assertEquals("akl", model.sqlVirtualMachineInstance());
    }
}
