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

package com.azure.resourcemanager.frontdoor.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.frontdoor.models.LoadBalancingSettingsModel;
import org.junit.jupiter.api.Assertions;

public final class LoadBalancingSettingsModelTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LoadBalancingSettingsModel model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"resourceState\":\"Migrating\",\"sampleSize\":1656357002,\"successfulSamplesRequired\":734102755,\"additionalLatencyMilliseconds\":151199466},\"name\":\"jewgdrjerv\",\"type\":\"enq\",\"id\":\"hin\"}")
                .toObject(LoadBalancingSettingsModel.class);
        Assertions.assertEquals("hin", model.id());
        Assertions.assertEquals("jewgdrjerv", model.name());
        Assertions.assertEquals(1656357002, model.sampleSize());
        Assertions.assertEquals(734102755, model.successfulSamplesRequired());
        Assertions.assertEquals(151199466, model.additionalLatencyMilliseconds());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LoadBalancingSettingsModel model =
            new LoadBalancingSettingsModel()
                .withId("hin")
                .withName("jewgdrjerv")
                .withSampleSize(1656357002)
                .withSuccessfulSamplesRequired(734102755)
                .withAdditionalLatencyMilliseconds(151199466);
        model = BinaryData.fromObject(model).toObject(LoadBalancingSettingsModel.class);
        Assertions.assertEquals("hin", model.id());
        Assertions.assertEquals("jewgdrjerv", model.name());
        Assertions.assertEquals(1656357002, model.sampleSize());
        Assertions.assertEquals(734102755, model.successfulSamplesRequired());
        Assertions.assertEquals(151199466, model.additionalLatencyMilliseconds());
    }
}
