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

package com.azure.resourcemanager.workloads.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorMetricThresholds;
import org.junit.jupiter.api.Assertions;

public final class SapLandscapeMonitorMetricThresholdsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SapLandscapeMonitorMetricThresholds model =
            BinaryData
                .fromString("{\"name\":\"osx\",\"green\":88.55184,\"yellow\":65.27517,\"red\":5.093771}")
                .toObject(SapLandscapeMonitorMetricThresholds.class);
        Assertions.assertEquals("osx", model.name());
        Assertions.assertEquals(88.55184F, model.green());
        Assertions.assertEquals(65.27517F, model.yellow());
        Assertions.assertEquals(5.093771F, model.red());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SapLandscapeMonitorMetricThresholds model =
            new SapLandscapeMonitorMetricThresholds()
                .withName("osx")
                .withGreen(88.55184F)
                .withYellow(65.27517F)
                .withRed(5.093771F);
        model = BinaryData.fromObject(model).toObject(SapLandscapeMonitorMetricThresholds.class);
        Assertions.assertEquals("osx", model.name());
        Assertions.assertEquals(88.55184F, model.green());
        Assertions.assertEquals(65.27517F, model.yellow());
        Assertions.assertEquals(5.093771F, model.red());
    }
}
