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

package com.azure.resourcemanager.netapp.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.netapp.models.WeeklySchedule;
import org.junit.jupiter.api.Assertions;

public final class WeeklyScheduleTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WeeklySchedule model =
            BinaryData
                .fromString(
                    "{\"snapshotsToKeep\":2011830272,\"day\":\"i\",\"hour\":1822288960,\"minute\":2066516032,\"usedBytes\":5879670202656067456}")
                .toObject(WeeklySchedule.class);
        Assertions.assertEquals(2011830272, model.snapshotsToKeep());
        Assertions.assertEquals("i", model.day());
        Assertions.assertEquals(1822288960, model.hour());
        Assertions.assertEquals(2066516032, model.minute());
        Assertions.assertEquals(5879670202656067456L, model.usedBytes());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WeeklySchedule model =
            new WeeklySchedule()
                .withSnapshotsToKeep(2011830272)
                .withDay("i")
                .withHour(1822288960)
                .withMinute(2066516032)
                .withUsedBytes(5879670202656067456L);
        model = BinaryData.fromObject(model).toObject(WeeklySchedule.class);
        Assertions.assertEquals(2011830272, model.snapshotsToKeep());
        Assertions.assertEquals("i", model.day());
        Assertions.assertEquals(1822288960, model.hour());
        Assertions.assertEquals(2066516032, model.minute());
        Assertions.assertEquals(5879670202656067456L, model.usedBytes());
    }
}
