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

package com.azure.resourcemanager.delegatednetwork.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetProperties;
import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails;
import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails;
import org.junit.jupiter.api.Assertions;

public final class DelegatedSubnetPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DelegatedSubnetProperties model =
            BinaryData
                .fromString(
                    "{\"resourceGuid\":\"lefgugnxk\",\"provisioningState\":\"Succeeded\",\"subnetDetails\":{\"id\":\"i\"},\"controllerDetails\":{\"id\":\"hzrvqd\"}}")
                .toObject(DelegatedSubnetProperties.class);
        Assertions.assertEquals("i", model.subnetDetails().id());
        Assertions.assertEquals("hzrvqd", model.controllerDetails().id());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DelegatedSubnetProperties model =
            new DelegatedSubnetProperties()
                .withSubnetDetails(new SubnetDetails().withId("i"))
                .withControllerDetails(new ControllerDetails().withId("hzrvqd"));
        model = BinaryData.fromObject(model).toObject(DelegatedSubnetProperties.class);
        Assertions.assertEquals("i", model.subnetDetails().id());
        Assertions.assertEquals("hzrvqd", model.controllerDetails().id());
    }
}
