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

package com.azure.resourcemanager.devhub.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devhub.models.WorkflowRun;
import com.azure.resourcemanager.devhub.models.WorkflowRunStatus;
import org.junit.jupiter.api.Assertions;

public final class WorkflowRunTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkflowRun model =
            BinaryData
                .fromString(
                    "{\"succeeded\":true,\"workflowRunURL\":\"fcyddg\",\"lastRunAt\":\"2021-08-14T20:27:10Z\",\"workflowRunStatus\":\"inprogress\"}")
                .toObject(WorkflowRun.class);
        Assertions.assertEquals(WorkflowRunStatus.INPROGRESS, model.workflowRunStatus());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkflowRun model = new WorkflowRun().withWorkflowRunStatus(WorkflowRunStatus.INPROGRESS);
        model = BinaryData.fromObject(model).toObject(WorkflowRun.class);
        Assertions.assertEquals(WorkflowRunStatus.INPROGRESS, model.workflowRunStatus());
    }
}
