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

public final class PeriodicTimerSourceInfoTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PeriodicTimerSourceInfo model =
            BinaryData
                .fromString("{\"startTime\":\"2021-07-20T00:55:01Z\",\"schedule\":\"raehtwdwrft\",\"topic\":\"iby\"}")
                .toObject(PeriodicTimerSourceInfo.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T00:55:01Z"), model.startTime());
        Assertions.assertEquals("raehtwdwrft", model.schedule());
        Assertions.assertEquals("iby", model.topic());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PeriodicTimerSourceInfo model =
            new PeriodicTimerSourceInfo()
                .withStartTime(OffsetDateTime.parse("2021-07-20T00:55:01Z"))
                .withSchedule("raehtwdwrft")
                .withTopic("iby");
        model = BinaryData.fromObject(model).toObject(PeriodicTimerSourceInfo.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T00:55:01Z"), model.startTime());
        Assertions.assertEquals("raehtwdwrft", model.schedule());
        Assertions.assertEquals("iby", model.topic());
    }
}
