// 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.DayOfWeek;
import com.azure.resourcemanager.logic.models.RecurrenceScheduleOccurrence;
import org.junit.jupiter.api.Assertions;

public final class RecurrenceScheduleOccurrenceTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        RecurrenceScheduleOccurrence model =
            BinaryData
                .fromString("{\"day\":\"Sunday\",\"occurrence\":591118108}")
                .toObject(RecurrenceScheduleOccurrence.class);
        Assertions.assertEquals(DayOfWeek.SUNDAY, model.day());
        Assertions.assertEquals(591118108, model.occurrence());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        RecurrenceScheduleOccurrence model =
            new RecurrenceScheduleOccurrence().withDay(DayOfWeek.SUNDAY).withOccurrence(591118108);
        model = BinaryData.fromObject(model).toObject(RecurrenceScheduleOccurrence.class);
        Assertions.assertEquals(DayOfWeek.SUNDAY, model.day());
        Assertions.assertEquals(591118108, model.occurrence());
    }
}
