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

package com.azure.resourcemanager.billing.generated;

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

public final class BillingRoleAssignmentInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        BillingRoleAssignmentInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"createdOn\":\"ithtywu\",\"createdByPrincipalTenantId\":\"cbihwqk\",\"createdByPrincipalId\":\"dntwjchrdgo\",\"createdByUserEmailAddress\":\"xum\",\"principalId\":\"ton\",\"principalTenantId\":\"jl\",\"roleDefinitionId\":\"dfdlwggyts\",\"scope\":\"tov\",\"userAuthenticationType\":\"gseinq\",\"userEmailAddress\":\"ufxqknpirgnepttw\"},\"id\":\"msniffc\",\"name\":\"mqnrojlpijnkr\",\"type\":\"frddhcrati\"}")
                .toObject(BillingRoleAssignmentInner.class);
        Assertions.assertEquals("ton", model.principalId());
        Assertions.assertEquals("jl", model.principalTenantId());
        Assertions.assertEquals("dfdlwggyts", model.roleDefinitionId());
        Assertions.assertEquals("gseinq", model.userAuthenticationType());
        Assertions.assertEquals("ufxqknpirgnepttw", model.userEmailAddress());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        BillingRoleAssignmentInner model =
            new BillingRoleAssignmentInner()
                .withPrincipalId("ton")
                .withPrincipalTenantId("jl")
                .withRoleDefinitionId("dfdlwggyts")
                .withUserAuthenticationType("gseinq")
                .withUserEmailAddress("ufxqknpirgnepttw");
        model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentInner.class);
        Assertions.assertEquals("ton", model.principalId());
        Assertions.assertEquals("jl", model.principalTenantId());
        Assertions.assertEquals("dfdlwggyts", model.roleDefinitionId());
        Assertions.assertEquals("gseinq", model.userAuthenticationType());
        Assertions.assertEquals("ufxqknpirgnepttw", model.userEmailAddress());
    }
}
