// 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.fluent.models.LatencyScorecardProperties;
import com.azure.resourcemanager.frontdoor.models.LatencyMetric;
import java.util.Arrays;

public final class LatencyScorecardPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LatencyScorecardProperties model =
            BinaryData
                .fromString(
                    "{\"id\":\"erqwkyhkobopg\",\"name\":\"dkow\",\"description\":\"bqpc\",\"endpointA\":\"kbwcc\",\"endpointB\":\"jvcdwxlpqekf\",\"startDateTimeUTC\":\"2021-08-06T20:29:45Z\",\"endDateTimeUTC\":\"2021-05-12T04:10:49Z\",\"country\":\"syingwfqatmtdht\",\"latencyMetrics\":[{\"name\":\"pgikdgszywkb\",\"endDateTimeUTC\":\"ryuzh\",\"aValue\":12.210905,\"bValue\":71.055046,\"delta\":45.730103,\"deltaPercent\":79.60526,\"aCLower95CI\":91.33896,\"aHUpper95CI\":1.2628138,\"bCLower95CI\":65.84219,\"bUpper95CI\":8.839816},{\"name\":\"goupmfiibfg\",\"endDateTimeUTC\":\"ioolvrwxkvtkkgll\",\"aValue\":57.97699,\"bValue\":59.871067,\"delta\":52.434147,\"deltaPercent\":59.066463,\"aCLower95CI\":62.143303,\"aHUpper95CI\":76.852425,\"bCLower95CI\":84.204346,\"bUpper95CI\":83.95235}]}")
                .toObject(LatencyScorecardProperties.class);
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LatencyScorecardProperties model =
            new LatencyScorecardProperties()
                .withLatencyMetrics(Arrays.asList(new LatencyMetric(), new LatencyMetric()));
        model = BinaryData.fromObject(model).toObject(LatencyScorecardProperties.class);
    }
}
