// 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.Fade;
import java.time.Duration;
import org.junit.jupiter.api.Assertions;

public final class FadeTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Fade model =
            BinaryData
                .fromString(
                    "{\"duration\":\"PT197H27M1S\",\"fadeColor\":\"uuepzlrphwzsoldw\",\"start\":\"uqdunvmnnrwrbi\"}")
                .toObject(Fade.class);
        Assertions.assertEquals(Duration.parse("PT197H27M1S"), model.duration());
        Assertions.assertEquals("uuepzlrphwzsoldw", model.fadeColor());
        Assertions.assertEquals("uqdunvmnnrwrbi", model.start());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Fade model =
            new Fade()
                .withDuration(Duration.parse("PT197H27M1S"))
                .withFadeColor("uuepzlrphwzsoldw")
                .withStart("uqdunvmnnrwrbi");
        model = BinaryData.fromObject(model).toObject(Fade.class);
        Assertions.assertEquals(Duration.parse("PT197H27M1S"), model.duration());
        Assertions.assertEquals("uuepzlrphwzsoldw", model.fadeColor());
        Assertions.assertEquals("uqdunvmnnrwrbi", model.start());
    }
}
