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

package com.azure.resourcemanager.databox.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databox.models.NotificationPreference;
import com.azure.resourcemanager.databox.models.NotificationStageName;
import org.junit.jupiter.api.Assertions;

public final class NotificationPreferenceTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NotificationPreference model =
            BinaryData
                .fromString("{\"stageName\":\"ShippedToCustomer\",\"sendNotification\":true}")
                .toObject(NotificationPreference.class);
        Assertions.assertEquals(NotificationStageName.SHIPPED_TO_CUSTOMER, model.stageName());
        Assertions.assertEquals(true, model.sendNotification());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NotificationPreference model =
            new NotificationPreference()
                .withStageName(NotificationStageName.SHIPPED_TO_CUSTOMER)
                .withSendNotification(true);
        model = BinaryData.fromObject(model).toObject(NotificationPreference.class);
        Assertions.assertEquals(NotificationStageName.SHIPPED_TO_CUSTOMER, model.stageName());
        Assertions.assertEquals(true, model.sendNotification());
    }
}
