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

package com.azure.resourcemanager.storagecache.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemCheckSubnetError;
import com.azure.resourcemanager.storagecache.models.AmlFilesystemCheckSubnetErrorFilesystemSubnet;
import com.azure.resourcemanager.storagecache.models.FilesystemSubnetStatusType;
import org.junit.jupiter.api.Assertions;

public final class AmlFilesystemCheckSubnetErrorTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AmlFilesystemCheckSubnetError model =
            BinaryData
                .fromString("{\"filesystemSubnet\":{\"status\":\"Invalid\",\"message\":\"i\"}}")
                .toObject(AmlFilesystemCheckSubnetError.class);
        Assertions.assertEquals(FilesystemSubnetStatusType.INVALID, model.filesystemSubnet().status());
        Assertions.assertEquals("i", model.filesystemSubnet().message());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AmlFilesystemCheckSubnetError model =
            new AmlFilesystemCheckSubnetError()
                .withFilesystemSubnet(
                    new AmlFilesystemCheckSubnetErrorFilesystemSubnet()
                        .withStatus(FilesystemSubnetStatusType.INVALID)
                        .withMessage("i"));
        model = BinaryData.fromObject(model).toObject(AmlFilesystemCheckSubnetError.class);
        Assertions.assertEquals(FilesystemSubnetStatusType.INVALID, model.filesystemSubnet().status());
        Assertions.assertEquals("i", model.filesystemSubnet().message());
    }
}
