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

package com.azure.resourcemanager.devtestlabs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devtestlabs.models.Subnet;
import com.azure.resourcemanager.devtestlabs.models.UsagePermissionType;
import org.junit.jupiter.api.Assertions;

public final class SubnetTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Subnet model =
            BinaryData
                .fromString("{\"resourceId\":\"t\",\"labSubnetName\":\"auunfprnjletlx\",\"allowPublicIp\":\"Default\"}")
                .toObject(Subnet.class);
        Assertions.assertEquals("t", model.resourceId());
        Assertions.assertEquals("auunfprnjletlx", model.labSubnetName());
        Assertions.assertEquals(UsagePermissionType.DEFAULT, model.allowPublicIp());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Subnet model =
            new Subnet()
                .withResourceId("t")
                .withLabSubnetName("auunfprnjletlx")
                .withAllowPublicIp(UsagePermissionType.DEFAULT);
        model = BinaryData.fromObject(model).toObject(Subnet.class);
        Assertions.assertEquals("t", model.resourceId());
        Assertions.assertEquals("auunfprnjletlx", model.labSubnetName());
        Assertions.assertEquals(UsagePermissionType.DEFAULT, model.allowPublicIp());
    }
}
