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

package com.azure.resourcemanager.frontdoor.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.frontdoor.fluent.models.ExperimentProperties;
import com.azure.resourcemanager.frontdoor.models.Endpoint;
import com.azure.resourcemanager.frontdoor.models.State;
import org.junit.jupiter.api.Assertions;

public final class ExperimentPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ExperimentProperties model =
            BinaryData
                .fromString(
                    "{\"description\":\"zrfze\",\"endpointA\":{\"name\":\"bizikayuhq\",\"endpoint\":\"jbsybbqw\"},\"endpointB\":{\"name\":\"ldgmfpgvmpip\",\"endpoint\":\"ltha\"},\"enabledState\":\"Enabled\",\"resourceState\":\"Enabled\",\"status\":\"wutwbdsre\",\"scriptFileUri\":\"drhneuyow\"}")
                .toObject(ExperimentProperties.class);
        Assertions.assertEquals("zrfze", model.description());
        Assertions.assertEquals("bizikayuhq", model.endpointA().name());
        Assertions.assertEquals("jbsybbqw", model.endpointA().endpoint());
        Assertions.assertEquals("ldgmfpgvmpip", model.endpointB().name());
        Assertions.assertEquals("ltha", model.endpointB().endpoint());
        Assertions.assertEquals(State.ENABLED, model.enabledState());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ExperimentProperties model =
            new ExperimentProperties()
                .withDescription("zrfze")
                .withEndpointA(new Endpoint().withName("bizikayuhq").withEndpoint("jbsybbqw"))
                .withEndpointB(new Endpoint().withName("ldgmfpgvmpip").withEndpoint("ltha"))
                .withEnabledState(State.ENABLED);
        model = BinaryData.fromObject(model).toObject(ExperimentProperties.class);
        Assertions.assertEquals("zrfze", model.description());
        Assertions.assertEquals("bizikayuhq", model.endpointA().name());
        Assertions.assertEquals("jbsybbqw", model.endpointA().endpoint());
        Assertions.assertEquals("ldgmfpgvmpip", model.endpointB().name());
        Assertions.assertEquals("ltha", model.endpointB().endpoint());
        Assertions.assertEquals(State.ENABLED, model.enabledState());
    }
}
