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

package com.azure.resourcemanager.datadog.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.datadog.fluent.models.DatadogSingleSignOnResourceInner;
import com.azure.resourcemanager.datadog.models.DatadogSingleSignOnProperties;
import com.azure.resourcemanager.datadog.models.SingleSignOnStates;
import org.junit.jupiter.api.Assertions;

public final class DatadogSingleSignOnResourceInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DatadogSingleSignOnResourceInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"provisioningState\":\"Failed\",\"singleSignOnState\":\"Initial\",\"enterpriseAppId\":\"zlfbxzpuzycispnq\",\"singleSignOnUrl\":\"hmgkbrpyy\"},\"id\":\"ibnuqqkpik\",\"name\":\"drgvtqagn\",\"type\":\"uynhijg\"}")
                .toObject(DatadogSingleSignOnResourceInner.class);
        Assertions.assertEquals(SingleSignOnStates.INITIAL, model.properties().singleSignOnState());
        Assertions.assertEquals("zlfbxzpuzycispnq", model.properties().enterpriseAppId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DatadogSingleSignOnResourceInner model =
            new DatadogSingleSignOnResourceInner()
                .withProperties(
                    new DatadogSingleSignOnProperties()
                        .withSingleSignOnState(SingleSignOnStates.INITIAL)
                        .withEnterpriseAppId("zlfbxzpuzycispnq"));
        model = BinaryData.fromObject(model).toObject(DatadogSingleSignOnResourceInner.class);
        Assertions.assertEquals(SingleSignOnStates.INITIAL, model.properties().singleSignOnState());
        Assertions.assertEquals("zlfbxzpuzycispnq", model.properties().enterpriseAppId());
    }
}
