// 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.PlacementPolicyProperties;
import com.azure.resourcemanager.avs.models.PlacementPolicyState;
import org.junit.jupiter.api.Assertions;

public final class PlacementPolicyPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PlacementPolicyProperties model =
            BinaryData
                .fromString(
                    "{\"type\":\"PlacementPolicyProperties\",\"state\":\"Disabled\",\"displayName\":\"nnqvsa\",\"provisioningState\":\"Deleting\"}")
                .toObject(PlacementPolicyProperties.class);
        Assertions.assertEquals(PlacementPolicyState.DISABLED, model.state());
        Assertions.assertEquals("nnqvsa", model.displayName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PlacementPolicyProperties model =
            new PlacementPolicyProperties().withState(PlacementPolicyState.DISABLED).withDisplayName("nnqvsa");
        model = BinaryData.fromObject(model).toObject(PlacementPolicyProperties.class);
        Assertions.assertEquals(PlacementPolicyState.DISABLED, model.state());
        Assertions.assertEquals("nnqvsa", model.displayName());
    }
}
