// 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.GitHubOwnerInner;
import com.azure.resourcemanager.securitydevops.models.GitHubOwnerProperties;
import com.azure.resourcemanager.securitydevops.models.ProvisioningState;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class GitHubOwnerInnerTests {
    @Test
    public void testDeserialize() {
        GitHubOwnerInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"provisioningState\":\"Succeeded\",\"ownerUrl\":\"llnwsubi\"},\"id\":\"jampmngnzscxaqw\",\"name\":\"ochcbonqvpkvl\",\"type\":\"xnj\"}")
                .toObject(GitHubOwnerInner.class);
        Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.properties().provisioningState());
        Assertions.assertEquals("llnwsubi", model.properties().ownerUrl());
    }

    @Test
    public void testSerialize() {
        GitHubOwnerInner model =
            new GitHubOwnerInner()
                .withProperties(
                    new GitHubOwnerProperties()
                        .withProvisioningState(ProvisioningState.SUCCEEDED)
                        .withOwnerUrl("llnwsubi"));
        model = BinaryData.fromObject(model).toObject(GitHubOwnerInner.class);
        Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.properties().provisioningState());
        Assertions.assertEquals("llnwsubi", model.properties().ownerUrl());
    }
}
