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

package com.azure.resourcemanager.advisor.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.advisor.fluent.models.SuppressionContractInner;
import com.azure.resourcemanager.advisor.models.SuppressionContractListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SuppressionContractListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SuppressionContractListResult model =
            BinaryData
                .fromString(
                    "{\"nextLink\":\"ys\",\"value\":[{\"properties\":{\"suppressionId\":\"xhqyudxorrqnb\",\"ttl\":\"czvyifq\",\"expirationTimeStamp\":\"2020-12-25T17:33:53Z\"},\"id\":\"dvjsllrmvvdf\",\"name\":\"atkpnp\",\"type\":\"lexxbczwtru\"}]}")
                .toObject(SuppressionContractListResult.class);
        Assertions.assertEquals("ys", model.nextLink());
        Assertions.assertEquals("xhqyudxorrqnb", model.value().get(0).suppressionId());
        Assertions.assertEquals("czvyifq", model.value().get(0).ttl());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SuppressionContractListResult model =
            new SuppressionContractListResult()
                .withNextLink("ys")
                .withValue(
                    Arrays
                        .asList(new SuppressionContractInner().withSuppressionId("xhqyudxorrqnb").withTtl("czvyifq")));
        model = BinaryData.fromObject(model).toObject(SuppressionContractListResult.class);
        Assertions.assertEquals("ys", model.nextLink());
        Assertions.assertEquals("xhqyudxorrqnb", model.value().get(0).suppressionId());
        Assertions.assertEquals("czvyifq", model.value().get(0).ttl());
    }
}
