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

package com.azure.resourcemanager.elastic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.elastic.models.FilteringTag;
import com.azure.resourcemanager.elastic.models.TagAction;
import org.junit.jupiter.api.Assertions;

public final class FilteringTagTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FilteringTag model =
            BinaryData
                .fromString("{\"name\":\"r\",\"value\":\"djwzrlov\",\"action\":\"Exclude\"}")
                .toObject(FilteringTag.class);
        Assertions.assertEquals("r", model.name());
        Assertions.assertEquals("djwzrlov", model.value());
        Assertions.assertEquals(TagAction.EXCLUDE, model.action());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FilteringTag model = new FilteringTag().withName("r").withValue("djwzrlov").withAction(TagAction.EXCLUDE);
        model = BinaryData.fromObject(model).toObject(FilteringTag.class);
        Assertions.assertEquals("r", model.name());
        Assertions.assertEquals("djwzrlov", model.value());
        Assertions.assertEquals(TagAction.EXCLUDE, model.action());
    }
}
