// 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.EdifactAcknowledgementSettings;
import org.junit.jupiter.api.Assertions;

public final class EdifactAcknowledgementSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        EdifactAcknowledgementSettings model =
            BinaryData
                .fromString(
                    "{\"needTechnicalAcknowledgement\":false,\"batchTechnicalAcknowledgements\":false,\"needFunctionalAcknowledgement\":true,\"batchFunctionalAcknowledgements\":true,\"needLoopForValidMessages\":true,\"sendSynchronousAcknowledgement\":false,\"acknowledgementControlNumberPrefix\":\"wmn\",\"acknowledgementControlNumberSuffix\":\"ttijfybvpoekrs\",\"acknowledgementControlNumberLowerBound\":1694137236,\"acknowledgementControlNumberUpperBound\":968704736,\"rolloverAcknowledgementControlNumber\":false}")
                .toObject(EdifactAcknowledgementSettings.class);
        Assertions.assertEquals(false, model.needTechnicalAcknowledgement());
        Assertions.assertEquals(false, model.batchTechnicalAcknowledgements());
        Assertions.assertEquals(true, model.needFunctionalAcknowledgement());
        Assertions.assertEquals(true, model.batchFunctionalAcknowledgements());
        Assertions.assertEquals(true, model.needLoopForValidMessages());
        Assertions.assertEquals(false, model.sendSynchronousAcknowledgement());
        Assertions.assertEquals("wmn", model.acknowledgementControlNumberPrefix());
        Assertions.assertEquals("ttijfybvpoekrs", model.acknowledgementControlNumberSuffix());
        Assertions.assertEquals(1694137236, model.acknowledgementControlNumberLowerBound());
        Assertions.assertEquals(968704736, model.acknowledgementControlNumberUpperBound());
        Assertions.assertEquals(false, model.rolloverAcknowledgementControlNumber());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        EdifactAcknowledgementSettings model =
            new EdifactAcknowledgementSettings()
                .withNeedTechnicalAcknowledgement(false)
                .withBatchTechnicalAcknowledgements(false)
                .withNeedFunctionalAcknowledgement(true)
                .withBatchFunctionalAcknowledgements(true)
                .withNeedLoopForValidMessages(true)
                .withSendSynchronousAcknowledgement(false)
                .withAcknowledgementControlNumberPrefix("wmn")
                .withAcknowledgementControlNumberSuffix("ttijfybvpoekrs")
                .withAcknowledgementControlNumberLowerBound(1694137236)
                .withAcknowledgementControlNumberUpperBound(968704736)
                .withRolloverAcknowledgementControlNumber(false);
        model = BinaryData.fromObject(model).toObject(EdifactAcknowledgementSettings.class);
        Assertions.assertEquals(false, model.needTechnicalAcknowledgement());
        Assertions.assertEquals(false, model.batchTechnicalAcknowledgements());
        Assertions.assertEquals(true, model.needFunctionalAcknowledgement());
        Assertions.assertEquals(true, model.batchFunctionalAcknowledgements());
        Assertions.assertEquals(true, model.needLoopForValidMessages());
        Assertions.assertEquals(false, model.sendSynchronousAcknowledgement());
        Assertions.assertEquals("wmn", model.acknowledgementControlNumberPrefix());
        Assertions.assertEquals("ttijfybvpoekrs", model.acknowledgementControlNumberSuffix());
        Assertions.assertEquals(1694137236, model.acknowledgementControlNumberLowerBound());
        Assertions.assertEquals(968704736, model.acknowledgementControlNumberUpperBound());
        Assertions.assertEquals(false, model.rolloverAcknowledgementControlNumber());
    }
}
