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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.models.AadConnectivityState;
import com.azure.resourcemanager.security.models.AadSolutionProperties;
import com.azure.resourcemanager.security.models.ConnectedWorkspace;
import org.junit.jupiter.api.Assertions;

public final class AadSolutionPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AadSolutionProperties model =
            BinaryData
                .fromString(
                    "{\"connectivityState\":\"Discovered\",\"deviceVendor\":\"yxoyfp\",\"deviceType\":\"qi\",\"workspace\":{\"id\":\"xlhdj\"},\"\":{\"jriyb\":\"datacadwvpsozjii\",\"epnxwd\":\"datarz\",\"xaurs\":\"datawnjkgvfn\",\"pnqn\":\"dataftibtyibuyvpirfq\"}}")
                .toObject(AadSolutionProperties.class);
        Assertions.assertEquals("yxoyfp", model.deviceVendor());
        Assertions.assertEquals("qi", model.deviceType());
        Assertions.assertEquals("xlhdj", model.workspace().id());
        Assertions.assertEquals(AadConnectivityState.DISCOVERED, model.connectivityState());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AadSolutionProperties model =
            new AadSolutionProperties()
                .withDeviceVendor("yxoyfp")
                .withDeviceType("qi")
                .withWorkspace(new ConnectedWorkspace().withId("xlhdj"))
                .withConnectivityState(AadConnectivityState.DISCOVERED);
        model = BinaryData.fromObject(model).toObject(AadSolutionProperties.class);
        Assertions.assertEquals("yxoyfp", model.deviceVendor());
        Assertions.assertEquals("qi", model.deviceType());
        Assertions.assertEquals("xlhdj", model.workspace().id());
        Assertions.assertEquals(AadConnectivityState.DISCOVERED, model.connectivityState());
    }
}
