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

package com.azure.resourcemanager.billingbenefits.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.billingbenefits.fluent.models.RoleAssignmentEntityInner;
import org.junit.jupiter.api.Assertions;

public final class RoleAssignmentEntityInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        RoleAssignmentEntityInner model =
            BinaryData
                .fromString(
                    "{\"id\":\"wpdappdsbdkv\",\"name\":\"wjfeusnhutjel\",\"properties\":{\"principalId\":\"ldhugjzzdatqxh\",\"roleDefinitionId\":\"dgeablgphu\",\"scope\":\"cndvkaozwyiftyhx\"}}")
                .toObject(RoleAssignmentEntityInner.class);
        Assertions.assertEquals("wpdappdsbdkv", model.id());
        Assertions.assertEquals("wjfeusnhutjel", model.name());
        Assertions.assertEquals("ldhugjzzdatqxh", model.principalId());
        Assertions.assertEquals("dgeablgphu", model.roleDefinitionId());
        Assertions.assertEquals("cndvkaozwyiftyhx", model.scope());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        RoleAssignmentEntityInner model =
            new RoleAssignmentEntityInner()
                .withId("wpdappdsbdkv")
                .withName("wjfeusnhutjel")
                .withPrincipalId("ldhugjzzdatqxh")
                .withRoleDefinitionId("dgeablgphu")
                .withScope("cndvkaozwyiftyhx");
        model = BinaryData.fromObject(model).toObject(RoleAssignmentEntityInner.class);
        Assertions.assertEquals("wpdappdsbdkv", model.id());
        Assertions.assertEquals("wjfeusnhutjel", model.name());
        Assertions.assertEquals("ldhugjzzdatqxh", model.principalId());
        Assertions.assertEquals("dgeablgphu", model.roleDefinitionId());
        Assertions.assertEquals("cndvkaozwyiftyhx", model.scope());
    }
}
