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

package com.azure.resourcemanager.securitydevops.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.securitydevops.fluent.models.AzureDevOpsProjectInner;
import com.azure.resourcemanager.securitydevops.models.AutoDiscovery;
import com.azure.resourcemanager.securitydevops.models.AzureDevOpsProjectProperties;
import com.azure.resourcemanager.securitydevops.models.ProvisioningState;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class AzureDevOpsProjectInnerTests {
    @Test
    public void testDeserialize() {
        AzureDevOpsProjectInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"provisioningState\":\"Failed\",\"projectId\":\"kfthwxmntei\",\"orgName\":\"opvkmijcm\",\"autoDiscovery\":\"Disabled\"},\"id\":\"ufufsrp\",\"name\":\"mzidnsezcxtb\",\"type\":\"sgfyccsnew\"}")
                .toObject(AzureDevOpsProjectInner.class);
        Assertions.assertEquals(ProvisioningState.FAILED, model.properties().provisioningState());
        Assertions.assertEquals("kfthwxmntei", model.properties().projectId());
        Assertions.assertEquals("opvkmijcm", model.properties().orgName());
        Assertions.assertEquals(AutoDiscovery.DISABLED, model.properties().autoDiscovery());
    }

    @Test
    public void testSerialize() {
        AzureDevOpsProjectInner model =
            new AzureDevOpsProjectInner()
                .withProperties(
                    new AzureDevOpsProjectProperties()
                        .withProvisioningState(ProvisioningState.FAILED)
                        .withProjectId("kfthwxmntei")
                        .withOrgName("opvkmijcm")
                        .withAutoDiscovery(AutoDiscovery.DISABLED));
        model = BinaryData.fromObject(model).toObject(AzureDevOpsProjectInner.class);
        Assertions.assertEquals(ProvisioningState.FAILED, model.properties().provisioningState());
        Assertions.assertEquals("kfthwxmntei", model.properties().projectId());
        Assertions.assertEquals("opvkmijcm", model.properties().orgName());
        Assertions.assertEquals(AutoDiscovery.DISABLED, model.properties().autoDiscovery());
    }
}
