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

package com.azure.resourcemanager.storagepool.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.storagepool.models.EndpointDetail;
import org.junit.jupiter.api.Assertions;

public final class EndpointDetailTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        EndpointDetail model =
            BinaryData
                .fromString(
                    "{\"ipAddress\":\"gx\",\"port\":557104558,\"latency\":54.54992137874519,\"isAccessible\":false}")
                .toObject(EndpointDetail.class);
        Assertions.assertEquals("gx", model.ipAddress());
        Assertions.assertEquals(557104558, model.port());
        Assertions.assertEquals(54.54992137874519D, model.latency());
        Assertions.assertEquals(false, model.isAccessible());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        EndpointDetail model =
            new EndpointDetail()
                .withIpAddress("gx")
                .withPort(557104558)
                .withLatency(54.54992137874519D)
                .withIsAccessible(false);
        model = BinaryData.fromObject(model).toObject(EndpointDetail.class);
        Assertions.assertEquals("gx", model.ipAddress());
        Assertions.assertEquals(557104558, model.port());
        Assertions.assertEquals(54.54992137874519D, model.latency());
        Assertions.assertEquals(false, model.isAccessible());
    }
}
