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

package com.azure.resourcemanager.servicefabric.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.servicefabric.models.NamedPartitionSchemeDescription;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class NamedPartitionSchemeDescriptionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NamedPartitionSchemeDescription model =
            BinaryData
                .fromString(
                    "{\"partitionScheme\":\"Named\",\"count\":701185139,\"names\":[\"abjy\",\"ayffim\",\"zrtuzq\",\"gsexne\"]}")
                .toObject(NamedPartitionSchemeDescription.class);
        Assertions.assertEquals(701185139, model.count());
        Assertions.assertEquals("abjy", model.names().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NamedPartitionSchemeDescription model =
            new NamedPartitionSchemeDescription()
                .withCount(701185139)
                .withNames(Arrays.asList("abjy", "ayffim", "zrtuzq", "gsexne"));
        model = BinaryData.fromObject(model).toObject(NamedPartitionSchemeDescription.class);
        Assertions.assertEquals(701185139, model.count());
        Assertions.assertEquals("abjy", model.names().get(0));
    }
}
