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

package com.azure.resourcemanager.support.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.support.models.ContactProfile;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ContactProfileTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ContactProfile model =
            BinaryData
                .fromString(
                    "{\"firstName\":\"big\",\"lastName\":\"h\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"fbowskanyk\",\"additionalEmailAddresses\":[\"cuiywgqyw\",\"ndrvynhzg\",\"phrcgyncoc\",\"ecfvmm\"],\"phoneNumber\":\"ofsx\",\"preferredTimeZone\":\"zevgb\",\"country\":\"qjqabcypmivkwl\",\"preferredSupportLanguage\":\"uvcc\"}")
                .toObject(ContactProfile.class);
        Assertions.assertEquals("big", model.firstName());
        Assertions.assertEquals("h", model.lastName());
        Assertions.assertEquals(PreferredContactMethod.EMAIL, model.preferredContactMethod());
        Assertions.assertEquals("fbowskanyk", model.primaryEmailAddress());
        Assertions.assertEquals("cuiywgqyw", model.additionalEmailAddresses().get(0));
        Assertions.assertEquals("ofsx", model.phoneNumber());
        Assertions.assertEquals("zevgb", model.preferredTimeZone());
        Assertions.assertEquals("qjqabcypmivkwl", model.country());
        Assertions.assertEquals("uvcc", model.preferredSupportLanguage());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ContactProfile model =
            new ContactProfile()
                .withFirstName("big")
                .withLastName("h")
                .withPreferredContactMethod(PreferredContactMethod.EMAIL)
                .withPrimaryEmailAddress("fbowskanyk")
                .withAdditionalEmailAddresses(Arrays.asList("cuiywgqyw", "ndrvynhzg", "phrcgyncoc", "ecfvmm"))
                .withPhoneNumber("ofsx")
                .withPreferredTimeZone("zevgb")
                .withCountry("qjqabcypmivkwl")
                .withPreferredSupportLanguage("uvcc");
        model = BinaryData.fromObject(model).toObject(ContactProfile.class);
        Assertions.assertEquals("big", model.firstName());
        Assertions.assertEquals("h", model.lastName());
        Assertions.assertEquals(PreferredContactMethod.EMAIL, model.preferredContactMethod());
        Assertions.assertEquals("fbowskanyk", model.primaryEmailAddress());
        Assertions.assertEquals("cuiywgqyw", model.additionalEmailAddresses().get(0));
        Assertions.assertEquals("ofsx", model.phoneNumber());
        Assertions.assertEquals("zevgb", model.preferredTimeZone());
        Assertions.assertEquals("qjqabcypmivkwl", model.country());
        Assertions.assertEquals("uvcc", model.preferredSupportLanguage());
    }
}
