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

package com.azure.resourcemanager.kubernetesconfiguration.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kubernetesconfiguration.models.HelmReleasePropertiesDefinition;
import com.azure.resourcemanager.kubernetesconfiguration.models.ObjectReferenceDefinition;
import org.junit.jupiter.api.Assertions;

public final class HelmReleasePropertiesDefinitionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        HelmReleasePropertiesDefinition model =
            BinaryData
                .fromString(
                    "{\"lastRevisionApplied\":5713676412276621836,\"helmChartRef\":{\"name\":\"tutqxlngxlefgug\",\"namespace\":\"krxd\"},\"failureCount\":979128831673863857,\"installFailureCount\":2903451662374924947,\"upgradeFailureCount\":6746473362008791150}")
                .toObject(HelmReleasePropertiesDefinition.class);
        Assertions.assertEquals(5713676412276621836L, model.lastRevisionApplied());
        Assertions.assertEquals("tutqxlngxlefgug", model.helmChartRef().name());
        Assertions.assertEquals("krxd", model.helmChartRef().namespace());
        Assertions.assertEquals(979128831673863857L, model.failureCount());
        Assertions.assertEquals(2903451662374924947L, model.installFailureCount());
        Assertions.assertEquals(6746473362008791150L, model.upgradeFailureCount());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        HelmReleasePropertiesDefinition model =
            new HelmReleasePropertiesDefinition()
                .withLastRevisionApplied(5713676412276621836L)
                .withHelmChartRef(new ObjectReferenceDefinition().withName("tutqxlngxlefgug").withNamespace("krxd"))
                .withFailureCount(979128831673863857L)
                .withInstallFailureCount(2903451662374924947L)
                .withUpgradeFailureCount(6746473362008791150L);
        model = BinaryData.fromObject(model).toObject(HelmReleasePropertiesDefinition.class);
        Assertions.assertEquals(5713676412276621836L, model.lastRevisionApplied());
        Assertions.assertEquals("tutqxlngxlefgug", model.helmChartRef().name());
        Assertions.assertEquals("krxd", model.helmChartRef().namespace());
        Assertions.assertEquals(979128831673863857L, model.failureCount());
        Assertions.assertEquals(2903451662374924947L, model.installFailureCount());
        Assertions.assertEquals(6746473362008791150L, model.upgradeFailureCount());
    }
}
