// 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.ArtifactProperties;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class ArtifactPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ArtifactProperties model =
            BinaryData
                .fromString(
                    "{\"createdTime\":\"2021-11-19T10:41:07Z\",\"changedTime\":\"2021-02-09T03:54:38Z\",\"metadata\":\"dataeosjswsr\"}")
                .toObject(ArtifactProperties.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T10:41:07Z"), model.createdTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T03:54:38Z"), model.changedTime());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ArtifactProperties model =
            new ArtifactProperties()
                .withCreatedTime(OffsetDateTime.parse("2021-11-19T10:41:07Z"))
                .withChangedTime(OffsetDateTime.parse("2021-02-09T03:54:38Z"))
                .withMetadata("dataeosjswsr");
        model = BinaryData.fromObject(model).toObject(ArtifactProperties.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-11-19T10:41:07Z"), model.createdTime());
        Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T03:54:38Z"), model.changedTime());
    }
}
