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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.AssignedUser;
import com.azure.resourcemanager.machinelearning.models.PersonalComputeInstanceSettings;
import org.junit.jupiter.api.Assertions;

public final class PersonalComputeInstanceSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PersonalComputeInstanceSettings model =
            BinaryData
                .fromString("{\"assignedUser\":{\"objectId\":\"emc\",\"tenantId\":\"jk\"}}")
                .toObject(PersonalComputeInstanceSettings.class);
        Assertions.assertEquals("emc", model.assignedUser().objectId());
        Assertions.assertEquals("jk", model.assignedUser().tenantId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PersonalComputeInstanceSettings model =
            new PersonalComputeInstanceSettings()
                .withAssignedUser(new AssignedUser().withObjectId("emc").withTenantId("jk"));
        model = BinaryData.fromObject(model).toObject(PersonalComputeInstanceSettings.class);
        Assertions.assertEquals("emc", model.assignedUser().objectId());
        Assertions.assertEquals("jk", model.assignedUser().tenantId());
    }
}
