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

package com.azure.resourcemanager.purview.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.purview.fluent.models.DefaultAccountPayloadInner;
import com.azure.resourcemanager.purview.models.ScopeType;
import org.junit.jupiter.api.Assertions;

public final class DefaultAccountPayloadInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DefaultAccountPayloadInner model =
            BinaryData
                .fromString(
                    "{\"accountName\":\"gwdslfhotwm\",\"resourceGroupName\":\"npwlbjnpg\",\"scope\":\"ftadehxnltyfs\",\"scopeTenantId\":\"pusuesn\",\"scopeType\":\"Tenant\",\"subscriptionId\":\"jbavorxzdm\"}")
                .toObject(DefaultAccountPayloadInner.class);
        Assertions.assertEquals("gwdslfhotwm", model.accountName());
        Assertions.assertEquals("npwlbjnpg", model.resourceGroupName());
        Assertions.assertEquals("ftadehxnltyfs", model.scope());
        Assertions.assertEquals("pusuesn", model.scopeTenantId());
        Assertions.assertEquals(ScopeType.TENANT, model.scopeType());
        Assertions.assertEquals("jbavorxzdm", model.subscriptionId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DefaultAccountPayloadInner model =
            new DefaultAccountPayloadInner()
                .withAccountName("gwdslfhotwm")
                .withResourceGroupName("npwlbjnpg")
                .withScope("ftadehxnltyfs")
                .withScopeTenantId("pusuesn")
                .withScopeType(ScopeType.TENANT)
                .withSubscriptionId("jbavorxzdm");
        model = BinaryData.fromObject(model).toObject(DefaultAccountPayloadInner.class);
        Assertions.assertEquals("gwdslfhotwm", model.accountName());
        Assertions.assertEquals("npwlbjnpg", model.resourceGroupName());
        Assertions.assertEquals("ftadehxnltyfs", model.scope());
        Assertions.assertEquals("pusuesn", model.scopeTenantId());
        Assertions.assertEquals(ScopeType.TENANT, model.scopeType());
        Assertions.assertEquals("jbavorxzdm", model.subscriptionId());
    }
}
