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

package com.azure.resourcemanager.kubernetesconfiguration.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kubernetesconfiguration.models.Scope;
import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeCluster;
import com.azure.resourcemanager.kubernetesconfiguration.models.ScopeNamespace;
import org.junit.jupiter.api.Assertions;

public final class ScopeTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Scope model =
            BinaryData
                .fromString(
                    "{\"cluster\":{\"releaseNamespace\":\"upewnwreitjzy\"},\"namespace\":{\"targetNamespace\":\"sarhmofc\"}}")
                .toObject(Scope.class);
        Assertions.assertEquals("upewnwreitjzy", model.cluster().releaseNamespace());
        Assertions.assertEquals("sarhmofc", model.namespace().targetNamespace());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Scope model =
            new Scope()
                .withCluster(new ScopeCluster().withReleaseNamespace("upewnwreitjzy"))
                .withNamespace(new ScopeNamespace().withTargetNamespace("sarhmofc"));
        model = BinaryData.fromObject(model).toObject(Scope.class);
        Assertions.assertEquals("upewnwreitjzy", model.cluster().releaseNamespace());
        Assertions.assertEquals("sarhmofc", model.namespace().targetNamespace());
    }
}
