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

package com.azure.resourcemanager.mariadb.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mariadb.fluent.models.VirtualNetworkRuleInner;
import org.junit.jupiter.api.Assertions;

public final class VirtualNetworkRuleInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VirtualNetworkRuleInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"virtualNetworkSubnetId\":\"krlkhbzhfepg\",\"ignoreMissingVnetServiceEndpoint\":false,\"state\":\"InProgress\"},\"id\":\"zloc\",\"name\":\"scpai\",\"type\":\"rhhbcs\"}")
                .toObject(VirtualNetworkRuleInner.class);
        Assertions.assertEquals("krlkhbzhfepg", model.virtualNetworkSubnetId());
        Assertions.assertEquals(false, model.ignoreMissingVnetServiceEndpoint());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VirtualNetworkRuleInner model =
            new VirtualNetworkRuleInner()
                .withVirtualNetworkSubnetId("krlkhbzhfepg")
                .withIgnoreMissingVnetServiceEndpoint(false);
        model = BinaryData.fromObject(model).toObject(VirtualNetworkRuleInner.class);
        Assertions.assertEquals("krlkhbzhfepg", model.virtualNetworkSubnetId());
        Assertions.assertEquals(false, model.ignoreMissingVnetServiceEndpoint());
    }
}
