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

package com.azure.resourcemanager.elastic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.elastic.models.OperationName;
import com.azure.resourcemanager.elastic.models.VMCollectionUpdate;
import org.junit.jupiter.api.Assertions;

public final class VMCollectionUpdateTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VMCollectionUpdate model =
            BinaryData
                .fromString("{\"vmResourceId\":\"nxqbzvddn\",\"operationName\":\"Add\"}")
                .toObject(VMCollectionUpdate.class);
        Assertions.assertEquals("nxqbzvddn", model.vmResourceId());
        Assertions.assertEquals(OperationName.ADD, model.operationName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VMCollectionUpdate model =
            new VMCollectionUpdate().withVmResourceId("nxqbzvddn").withOperationName(OperationName.ADD);
        model = BinaryData.fromObject(model).toObject(VMCollectionUpdate.class);
        Assertions.assertEquals("nxqbzvddn", model.vmResourceId());
        Assertions.assertEquals(OperationName.ADD, model.operationName());
    }
}
