Method TryGetArrayOfEnum
- Namespace
- Xunit.Sdk
- Assembly
- xunit.v3.common.dll
TryGetArrayOfEnum<TEnum>(IReadOnlyDictionary<string, object?>, string)
Tries to get an array of TEnum 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 TEnum, then returns null.
Null values in the array are not permitted.
public static TEnum[]? TryGetArrayOfEnum<TEnum>(IReadOnlyDictionary<string, object?> obj, string key) where TEnum : struct, Enum
Parameters
objIReadOnlyDictionary<string, object>The deserialized JSON object
keystringThe key for the value
Returns
- TEnum[]
Type Parameters
TEnum
TryGetArrayOfEnum<TEnum>(object?)
Tries to get an array of TEnum 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 TEnum, then returns null.
Null values in the array are not permitted.
public static TEnum[]? TryGetArrayOfEnum<TEnum>(object? value) where TEnum : struct, Enum
Parameters
valueobjectThe deserialized JSON value
Returns
- TEnum[]
Type Parameters
TEnum