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

package com.azure.resourcemanager.appcontainers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appcontainers.fluent.models.OperationDetailInner;
import com.azure.resourcemanager.appcontainers.models.OperationDisplay;
import org.junit.jupiter.api.Assertions;

public final class OperationDetailInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OperationDetailInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"uutlwxezwzhok\",\"isDataAction\":true,\"display\":{\"provider\":\"htqlgehgpp\",\"resource\":\"ifhpf\",\"operation\":\"ajvgcxtxjcsheafi\",\"description\":\"tugsresmkssjh\"},\"origin\":\"ftxfkf\"}")
                .toObject(OperationDetailInner.class);
        Assertions.assertEquals("uutlwxezwzhok", model.name());
        Assertions.assertEquals(true, model.isDataAction());
        Assertions.assertEquals("htqlgehgpp", model.display().provider());
        Assertions.assertEquals("ifhpf", model.display().resource());
        Assertions.assertEquals("ajvgcxtxjcsheafi", model.display().operation());
        Assertions.assertEquals("tugsresmkssjh", model.display().description());
        Assertions.assertEquals("ftxfkf", model.origin());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationDetailInner model =
            new OperationDetailInner()
                .withName("uutlwxezwzhok")
                .withIsDataAction(true)
                .withDisplay(
                    new OperationDisplay()
                        .withProvider("htqlgehgpp")
                        .withResource("ifhpf")
                        .withOperation("ajvgcxtxjcsheafi")
                        .withDescription("tugsresmkssjh"))
                .withOrigin("ftxfkf");
        model = BinaryData.fromObject(model).toObject(OperationDetailInner.class);
        Assertions.assertEquals("uutlwxezwzhok", model.name());
        Assertions.assertEquals(true, model.isDataAction());
        Assertions.assertEquals("htqlgehgpp", model.display().provider());
        Assertions.assertEquals("ifhpf", model.display().resource());
        Assertions.assertEquals("ajvgcxtxjcsheafi", model.display().operation());
        Assertions.assertEquals("tugsresmkssjh", model.display().description());
        Assertions.assertEquals("ftxfkf", model.origin());
    }
}
