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

package com.azure.resourcemanager.databoxedge.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databoxedge.models.ShareAccessType;
import com.azure.resourcemanager.databoxedge.models.UserAccessRight;
import org.junit.jupiter.api.Assertions;

public final class UserAccessRightTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        UserAccessRight model =
            BinaryData
                .fromString("{\"userId\":\"qtaruoujmkcjhwq\",\"accessType\":\"Read\"}")
                .toObject(UserAccessRight.class);
        Assertions.assertEquals("qtaruoujmkcjhwq", model.userId());
        Assertions.assertEquals(ShareAccessType.READ, model.accessType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        UserAccessRight model =
            new UserAccessRight().withUserId("qtaruoujmkcjhwq").withAccessType(ShareAccessType.READ);
        model = BinaryData.fromObject(model).toObject(UserAccessRight.class);
        Assertions.assertEquals("qtaruoujmkcjhwq", model.userId());
        Assertions.assertEquals(ShareAccessType.READ, model.accessType());
    }
}
