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

package com.azure.resourcemanager.mariadb.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mariadb.fluent.models.LogFileInner;
import com.azure.resourcemanager.mariadb.models.LogFileListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class LogFileListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LogFileListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"sizeInKB\":5458366218543604408,\"createdTime\":\"2021-05-01T06:23:28Z\",\"lastModifiedTime\":\"2021-05-14T05:31:12Z\",\"type\":\"pqyegualhbxxh\",\"url\":\"jzzvdud\"},\"id\":\"wdslfhotwmcy\",\"name\":\"pwlbjnpg\",\"type\":\"cftadeh\"}]}")
                .toObject(LogFileListResult.class);
        Assertions.assertEquals(5458366218543604408L, model.value().get(0).sizeInKB());
        Assertions.assertEquals("pqyegualhbxxh", model.value().get(0).typePropertiesType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LogFileListResult model =
            new LogFileListResult()
                .withValue(
                    Arrays
                        .asList(
                            new LogFileInner()
                                .withSizeInKB(5458366218543604408L)
                                .withTypePropertiesType("pqyegualhbxxh")));
        model = BinaryData.fromObject(model).toObject(LogFileListResult.class);
        Assertions.assertEquals(5458366218543604408L, model.value().get(0).sizeInKB());
        Assertions.assertEquals("pqyegualhbxxh", model.value().get(0).typePropertiesType());
    }
}
