// 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.fluent.models.BandwidthScheduleInner;
import com.azure.resourcemanager.databoxedge.models.DayOfWeek;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class BandwidthScheduleInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        BandwidthScheduleInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"start\":\"fhyhltrpmopjmcma\",\"stop\":\"u\",\"rateInMbps\":1605990961,\"days\":[\"Wednesday\",\"Monday\",\"Sunday\",\"Tuesday\"]},\"id\":\"uaodsfcpk\",\"name\":\"xodpuozmyzydagfu\",\"type\":\"xbezyiuokktwh\"}")
                .toObject(BandwidthScheduleInner.class);
        Assertions.assertEquals("fhyhltrpmopjmcma", model.start());
        Assertions.assertEquals("u", model.stop());
        Assertions.assertEquals(1605990961, model.rateInMbps());
        Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.days().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        BandwidthScheduleInner model =
            new BandwidthScheduleInner()
                .withStart("fhyhltrpmopjmcma")
                .withStop("u")
                .withRateInMbps(1605990961)
                .withDays(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.MONDAY, DayOfWeek.SUNDAY, DayOfWeek.TUESDAY));
        model = BinaryData.fromObject(model).toObject(BandwidthScheduleInner.class);
        Assertions.assertEquals("fhyhltrpmopjmcma", model.start());
        Assertions.assertEquals("u", model.stop());
        Assertions.assertEquals(1605990961, model.rateInMbps());
        Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.days().get(0));
    }
}
