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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.ConnectionCategory;
import com.azure.resourcemanager.machinelearning.models.NoneAuthTypeWorkspaceConnectionProperties;
import com.azure.resourcemanager.machinelearning.models.ValueFormat;
import org.junit.jupiter.api.Assertions;

public final class NoneAuthTypeWorkspaceConnectionPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NoneAuthTypeWorkspaceConnectionProperties model =
            BinaryData
                .fromString(
                    "{\"authType\":\"None\",\"category\":\"Git\",\"target\":\"lazipbhpwvq\",\"value\":\"ny\",\"valueFormat\":\"JSON\"}")
                .toObject(NoneAuthTypeWorkspaceConnectionProperties.class);
        Assertions.assertEquals(ConnectionCategory.GIT, model.category());
        Assertions.assertEquals("lazipbhpwvq", model.target());
        Assertions.assertEquals("ny", model.value());
        Assertions.assertEquals(ValueFormat.JSON, model.valueFormat());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NoneAuthTypeWorkspaceConnectionProperties model =
            new NoneAuthTypeWorkspaceConnectionProperties()
                .withCategory(ConnectionCategory.GIT)
                .withTarget("lazipbhpwvq")
                .withValue("ny")
                .withValueFormat(ValueFormat.JSON);
        model = BinaryData.fromObject(model).toObject(NoneAuthTypeWorkspaceConnectionProperties.class);
        Assertions.assertEquals(ConnectionCategory.GIT, model.category());
        Assertions.assertEquals("lazipbhpwvq", model.target());
        Assertions.assertEquals("ny", model.value());
        Assertions.assertEquals(ValueFormat.JSON, model.valueFormat());
    }
}
