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

package com.azure.resourcemanager.deviceupdate.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.deviceupdate.models.Location;
import com.azure.resourcemanager.deviceupdate.models.Role;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class LocationTests {
    @Test
    public void testDeserialize() {
        Location model =
            BinaryData.fromString("{\"name\":\"zgvfcjrwz\",\"role\":\"Failover\"}").toObject(Location.class);
        Assertions.assertEquals("zgvfcjrwz", model.name());
        Assertions.assertEquals(Role.FAILOVER, model.role());
    }

    @Test
    public void testSerialize() {
        Location model = new Location().withName("zgvfcjrwz").withRole(Role.FAILOVER);
        model = BinaryData.fromObject(model).toObject(Location.class);
        Assertions.assertEquals("zgvfcjrwz", model.name());
        Assertions.assertEquals(Role.FAILOVER, model.role());
    }
}
