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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.models.Baseline;
import java.time.OffsetDateTime;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class BaselineTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Baseline model =
            BinaryData
                .fromString(
                    "{\"expectedResults\":[[\"g\",\"uuj\"],[\"uhd\",\"wsigrbjbxsj\",\"bvitvqkjya\"],[\"umtggmuwdchozfn\"],[\"exlvxnoakiz\"]],\"updatedTime\":\"2021-02-16T18:23:50Z\"}")
                .toObject(Baseline.class);
        Assertions.assertEquals("g", model.expectedResults().get(0).get(0));
        Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T18:23:50Z"), model.updatedTime());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Baseline model =
            new Baseline()
                .withExpectedResults(
                    Arrays
                        .asList(
                            Arrays.asList("g", "uuj"),
                            Arrays.asList("uhd", "wsigrbjbxsj", "bvitvqkjya"),
                            Arrays.asList("umtggmuwdchozfn"),
                            Arrays.asList("exlvxnoakiz")))
                .withUpdatedTime(OffsetDateTime.parse("2021-02-16T18:23:50Z"));
        model = BinaryData.fromObject(model).toObject(Baseline.class);
        Assertions.assertEquals("g", model.expectedResults().get(0).get(0));
        Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T18:23:50Z"), model.updatedTime());
    }
}
