// 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.SecuritySolutionsReferenceDataListInner;
import com.azure.resourcemanager.security.models.SecurityFamily;
import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SecuritySolutionsReferenceDataListInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SecuritySolutionsReferenceDataListInner model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"securityFamily\":\"Va\",\"alertVendorName\":\"znnbsoqeqalarvl\",\"packageInfoUrl\":\"gunbtgfebwlnbm\",\"productName\":\"yreeudz\",\"publisher\":\"av\",\"publisherDisplayName\":\"pdqmjxlyyzglgouw\",\"template\":\"lmjjyuo\"},\"location\":\"tob\",\"id\":\"xkjeytunlbfj\",\"name\":\"wrus\",\"type\":\"kqbh\"}]}")
                .toObject(SecuritySolutionsReferenceDataListInner.class);
        Assertions.assertEquals(SecurityFamily.VA, model.value().get(0).securityFamily());
        Assertions.assertEquals("znnbsoqeqalarvl", model.value().get(0).alertVendorName());
        Assertions.assertEquals("gunbtgfebwlnbm", model.value().get(0).packageInfoUrl());
        Assertions.assertEquals("yreeudz", model.value().get(0).productName());
        Assertions.assertEquals("av", model.value().get(0).publisher());
        Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).publisherDisplayName());
        Assertions.assertEquals("lmjjyuo", model.value().get(0).template());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SecuritySolutionsReferenceDataListInner model =
            new SecuritySolutionsReferenceDataListInner()
                .withValue(
                    Arrays
                        .asList(
                            new SecuritySolutionsReferenceData()
                                .withSecurityFamily(SecurityFamily.VA)
                                .withAlertVendorName("znnbsoqeqalarvl")
                                .withPackageInfoUrl("gunbtgfebwlnbm")
                                .withProductName("yreeudz")
                                .withPublisher("av")
                                .withPublisherDisplayName("pdqmjxlyyzglgouw")
                                .withTemplate("lmjjyuo")));
        model = BinaryData.fromObject(model).toObject(SecuritySolutionsReferenceDataListInner.class);
        Assertions.assertEquals(SecurityFamily.VA, model.value().get(0).securityFamily());
        Assertions.assertEquals("znnbsoqeqalarvl", model.value().get(0).alertVendorName());
        Assertions.assertEquals("gunbtgfebwlnbm", model.value().get(0).packageInfoUrl());
        Assertions.assertEquals("yreeudz", model.value().get(0).productName());
        Assertions.assertEquals("av", model.value().get(0).publisher());
        Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).publisherDisplayName());
        Assertions.assertEquals("lmjjyuo", model.value().get(0).template());
    }
}
