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

package com.azure.resourcemanager.agrifood.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.agrifood.models.UnitSystemsInfo;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class UnitSystemsInfoTests {
    @Test
    public void testDeserialize() {
        UnitSystemsInfo model =
            BinaryData
                .fromString("{\"key\":\"pnddhsgcbacphejk\",\"values\":[\"ynqgoulzndlikwyq\",\"gfgibm\"]}")
                .toObject(UnitSystemsInfo.class);
        Assertions.assertEquals("pnddhsgcbacphejk", model.key());
        Assertions.assertEquals("ynqgoulzndlikwyq", model.values().get(0));
    }

    @Test
    public void testSerialize() {
        UnitSystemsInfo model =
            new UnitSystemsInfo().withKey("pnddhsgcbacphejk").withValues(Arrays.asList("ynqgoulzndlikwyq", "gfgibm"));
        model = BinaryData.fromObject(model).toObject(UnitSystemsInfo.class);
        Assertions.assertEquals("pnddhsgcbacphejk", model.key());
        Assertions.assertEquals("ynqgoulzndlikwyq", model.values().get(0));
    }
}
