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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner;
import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutionList;
import com.azure.resourcemanager.security.models.SecurityFamily;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class DiscoveredSecuritySolutionListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DiscoveredSecuritySolutionList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"securityFamily\":\"Ngfw\",\"offer\":\"ptfujgicgaaoept\",\"publisher\":\"aqutdewemxswvruu\",\"sku\":\"zzjgehkfki\"},\"location\":\"tixo\",\"id\":\"ffqyinlj\",\"name\":\"epqw\",\"type\":\"ixmonstshiyxg\"},{\"properties\":{\"securityFamily\":\"SaasWaf\",\"offer\":\"lfcldu\",\"publisher\":\"cb\",\"sku\":\"rds\"},\"location\":\"wcobie\",\"id\":\"stmninwjizcilng\",\"name\":\"gshejjtbxqmulux\",\"type\":\"xqzv\"},{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"rsbycucrwn\",\"publisher\":\"mikzeb\",\"sku\":\"qbsms\"},\"location\":\"iqg\",\"id\":\"uhok\",\"name\":\"ruswhv\",\"type\":\"czznvfbycjsxj\"},{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"i\",\"publisher\":\"z\",\"sku\":\"umwmxqhnd\"},\"location\":\"oamld\",\"id\":\"ehaohdjhh\",\"name\":\"lzok\",\"type\":\"coxpelnjeta\"}],\"nextLink\":\"tsxoatftgz\"}")
                .toObject(DiscoveredSecuritySolutionList.class);
        Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily());
        Assertions.assertEquals("ptfujgicgaaoept", model.value().get(0).offer());
        Assertions.assertEquals("aqutdewemxswvruu", model.value().get(0).publisher());
        Assertions.assertEquals("zzjgehkfki", model.value().get(0).sku());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DiscoveredSecuritySolutionList model =
            new DiscoveredSecuritySolutionList()
                .withValue(
                    Arrays
                        .asList(
                            new DiscoveredSecuritySolutionInner()
                                .withSecurityFamily(SecurityFamily.NGFW)
                                .withOffer("ptfujgicgaaoept")
                                .withPublisher("aqutdewemxswvruu")
                                .withSku("zzjgehkfki"),
                            new DiscoveredSecuritySolutionInner()
                                .withSecurityFamily(SecurityFamily.SAAS_WAF)
                                .withOffer("lfcldu")
                                .withPublisher("cb")
                                .withSku("rds"),
                            new DiscoveredSecuritySolutionInner()
                                .withSecurityFamily(SecurityFamily.WAF)
                                .withOffer("rsbycucrwn")
                                .withPublisher("mikzeb")
                                .withSku("qbsms"),
                            new DiscoveredSecuritySolutionInner()
                                .withSecurityFamily(SecurityFamily.WAF)
                                .withOffer("i")
                                .withPublisher("z")
                                .withSku("umwmxqhnd")));
        model = BinaryData.fromObject(model).toObject(DiscoveredSecuritySolutionList.class);
        Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily());
        Assertions.assertEquals("ptfujgicgaaoept", model.value().get(0).offer());
        Assertions.assertEquals("aqutdewemxswvruu", model.value().get(0).publisher());
        Assertions.assertEquals("zzjgehkfki", model.value().get(0).sku());
    }
}
