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

package com.azure.resourcemanager.appcontainers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appcontainers.models.TrafficWeight;
import org.junit.jupiter.api.Assertions;

public final class TrafficWeightTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TrafficWeight model =
            BinaryData
                .fromString(
                    "{\"revisionName\":\"cpdggkzzlvmbmp\",\"weight\":2116317811,\"latestRevision\":false,\"label\":\"vuefywsbpfvmwyh\"}")
                .toObject(TrafficWeight.class);
        Assertions.assertEquals("cpdggkzzlvmbmp", model.revisionName());
        Assertions.assertEquals(2116317811, model.weight());
        Assertions.assertEquals(false, model.latestRevision());
        Assertions.assertEquals("vuefywsbpfvmwyh", model.label());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TrafficWeight model =
            new TrafficWeight()
                .withRevisionName("cpdggkzzlvmbmp")
                .withWeight(2116317811)
                .withLatestRevision(false)
                .withLabel("vuefywsbpfvmwyh");
        model = BinaryData.fromObject(model).toObject(TrafficWeight.class);
        Assertions.assertEquals("cpdggkzzlvmbmp", model.revisionName());
        Assertions.assertEquals(2116317811, model.weight());
        Assertions.assertEquals(false, model.latestRevision());
        Assertions.assertEquals("vuefywsbpfvmwyh", model.label());
    }
}
