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

package com.azure.resourcemanager.resourcehealth.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.resourcehealth.models.Link;
import com.azure.resourcemanager.resourcehealth.models.LinkDisplayText;
import com.azure.resourcemanager.resourcehealth.models.LinkTypeValues;
import org.junit.jupiter.api.Assertions;

public final class LinkTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Link model =
            BinaryData
                .fromString(
                    "{\"type\":\"Button\",\"displayText\":{\"value\":\"muzyoxaepdk\",\"localizedValue\":\"ancuxrhd\"},\"extensionName\":\"avxbniwdjswztsdb\",\"bladeName\":\"nxytxh\",\"parameters\":\"dataxbzpfzab\"}")
                .toObject(Link.class);
        Assertions.assertEquals(LinkTypeValues.BUTTON, model.type());
        Assertions.assertEquals("muzyoxaepdk", model.displayText().value());
        Assertions.assertEquals("ancuxrhd", model.displayText().localizedValue());
        Assertions.assertEquals("avxbniwdjswztsdb", model.extensionName());
        Assertions.assertEquals("nxytxh", model.bladeName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Link model =
            new Link()
                .withType(LinkTypeValues.BUTTON)
                .withDisplayText(new LinkDisplayText().withValue("muzyoxaepdk").withLocalizedValue("ancuxrhd"))
                .withExtensionName("avxbniwdjswztsdb")
                .withBladeName("nxytxh")
                .withParameters("dataxbzpfzab");
        model = BinaryData.fromObject(model).toObject(Link.class);
        Assertions.assertEquals(LinkTypeValues.BUTTON, model.type());
        Assertions.assertEquals("muzyoxaepdk", model.displayText().value());
        Assertions.assertEquals("ancuxrhd", model.displayText().localizedValue());
        Assertions.assertEquals("avxbniwdjswztsdb", model.extensionName());
        Assertions.assertEquals("nxytxh", model.bladeName());
    }
}
