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

package com.azure.resourcemanager.postgresqlflexibleserver.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.postgresqlflexibleserver.fluent.models.AdministratorPropertiesForAdd;
import com.azure.resourcemanager.postgresqlflexibleserver.models.PrincipalType;
import org.junit.jupiter.api.Assertions;

public final class AdministratorPropertiesForAddTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AdministratorPropertiesForAdd model =
            BinaryData
                .fromString(
                    "{\"principalType\":\"Unknown\",\"principalName\":\"hmtzopbsphrup\",\"tenantId\":\"gsybbejhp\"}")
                .toObject(AdministratorPropertiesForAdd.class);
        Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType());
        Assertions.assertEquals("hmtzopbsphrup", model.principalName());
        Assertions.assertEquals("gsybbejhp", model.tenantId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AdministratorPropertiesForAdd model =
            new AdministratorPropertiesForAdd()
                .withPrincipalType(PrincipalType.UNKNOWN)
                .withPrincipalName("hmtzopbsphrup")
                .withTenantId("gsybbejhp");
        model = BinaryData.fromObject(model).toObject(AdministratorPropertiesForAdd.class);
        Assertions.assertEquals(PrincipalType.UNKNOWN, model.principalType());
        Assertions.assertEquals("hmtzopbsphrup", model.principalName());
        Assertions.assertEquals("gsybbejhp", model.tenantId());
    }
}
