// 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.StorageTargetSpaceAllocation;
import org.junit.jupiter.api.Assertions;

public final class StorageTargetSpaceAllocationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StorageTargetSpaceAllocation model =
            BinaryData
                .fromString("{\"name\":\"tkoievseotgq\",\"allocationPercentage\":1291535699}")
                .toObject(StorageTargetSpaceAllocation.class);
        Assertions.assertEquals("tkoievseotgq", model.name());
        Assertions.assertEquals(1291535699, model.allocationPercentage());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StorageTargetSpaceAllocation model =
            new StorageTargetSpaceAllocation().withName("tkoievseotgq").withAllocationPercentage(1291535699);
        model = BinaryData.fromObject(model).toObject(StorageTargetSpaceAllocation.class);
        Assertions.assertEquals("tkoievseotgq", model.name());
        Assertions.assertEquals(1291535699, model.allocationPercentage());
    }
}
