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

package com.azure.resourcemanager.nginx.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateProperties;
import com.azure.resourcemanager.nginx.models.NginxLogging;
import com.azure.resourcemanager.nginx.models.NginxStorageAccount;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class NginxDeploymentUpdatePropertiesTests {
    @Test
    public void testDeserialize() {
        NginxDeploymentUpdateProperties model =
            BinaryData
                .fromString(
                    "{\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"hrzayvvtpgvdf\",\"containerName\":\"otkftutqxlngx\"}}}")
                .toObject(NginxDeploymentUpdateProperties.class);
        Assertions.assertEquals(false, model.enableDiagnosticsSupport());
        Assertions.assertEquals("hrzayvvtpgvdf", model.logging().storageAccount().accountName());
        Assertions.assertEquals("otkftutqxlngx", model.logging().storageAccount().containerName());
    }

    @Test
    public void testSerialize() {
        NginxDeploymentUpdateProperties model =
            new NginxDeploymentUpdateProperties()
                .withEnableDiagnosticsSupport(false)
                .withLogging(
                    new NginxLogging()
                        .withStorageAccount(
                            new NginxStorageAccount()
                                .withAccountName("hrzayvvtpgvdf")
                                .withContainerName("otkftutqxlngx")));
        model = BinaryData.fromObject(model).toObject(NginxDeploymentUpdateProperties.class);
        Assertions.assertEquals(false, model.enableDiagnosticsSupport());
        Assertions.assertEquals("hrzayvvtpgvdf", model.logging().storageAccount().accountName());
        Assertions.assertEquals("otkftutqxlngx", model.logging().storageAccount().containerName());
    }
}
