Table of Contents

Method TryGetArrayOfInt

Namespace
Xunit.Sdk
Assembly
xunit.v3.common.dll

TryGetArrayOfInt(IReadOnlyDictionary<string, object?>, string)

Tries to get an array of int values from a deserialized JSON object. If the value isn't an array, or if any of the values in the array aren't compatible with int, then returns null. Null values in the array are not permitted.

public static int[]? TryGetArrayOfInt(IReadOnlyDictionary<string, object?> obj, string key)

Parameters

obj IReadOnlyDictionary<string, object>

The deserialized JSON object

key string

The key for the value

Returns

int[]

TryGetArrayOfInt(object?)

Tries to get an array of int values from a deserialized JSON value. If the value isn't an array, or if any of the values in the array aren't compatible with int, then returns null. Null values in the array are not permitted.

public static int[]? TryGetArrayOfInt(object? value)

Parameters

value object

The deserialized JSON value

Returns

int[]