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

package com.azure.resourcemanager.appcontainers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appcontainers.models.Action;
import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule;
import org.junit.jupiter.api.Assertions;

public final class IpSecurityRestrictionRuleTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IpSecurityRestrictionRule model =
            BinaryData
                .fromString(
                    "{\"name\":\"zvqtmnubexkp\",\"description\":\"smond\",\"ipAddressRange\":\"mquxvypo\",\"action\":\"Deny\"}")
                .toObject(IpSecurityRestrictionRule.class);
        Assertions.assertEquals("zvqtmnubexkp", model.name());
        Assertions.assertEquals("smond", model.description());
        Assertions.assertEquals("mquxvypo", model.ipAddressRange());
        Assertions.assertEquals(Action.DENY, model.action());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IpSecurityRestrictionRule model =
            new IpSecurityRestrictionRule()
                .withName("zvqtmnubexkp")
                .withDescription("smond")
                .withIpAddressRange("mquxvypo")
                .withAction(Action.DENY);
        model = BinaryData.fromObject(model).toObject(IpSecurityRestrictionRule.class);
        Assertions.assertEquals("zvqtmnubexkp", model.name());
        Assertions.assertEquals("smond", model.description());
        Assertions.assertEquals("mquxvypo", model.ipAddressRange());
        Assertions.assertEquals(Action.DENY, model.action());
    }
}
