// 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.DetailedInformation;
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 DetailedInformationTests {
    @Test
    public void testDeserialize() {
        DetailedInformation model =
            BinaryData
                .fromString(
                    "{\"apiName\":\"mgxsab\",\"customParameters\":[\"duuji\",\"c\",\"czdzev\",\"dhkrwpdappdsbdk\"],\"platformParameters\":[\"wjfeusnhutjel\",\"mrldhu\"],\"unitsSupported\":{\"key\":\"zzd\",\"values\":[\"qxhocdgeablgphut\",\"cndvkaozwyiftyhx\",\"urokft\"]},\"apiInputParameters\":[\"lniwpwcukjfkgiaw\",\"klryplwck\",\"asy\"]}")
                .toObject(DetailedInformation.class);
        Assertions.assertEquals("mgxsab", model.apiName());
        Assertions.assertEquals("duuji", model.customParameters().get(0));
        Assertions.assertEquals("wjfeusnhutjel", model.platformParameters().get(0));
        Assertions.assertEquals("zzd", model.unitsSupported().key());
        Assertions.assertEquals("qxhocdgeablgphut", model.unitsSupported().values().get(0));
        Assertions.assertEquals("lniwpwcukjfkgiaw", model.apiInputParameters().get(0));
    }

    @Test
    public void testSerialize() {
        DetailedInformation model =
            new DetailedInformation()
                .withApiName("mgxsab")
                .withCustomParameters(Arrays.asList("duuji", "c", "czdzev", "dhkrwpdappdsbdk"))
                .withPlatformParameters(Arrays.asList("wjfeusnhutjel", "mrldhu"))
                .withUnitsSupported(
                    new UnitSystemsInfo()
                        .withKey("zzd")
                        .withValues(Arrays.asList("qxhocdgeablgphut", "cndvkaozwyiftyhx", "urokft")))
                .withApiInputParameters(Arrays.asList("lniwpwcukjfkgiaw", "klryplwck", "asy"));
        model = BinaryData.fromObject(model).toObject(DetailedInformation.class);
        Assertions.assertEquals("mgxsab", model.apiName());
        Assertions.assertEquals("duuji", model.customParameters().get(0));
        Assertions.assertEquals("wjfeusnhutjel", model.platformParameters().get(0));
        Assertions.assertEquals("zzd", model.unitsSupported().key());
        Assertions.assertEquals("qxhocdgeablgphut", model.unitsSupported().values().get(0));
        Assertions.assertEquals("lniwpwcukjfkgiaw", model.apiInputParameters().get(0));
    }
}
