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

package com.azure.resourcemanager.orbital.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.orbital.fluent.models.AvailableGroundStationInner;
import com.azure.resourcemanager.orbital.models.ReleaseMode;
import org.junit.jupiter.api.Assertions;

public final class AvailableGroundStationInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AvailableGroundStationInner model =
            BinaryData
                .fromString(
                    "{\"id\":\"bfs\",\"name\":\"rbu\",\"location\":\"cvpnazzmhjrunmpx\",\"type\":\"dbhrbnlankxm\",\"properties\":{\"city\":\"k\",\"providerName\":\"henbtkcxywnytn\",\"longitudeDegrees\":7.4236927,\"latitudeDegrees\":38.21055,\"altitudeMeters\":52.88253,\"releaseMode\":\"Preview\"}}")
                .toObject(AvailableGroundStationInner.class);
        Assertions.assertEquals("cvpnazzmhjrunmpx", model.location());
        Assertions.assertEquals("k", model.city());
        Assertions.assertEquals("henbtkcxywnytn", model.providerName());
        Assertions.assertEquals(7.4236927F, model.longitudeDegrees());
        Assertions.assertEquals(38.21055F, model.latitudeDegrees());
        Assertions.assertEquals(52.88253F, model.altitudeMeters());
        Assertions.assertEquals(ReleaseMode.PREVIEW, model.releaseMode());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AvailableGroundStationInner model =
            new AvailableGroundStationInner()
                .withLocation("cvpnazzmhjrunmpx")
                .withCity("k")
                .withProviderName("henbtkcxywnytn")
                .withLongitudeDegrees(7.4236927F)
                .withLatitudeDegrees(38.21055F)
                .withAltitudeMeters(52.88253F)
                .withReleaseMode(ReleaseMode.PREVIEW);
        model = BinaryData.fromObject(model).toObject(AvailableGroundStationInner.class);
        Assertions.assertEquals("cvpnazzmhjrunmpx", model.location());
        Assertions.assertEquals("k", model.city());
        Assertions.assertEquals("henbtkcxywnytn", model.providerName());
        Assertions.assertEquals(7.4236927F, model.longitudeDegrees());
        Assertions.assertEquals(38.21055F, model.latitudeDegrees());
        Assertions.assertEquals(52.88253F, model.altitudeMeters());
        Assertions.assertEquals(ReleaseMode.PREVIEW, model.releaseMode());
    }
}
