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

package com.azure.resourcemanager.devtestlabs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devtestlabs.models.EnableStatus;
import com.azure.resourcemanager.devtestlabs.models.LabAnnouncementProperties;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class LabAnnouncementPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LabAnnouncementProperties model =
            BinaryData
                .fromString(
                    "{\"title\":\"x\",\"markdown\":\"jpgd\",\"enabled\":\"Disabled\",\"expirationDate\":\"2021-05-05T12:18:06Z\",\"expired\":false,\"provisioningState\":\"vpmouexhdzxib\",\"uniqueIdentifier\":\"ojnxqbzvdd\"}")
                .toObject(LabAnnouncementProperties.class);
        Assertions.assertEquals("x", model.title());
        Assertions.assertEquals("jpgd", model.markdown());
        Assertions.assertEquals(EnableStatus.DISABLED, model.enabled());
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T12:18:06Z"), model.expirationDate());
        Assertions.assertEquals(false, model.expired());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LabAnnouncementProperties model =
            new LabAnnouncementProperties()
                .withTitle("x")
                .withMarkdown("jpgd")
                .withEnabled(EnableStatus.DISABLED)
                .withExpirationDate(OffsetDateTime.parse("2021-05-05T12:18:06Z"))
                .withExpired(false);
        model = BinaryData.fromObject(model).toObject(LabAnnouncementProperties.class);
        Assertions.assertEquals("x", model.title());
        Assertions.assertEquals("jpgd", model.markdown());
        Assertions.assertEquals(EnableStatus.DISABLED, model.enabled());
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-05T12:18:06Z"), model.expirationDate());
        Assertions.assertEquals(false, model.expired());
    }
}
