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

package com.azure.resourcemanager.mediaservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mediaservices.models.EnabledProtocols;
import com.azure.resourcemanager.mediaservices.models.NoEncryption;
import org.junit.jupiter.api.Assertions;

public final class NoEncryptionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NoEncryption model =
            BinaryData
                .fromString(
                    "{\"enabledProtocols\":{\"download\":true,\"dash\":true,\"hls\":false,\"smoothStreaming\":true}}")
                .toObject(NoEncryption.class);
        Assertions.assertEquals(true, model.enabledProtocols().download());
        Assertions.assertEquals(true, model.enabledProtocols().dash());
        Assertions.assertEquals(false, model.enabledProtocols().hls());
        Assertions.assertEquals(true, model.enabledProtocols().smoothStreaming());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NoEncryption model =
            new NoEncryption()
                .withEnabledProtocols(
                    new EnabledProtocols().withDownload(true).withDash(true).withHls(false).withSmoothStreaming(true));
        model = BinaryData.fromObject(model).toObject(NoEncryption.class);
        Assertions.assertEquals(true, model.enabledProtocols().download());
        Assertions.assertEquals(true, model.enabledProtocols().dash());
        Assertions.assertEquals(false, model.enabledProtocols().hls());
        Assertions.assertEquals(true, model.enabledProtocols().smoothStreaming());
    }
}
