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

package com.azure.resourcemanager.cognitiveservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.cognitiveservices.models.VirtualNetworkRule;
import org.junit.jupiter.api.Assertions;

public final class VirtualNetworkRuleTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VirtualNetworkRule model =
            BinaryData
                .fromString("{\"id\":\"jakhmsbzjh\",\"state\":\"zevdphlx\",\"ignoreMissingVnetServiceEndpoint\":true}")
                .toObject(VirtualNetworkRule.class);
        Assertions.assertEquals("jakhmsbzjh", model.id());
        Assertions.assertEquals("zevdphlx", model.state());
        Assertions.assertEquals(true, model.ignoreMissingVnetServiceEndpoint());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VirtualNetworkRule model =
            new VirtualNetworkRule()
                .withId("jakhmsbzjh")
                .withState("zevdphlx")
                .withIgnoreMissingVnetServiceEndpoint(true);
        model = BinaryData.fromObject(model).toObject(VirtualNetworkRule.class);
        Assertions.assertEquals("jakhmsbzjh", model.id());
        Assertions.assertEquals("zevdphlx", model.state());
        Assertions.assertEquals(true, model.ignoreMissingVnetServiceEndpoint());
    }
}
