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

package com.azure.resourcemanager.dataprotection.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dataprotection.models.DatasourceSet;
import org.junit.jupiter.api.Assertions;

public final class DatasourceSetTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DatasourceSet model =
            BinaryData
                .fromString(
                    "{\"datasourceType\":\"xbczwtruwiqz\",\"objectType\":\"j\",\"resourceID\":\"sovmyokacspkwl\",\"resourceLocation\":\"dobpxjmflbvvn\",\"resourceName\":\"rkcciwwzjuqk\",\"resourceType\":\"sa\",\"resourceUri\":\"wkuofoskghsauu\"}")
                .toObject(DatasourceSet.class);
        Assertions.assertEquals("xbczwtruwiqz", model.datasourceType());
        Assertions.assertEquals("j", model.objectType());
        Assertions.assertEquals("sovmyokacspkwl", model.resourceId());
        Assertions.assertEquals("dobpxjmflbvvn", model.resourceLocation());
        Assertions.assertEquals("rkcciwwzjuqk", model.resourceName());
        Assertions.assertEquals("sa", model.resourceType());
        Assertions.assertEquals("wkuofoskghsauu", model.resourceUri());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DatasourceSet model =
            new DatasourceSet()
                .withDatasourceType("xbczwtruwiqz")
                .withObjectType("j")
                .withResourceId("sovmyokacspkwl")
                .withResourceLocation("dobpxjmflbvvn")
                .withResourceName("rkcciwwzjuqk")
                .withResourceType("sa")
                .withResourceUri("wkuofoskghsauu");
        model = BinaryData.fromObject(model).toObject(DatasourceSet.class);
        Assertions.assertEquals("xbczwtruwiqz", model.datasourceType());
        Assertions.assertEquals("j", model.objectType());
        Assertions.assertEquals("sovmyokacspkwl", model.resourceId());
        Assertions.assertEquals("dobpxjmflbvvn", model.resourceLocation());
        Assertions.assertEquals("rkcciwwzjuqk", model.resourceName());
        Assertions.assertEquals("sa", model.resourceType());
        Assertions.assertEquals("wkuofoskghsauu", model.resourceUri());
    }
}
