// 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.RepositoryRefDefinition;
import org.junit.jupiter.api.Assertions;

public final class RepositoryRefDefinitionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        RepositoryRefDefinition model =
            BinaryData
                .fromString(
                    "{\"branch\":\"ysszdnrujqguh\",\"tag\":\"ouqfprwz\",\"semver\":\"nguitnwuizgazxu\",\"commit\":\"zuckyfi\"}")
                .toObject(RepositoryRefDefinition.class);
        Assertions.assertEquals("ysszdnrujqguh", model.branch());
        Assertions.assertEquals("ouqfprwz", model.tag());
        Assertions.assertEquals("nguitnwuizgazxu", model.semver());
        Assertions.assertEquals("zuckyfi", model.commit());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        RepositoryRefDefinition model =
            new RepositoryRefDefinition()
                .withBranch("ysszdnrujqguh")
                .withTag("ouqfprwz")
                .withSemver("nguitnwuizgazxu")
                .withCommit("zuckyfi");
        model = BinaryData.fromObject(model).toObject(RepositoryRefDefinition.class);
        Assertions.assertEquals("ysszdnrujqguh", model.branch());
        Assertions.assertEquals("ouqfprwz", model.tag());
        Assertions.assertEquals("nguitnwuizgazxu", model.semver());
        Assertions.assertEquals("zuckyfi", model.commit());
    }
}
