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

package com.azure.resourcemanager.vmwarecloudsimple.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.CustomizationPolicyInner;
import com.azure.resourcemanager.vmwarecloudsimple.models.CustomizationPolicyPropertiesType;
import com.azure.resourcemanager.vmwarecloudsimple.models.CustomizationSpecification;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CustomizationPolicyInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CustomizationPolicyInner model =
            BinaryData
                .fromString(
                    "{\"id\":\"a\",\"location\":\"xwczelpcire\",\"name\":\"feaenwab\",\"properties\":{\"description\":\"kl\",\"privateCloudId\":\"xbjhwuaanozjosph\",\"specification\":{\"nicSettings\":[]},\"type\":\"WINDOWS\",\"version\":\"xagl\"},\"type\":\"imjwosyt\"}")
                .toObject(CustomizationPolicyInner.class);
        Assertions.assertEquals("a", model.id());
        Assertions.assertEquals("xwczelpcire", model.location());
        Assertions.assertEquals("kl", model.description());
        Assertions.assertEquals("xbjhwuaanozjosph", model.privateCloudId());
        Assertions.assertEquals(CustomizationPolicyPropertiesType.WINDOWS, model.typePropertiesType());
        Assertions.assertEquals("xagl", model.version());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CustomizationPolicyInner model =
            new CustomizationPolicyInner()
                .withId("a")
                .withLocation("xwczelpcire")
                .withDescription("kl")
                .withPrivateCloudId("xbjhwuaanozjosph")
                .withSpecification(new CustomizationSpecification().withNicSettings(Arrays.asList()))
                .withTypePropertiesType(CustomizationPolicyPropertiesType.WINDOWS)
                .withVersion("xagl");
        model = BinaryData.fromObject(model).toObject(CustomizationPolicyInner.class);
        Assertions.assertEquals("a", model.id());
        Assertions.assertEquals("xwczelpcire", model.location());
        Assertions.assertEquals("kl", model.description());
        Assertions.assertEquals("xbjhwuaanozjosph", model.privateCloudId());
        Assertions.assertEquals(CustomizationPolicyPropertiesType.WINDOWS, model.typePropertiesType());
        Assertions.assertEquals("xagl", model.version());
    }
}
