MockExtensions
public static class MockExtensionsConvenience helpers that let generated values become null /default with a tunable probability, plus small IList/IReadOnlyList helpers ( PickRandom , Shuffle ).
Methods
Section titled “Methods”
OrNull(T, float)
Section titled “OrNull(T, float)”public static T OrNull<T>(this T value, float nullProbability = 0.3) where T : classNo description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
value |
{T} | |
nullProbability |
System.Single |
Returns
{T} — No return description is available.
OrNullable(T, float)
Section titled “OrNullable(T, float)”public static T? OrNullable<T>(this T value, float nullProbability = 0.3) where T : structNo description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
value |
{T} | |
nullProbability |
System.Single |
Returns
System.Nullable{{T}} — No return description is available.
OrDefault(T, float)
Section titled “OrDefault(T, float)”public static T OrDefault<T>(this T value, float defaultProbability = 0.3)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
value |
{T} | |
defaultProbability |
System.Single |
Returns
{T} — No return description is available.
PickRandom(IReadOnlyList)
Section titled “PickRandom(IReadOnlyList)”public static T PickRandom<T>(this IReadOnlyList<T> items)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
items |
System.Collections.Generic.IReadOnlyList{{T}} |
Returns
{T} — No return description is available.
Shuffle(IList)
Section titled “Shuffle(IList)”public static void Shuffle<T>(this IList<T> items)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
items |
System.Collections.Generic.IList{{T}} |