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

package com.azure.resourcemanager.avs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.avs.models.AvailabilityProperties;
import com.azure.resourcemanager.avs.models.AvailabilityStrategy;
import org.junit.jupiter.api.Assertions;

public final class AvailabilityPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AvailabilityProperties model =
            BinaryData
                .fromString("{\"strategy\":\"SingleZone\",\"zone\":1069395538,\"secondaryZone\":1769493620}")
                .toObject(AvailabilityProperties.class);
        Assertions.assertEquals(AvailabilityStrategy.SINGLE_ZONE, model.strategy());
        Assertions.assertEquals(1069395538, model.zone());
        Assertions.assertEquals(1769493620, model.secondaryZone());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AvailabilityProperties model =
            new AvailabilityProperties()
                .withStrategy(AvailabilityStrategy.SINGLE_ZONE)
                .withZone(1069395538)
                .withSecondaryZone(1769493620);
        model = BinaryData.fromObject(model).toObject(AvailabilityProperties.class);
        Assertions.assertEquals(AvailabilityStrategy.SINGLE_ZONE, model.strategy());
        Assertions.assertEquals(1069395538, model.zone());
        Assertions.assertEquals(1769493620, model.secondaryZone());
    }
}
