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

package com.azure.resourcemanager.databoxedge.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databoxedge.models.OrderState;
import com.azure.resourcemanager.databoxedge.models.OrderStatus;
import org.junit.jupiter.api.Assertions;

public final class OrderStatusTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OrderStatus model =
            BinaryData
                .fromString(
                    "{\"status\":\"AwaitingPreparation\",\"updateDateTime\":\"2021-02-28T22:24:22Z\",\"comments\":\"joya\",\"additionalOrderDetails\":{\"idzyexznelixhnr\":\"lyjpk\",\"nalaulppg\":\"tfolhbnx\",\"gvpgy\":\"dtpnapnyiropuhp\"}}")
                .toObject(OrderStatus.class);
        Assertions.assertEquals(OrderState.AWAITING_PREPARATION, model.status());
        Assertions.assertEquals("joya", model.comments());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OrderStatus model = new OrderStatus().withStatus(OrderState.AWAITING_PREPARATION).withComments("joya");
        model = BinaryData.fromObject(model).toObject(OrderStatus.class);
        Assertions.assertEquals(OrderState.AWAITING_PREPARATION, model.status());
        Assertions.assertEquals("joya", model.comments());
    }
}
