// 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\":523277944,\"day\":\"mwmbes\",\"hour\":1055481655,\"minute\":1383076937,\"usedBytes\":9162330639147377970}")
                .toObject(WeeklySchedule.class);
        Assertions.assertEquals(523277944, model.snapshotsToKeep());
        Assertions.assertEquals("mwmbes", model.day());
        Assertions.assertEquals(1055481655, model.hour());
        Assertions.assertEquals(1383076937, model.minute());
        Assertions.assertEquals(9162330639147377970L, model.usedBytes());
    }

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