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

package com.azure.resourcemanager.logic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logic.models.AS2EnvelopeSettings;
import org.junit.jupiter.api.Assertions;

public final class AS2EnvelopeSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AS2EnvelopeSettings model =
            BinaryData
                .fromString(
                    "{\"messageContentType\":\"cvizqzdwlvw\",\"transmitFileNameInMimeHeader\":true,\"fileNameTemplate\":\"oupfgfb\",\"suspendMessageOnFileNameGenerationError\":false,\"autogenerateFileName\":false}")
                .toObject(AS2EnvelopeSettings.class);
        Assertions.assertEquals("cvizqzdwlvw", model.messageContentType());
        Assertions.assertEquals(true, model.transmitFileNameInMimeHeader());
        Assertions.assertEquals("oupfgfb", model.fileNameTemplate());
        Assertions.assertEquals(false, model.suspendMessageOnFileNameGenerationError());
        Assertions.assertEquals(false, model.autogenerateFileName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AS2EnvelopeSettings model =
            new AS2EnvelopeSettings()
                .withMessageContentType("cvizqzdwlvw")
                .withTransmitFileNameInMimeHeader(true)
                .withFileNameTemplate("oupfgfb")
                .withSuspendMessageOnFileNameGenerationError(false)
                .withAutogenerateFileName(false);
        model = BinaryData.fromObject(model).toObject(AS2EnvelopeSettings.class);
        Assertions.assertEquals("cvizqzdwlvw", model.messageContentType());
        Assertions.assertEquals(true, model.transmitFileNameInMimeHeader());
        Assertions.assertEquals("oupfgfb", model.fileNameTemplate());
        Assertions.assertEquals(false, model.suspendMessageOnFileNameGenerationError());
        Assertions.assertEquals(false, model.autogenerateFileName());
    }
}
