// 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.fluent.models.SoftwareInner;
import com.azure.resourcemanager.security.models.EndOfSupportStatus;
import org.junit.jupiter.api.Assertions;

public final class SoftwareInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SoftwareInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"deviceId\":\"gm\",\"osPlatform\":\"fjlrxwtoauk\",\"vendor\":\"kvci\",\"softwareName\":\"zmoaeds\",\"version\":\"wuived\",\"endOfSupportStatus\":\"noLongerSupported\",\"endOfSupportDate\":\"eewxeiqbpsmg\",\"numberOfKnownVulnerabilities\":1437777352,\"firstSeenAt\":\"amljdlrgmsplzgau\"},\"id\":\"cshhv\",\"name\":\"ewgnxkympqanxrj\",\"type\":\"ixt\"}")
                .toObject(SoftwareInner.class);
        Assertions.assertEquals("gm", model.deviceId());
        Assertions.assertEquals("fjlrxwtoauk", model.osPlatform());
        Assertions.assertEquals("kvci", model.vendor());
        Assertions.assertEquals("zmoaeds", model.softwareName());
        Assertions.assertEquals("wuived", model.version());
        Assertions.assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, model.endOfSupportStatus());
        Assertions.assertEquals("eewxeiqbpsmg", model.endOfSupportDate());
        Assertions.assertEquals(1437777352, model.numberOfKnownVulnerabilities());
        Assertions.assertEquals("amljdlrgmsplzgau", model.firstSeenAt());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SoftwareInner model =
            new SoftwareInner()
                .withDeviceId("gm")
                .withOsPlatform("fjlrxwtoauk")
                .withVendor("kvci")
                .withSoftwareName("zmoaeds")
                .withVersion("wuived")
                .withEndOfSupportStatus(EndOfSupportStatus.NO_LONGER_SUPPORTED)
                .withEndOfSupportDate("eewxeiqbpsmg")
                .withNumberOfKnownVulnerabilities(1437777352)
                .withFirstSeenAt("amljdlrgmsplzgau");
        model = BinaryData.fromObject(model).toObject(SoftwareInner.class);
        Assertions.assertEquals("gm", model.deviceId());
        Assertions.assertEquals("fjlrxwtoauk", model.osPlatform());
        Assertions.assertEquals("kvci", model.vendor());
        Assertions.assertEquals("zmoaeds", model.softwareName());
        Assertions.assertEquals("wuived", model.version());
        Assertions.assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, model.endOfSupportStatus());
        Assertions.assertEquals("eewxeiqbpsmg", model.endOfSupportDate());
        Assertions.assertEquals(1437777352, model.numberOfKnownVulnerabilities());
        Assertions.assertEquals("amljdlrgmsplzgau", model.firstSeenAt());
    }
}
