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

package com.azure.resourcemanager.databox.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databox.models.ShipmentPickUpRequest;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class ShipmentPickUpRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ShipmentPickUpRequest model =
            BinaryData
                .fromString(
                    "{\"startTime\":\"2021-10-11T10:00:24Z\",\"endTime\":\"2021-02-02T03:25:54Z\",\"shipmentLocation\":\"bxwyjsflhhcaa\"}")
                .toObject(ShipmentPickUpRequest.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T10:00:24Z"), model.startTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T03:25:54Z"), model.endTime());
        Assertions.assertEquals("bxwyjsflhhcaa", model.shipmentLocation());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ShipmentPickUpRequest model =
            new ShipmentPickUpRequest()
                .withStartTime(OffsetDateTime.parse("2021-10-11T10:00:24Z"))
                .withEndTime(OffsetDateTime.parse("2021-02-02T03:25:54Z"))
                .withShipmentLocation("bxwyjsflhhcaa");
        model = BinaryData.fromObject(model).toObject(ShipmentPickUpRequest.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T10:00:24Z"), model.startTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-02-02T03:25:54Z"), model.endTime());
        Assertions.assertEquals("bxwyjsflhhcaa", model.shipmentLocation());
    }
}
