// 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.models.AutoDiscovery;
import com.azure.resourcemanager.securitydevops.models.AzureDevOpsProjectMetadata;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class AzureDevOpsProjectMetadataTests {
    @Test
    public void testDeserialize() {
        AzureDevOpsProjectMetadata model =
            BinaryData
                .fromString(
                    "{\"name\":\"jgrtfwvukxga\",\"autoDiscovery\":\"Disabled\",\"repos\":[\"nhsjcnyej\",\"kryhtnapczwlokj\",\"emkkvnipjox\",\"jnchgej\"]}")
                .toObject(AzureDevOpsProjectMetadata.class);
        Assertions.assertEquals("jgrtfwvukxga", model.name());
        Assertions.assertEquals(AutoDiscovery.DISABLED, model.autoDiscovery());
        Assertions.assertEquals("nhsjcnyej", model.repos().get(0));
    }

    @Test
    public void testSerialize() {
        AzureDevOpsProjectMetadata model =
            new AzureDevOpsProjectMetadata()
                .withName("jgrtfwvukxga")
                .withAutoDiscovery(AutoDiscovery.DISABLED)
                .withRepos(Arrays.asList("nhsjcnyej", "kryhtnapczwlokj", "emkkvnipjox", "jnchgej"));
        model = BinaryData.fromObject(model).toObject(AzureDevOpsProjectMetadata.class);
        Assertions.assertEquals("jgrtfwvukxga", model.name());
        Assertions.assertEquals(AutoDiscovery.DISABLED, model.autoDiscovery());
        Assertions.assertEquals("nhsjcnyej", model.repos().get(0));
    }
}
