// 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.AvailableGroundStationListResult;
import com.azure.resourcemanager.orbital.models.ReleaseMode;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class AvailableGroundStationListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AvailableGroundStationListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"id\":\"gyxzk\",\"name\":\"ocukoklyax\",\"location\":\"onuq\",\"type\":\"fkbey\",\"properties\":{\"city\":\"wrmjmwvvjektc\",\"providerName\":\"enhwlrs\",\"longitudeDegrees\":77.02938,\"latitudeDegrees\":37.530846,\"altitudeMeters\":2.0646155,\"releaseMode\":\"Preview\"}},{\"id\":\"q\",\"name\":\"iqylihkaetck\",\"location\":\"fcivfsnkym\",\"type\":\"tqhjfbebrjcx\",\"properties\":{\"city\":\"fuwutttxf\",\"providerName\":\"rbirphxe\",\"longitudeDegrees\":12.502766,\"latitudeDegrees\":23.563082,\"altitudeMeters\":35.039818,\"releaseMode\":\"GA\"}},{\"id\":\"kyqxjvuujqgidokg\",\"name\":\"jyoxgvclt\",\"location\":\"sncghkjeszz\",\"type\":\"ijhtxf\",\"properties\":{\"city\":\"xbf\",\"providerName\":\"xnehmpvec\",\"longitudeDegrees\":79.49234,\"latitudeDegrees\":51.603138,\"altitudeMeters\":28.159433,\"releaseMode\":\"Preview\"}},{\"id\":\"rbmpukgri\",\"name\":\"lzlfbxzpuz\",\"location\":\"ispnqzahmgkbrp\",\"type\":\"dhibnuq\",\"properties\":{\"city\":\"pikad\",\"providerName\":\"vtq\",\"longitudeDegrees\":2.8413236,\"latitudeDegrees\":43.625916,\"altitudeMeters\":69.922646,\"releaseMode\":\"GA\"}}],\"nextLink\":\"gg\"}")
                .toObject(AvailableGroundStationListResult.class);
        Assertions.assertEquals("onuq", model.value().get(0).location());
        Assertions.assertEquals("wrmjmwvvjektc", model.value().get(0).city());
        Assertions.assertEquals("enhwlrs", model.value().get(0).providerName());
        Assertions.assertEquals(77.02938F, model.value().get(0).longitudeDegrees());
        Assertions.assertEquals(37.530846F, model.value().get(0).latitudeDegrees());
        Assertions.assertEquals(2.0646155F, model.value().get(0).altitudeMeters());
        Assertions.assertEquals(ReleaseMode.PREVIEW, model.value().get(0).releaseMode());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AvailableGroundStationListResult model =
            new AvailableGroundStationListResult()
                .withValue(
                    Arrays
                        .asList(
                            new AvailableGroundStationInner()
                                .withLocation("onuq")
                                .withCity("wrmjmwvvjektc")
                                .withProviderName("enhwlrs")
                                .withLongitudeDegrees(77.02938F)
                                .withLatitudeDegrees(37.530846F)
                                .withAltitudeMeters(2.0646155F)
                                .withReleaseMode(ReleaseMode.PREVIEW),
                            new AvailableGroundStationInner()
                                .withLocation("fcivfsnkym")
                                .withCity("fuwutttxf")
                                .withProviderName("rbirphxe")
                                .withLongitudeDegrees(12.502766F)
                                .withLatitudeDegrees(23.563082F)
                                .withAltitudeMeters(35.039818F)
                                .withReleaseMode(ReleaseMode.GA),
                            new AvailableGroundStationInner()
                                .withLocation("sncghkjeszz")
                                .withCity("xbf")
                                .withProviderName("xnehmpvec")
                                .withLongitudeDegrees(79.49234F)
                                .withLatitudeDegrees(51.603138F)
                                .withAltitudeMeters(28.159433F)
                                .withReleaseMode(ReleaseMode.PREVIEW),
                            new AvailableGroundStationInner()
                                .withLocation("ispnqzahmgkbrp")
                                .withCity("pikad")
                                .withProviderName("vtq")
                                .withLongitudeDegrees(2.8413236F)
                                .withLatitudeDegrees(43.625916F)
                                .withAltitudeMeters(69.922646F)
                                .withReleaseMode(ReleaseMode.GA)));
        model = BinaryData.fromObject(model).toObject(AvailableGroundStationListResult.class);
        Assertions.assertEquals("onuq", model.value().get(0).location());
        Assertions.assertEquals("wrmjmwvvjektc", model.value().get(0).city());
        Assertions.assertEquals("enhwlrs", model.value().get(0).providerName());
        Assertions.assertEquals(77.02938F, model.value().get(0).longitudeDegrees());
        Assertions.assertEquals(37.530846F, model.value().get(0).latitudeDegrees());
        Assertions.assertEquals(2.0646155F, model.value().get(0).altitudeMeters());
        Assertions.assertEquals(ReleaseMode.PREVIEW, model.value().get(0).releaseMode());
    }
}
