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

package com.azure.resourcemanager.azurestack.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.azurestack.models.Compatibility;
import com.azure.resourcemanager.azurestack.models.CompatibilityIssue;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CompatibilityTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Compatibility model =
            BinaryData
                .fromString(
                    "{\"isCompatible\":true,\"message\":\"pj\",\"description\":\"asxazjpqyegualhb\",\"issues\":[\"ConnectionToInternetRequired\",\"DevelopmentBillingModelRequired\"]}")
                .toObject(Compatibility.class);
        Assertions.assertEquals(true, model.isCompatible());
        Assertions.assertEquals("pj", model.message());
        Assertions.assertEquals("asxazjpqyegualhb", model.description());
        Assertions.assertEquals(CompatibilityIssue.CONNECTION_TO_INTERNET_REQUIRED, model.issues().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Compatibility model =
            new Compatibility()
                .withIsCompatible(true)
                .withMessage("pj")
                .withDescription("asxazjpqyegualhb")
                .withIssues(
                    Arrays
                        .asList(
                            CompatibilityIssue.CONNECTION_TO_INTERNET_REQUIRED,
                            CompatibilityIssue.DEVELOPMENT_BILLING_MODEL_REQUIRED));
        model = BinaryData.fromObject(model).toObject(Compatibility.class);
        Assertions.assertEquals(true, model.isCompatible());
        Assertions.assertEquals("pj", model.message());
        Assertions.assertEquals("asxazjpqyegualhb", model.description());
        Assertions.assertEquals(CompatibilityIssue.CONNECTION_TO_INTERNET_REQUIRED, model.issues().get(0));
    }
}
