// 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.ClientAccessRight;
import com.azure.resourcemanager.databoxedge.models.ClientPermissionType;
import org.junit.jupiter.api.Assertions;

public final class ClientAccessRightTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClientAccessRight model =
            BinaryData
                .fromString("{\"client\":\"jrybnwjewgdrjer\",\"accessPermission\":\"ReadOnly\"}")
                .toObject(ClientAccessRight.class);
        Assertions.assertEquals("jrybnwjewgdrjer", model.client());
        Assertions.assertEquals(ClientPermissionType.READ_ONLY, model.accessPermission());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ClientAccessRight model =
            new ClientAccessRight().withClient("jrybnwjewgdrjer").withAccessPermission(ClientPermissionType.READ_ONLY);
        model = BinaryData.fromObject(model).toObject(ClientAccessRight.class);
        Assertions.assertEquals("jrybnwjewgdrjer", model.client());
        Assertions.assertEquals(ClientPermissionType.READ_ONLY, model.accessPermission());
    }
}
