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

package com.azure.resourcemanager.resourcemover.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.resourcemover.models.DiscardRequest;
import com.azure.resourcemanager.resourcemover.models.MoveResourceInputType;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class DiscardRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DiscardRequest model =
            BinaryData
                .fromString(
                    "{\"validateOnly\":true,\"moveResources\":[\"podepoo\",\"inuvamiheogn\"],\"moveResourceInputType\":\"MoveResourceId\"}")
                .toObject(DiscardRequest.class);
        Assertions.assertEquals(true, model.validateOnly());
        Assertions.assertEquals("podepoo", model.moveResources().get(0));
        Assertions.assertEquals(MoveResourceInputType.MOVE_RESOURCE_ID, model.moveResourceInputType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DiscardRequest model =
            new DiscardRequest()
                .withValidateOnly(true)
                .withMoveResources(Arrays.asList("podepoo", "inuvamiheogn"))
                .withMoveResourceInputType(MoveResourceInputType.MOVE_RESOURCE_ID);
        model = BinaryData.fromObject(model).toObject(DiscardRequest.class);
        Assertions.assertEquals(true, model.validateOnly());
        Assertions.assertEquals("podepoo", model.moveResources().get(0));
        Assertions.assertEquals(MoveResourceInputType.MOVE_RESOURCE_ID, model.moveResourceInputType());
    }
}
