// 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.BillingRoleAssignmentProperties;
import org.junit.jupiter.api.Assertions;

public final class BillingRoleAssignmentPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        BillingRoleAssignmentProperties model =
            BinaryData
                .fromString(
                    "{\"createdOn\":\"ronasxift\",\"createdByPrincipalTenantId\":\"qyzhf\",\"createdByPrincipalId\":\"esgogc\",\"createdByUserEmailAddress\":\"onnxkrlgnyhm\",\"principalId\":\"sxkkg\",\"principalTenantId\":\"rrghxjbdhqxvcxgf\",\"roleDefinitionId\":\"dsofbshrns\",\"scope\":\"uswdv\",\"userAuthenticationType\":\"ybycnunvj\",\"userEmailAddress\":\"tkfa\"}")
                .toObject(BillingRoleAssignmentProperties.class);
        Assertions.assertEquals("sxkkg", model.principalId());
        Assertions.assertEquals("rrghxjbdhqxvcxgf", model.principalTenantId());
        Assertions.assertEquals("dsofbshrns", model.roleDefinitionId());
        Assertions.assertEquals("ybycnunvj", model.userAuthenticationType());
        Assertions.assertEquals("tkfa", model.userEmailAddress());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        BillingRoleAssignmentProperties model =
            new BillingRoleAssignmentProperties()
                .withPrincipalId("sxkkg")
                .withPrincipalTenantId("rrghxjbdhqxvcxgf")
                .withRoleDefinitionId("dsofbshrns")
                .withUserAuthenticationType("ybycnunvj")
                .withUserEmailAddress("tkfa");
        model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentProperties.class);
        Assertions.assertEquals("sxkkg", model.principalId());
        Assertions.assertEquals("rrghxjbdhqxvcxgf", model.principalTenantId());
        Assertions.assertEquals("dsofbshrns", model.roleDefinitionId());
        Assertions.assertEquals("ybycnunvj", model.userAuthenticationType());
        Assertions.assertEquals("tkfa", model.userEmailAddress());
    }
}
