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

package com.azure.resourcemanager.iothub.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.iothub.models.IotHubLocationDescription;
import com.azure.resourcemanager.iothub.models.IotHubReplicaRoleType;
import org.junit.jupiter.api.Assertions;

public final class IotHubLocationDescriptionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IotHubLocationDescription model =
            BinaryData
                .fromString("{\"location\":\"ijhtxf\",\"role\":\"primary\"}")
                .toObject(IotHubLocationDescription.class);
        Assertions.assertEquals("ijhtxf", model.location());
        Assertions.assertEquals(IotHubReplicaRoleType.PRIMARY, model.role());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IotHubLocationDescription model =
            new IotHubLocationDescription().withLocation("ijhtxf").withRole(IotHubReplicaRoleType.PRIMARY);
        model = BinaryData.fromObject(model).toObject(IotHubLocationDescription.class);
        Assertions.assertEquals("ijhtxf", model.location());
        Assertions.assertEquals(IotHubReplicaRoleType.PRIMARY, model.role());
    }
}
