// 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.WorkloadNetworkDhcpServer;
import org.junit.jupiter.api.Assertions;

public final class WorkloadNetworkDhcpServerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadNetworkDhcpServer model =
            BinaryData
                .fromString(
                    "{\"dhcpType\":\"SERVER\",\"serverAddress\":\"p\",\"leaseTime\":3268839905872976093,\"displayName\":\"xqupevzhf\",\"segments\":[\"txhojujb\",\"pelmcuvhixbjxyf\",\"n\"],\"provisioningState\":\"Canceled\",\"revision\":3135284928958606229}")
                .toObject(WorkloadNetworkDhcpServer.class);
        Assertions.assertEquals("xqupevzhf", model.displayName());
        Assertions.assertEquals(3135284928958606229L, model.revision());
        Assertions.assertEquals("p", model.serverAddress());
        Assertions.assertEquals(3268839905872976093L, model.leaseTime());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkloadNetworkDhcpServer model =
            new WorkloadNetworkDhcpServer()
                .withDisplayName("xqupevzhf")
                .withRevision(3135284928958606229L)
                .withServerAddress("p")
                .withLeaseTime(3268839905872976093L);
        model = BinaryData.fromObject(model).toObject(WorkloadNetworkDhcpServer.class);
        Assertions.assertEquals("xqupevzhf", model.displayName());
        Assertions.assertEquals(3135284928958606229L, model.revision());
        Assertions.assertEquals("p", model.serverAddress());
        Assertions.assertEquals(3268839905872976093L, model.leaseTime());
    }
}
