// 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.OnPremiseResourceDetails;
import org.junit.jupiter.api.Assertions;

public final class OnPremiseResourceDetailsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OnPremiseResourceDetails model =
            BinaryData
                .fromString(
                    "{\"source\":\"OnPremise\",\"workspaceId\":\"ilaywkdcwm\",\"vmuuid\":\"syril\",\"sourceComputerId\":\"hxdqaol\",\"machineName\":\"ylnkkbjpjvlywltm\"}")
                .toObject(OnPremiseResourceDetails.class);
        Assertions.assertEquals("ilaywkdcwm", model.workspaceId());
        Assertions.assertEquals("syril", model.vmuuid());
        Assertions.assertEquals("hxdqaol", model.sourceComputerId());
        Assertions.assertEquals("ylnkkbjpjvlywltm", model.machineName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OnPremiseResourceDetails model =
            new OnPremiseResourceDetails()
                .withWorkspaceId("ilaywkdcwm")
                .withVmuuid("syril")
                .withSourceComputerId("hxdqaol")
                .withMachineName("ylnkkbjpjvlywltm");
        model = BinaryData.fromObject(model).toObject(OnPremiseResourceDetails.class);
        Assertions.assertEquals("ilaywkdcwm", model.workspaceId());
        Assertions.assertEquals("syril", model.vmuuid());
        Assertions.assertEquals("hxdqaol", model.sourceComputerId());
        Assertions.assertEquals("ylnkkbjpjvlywltm", model.machineName());
    }
}
