Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions JustDummies.UnitTests/JustDummies.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<Compile Remove="AnyModernTypeTests.cs" />
<Compile Remove="CrossEngineReachabilityTests.cs" />
<Compile Remove="ContinuousExclusionNudgeTests.cs" />
<!-- Uses System.Reflection nullability metadata (NullabilityInfoContext, .NET 6+) to read parameter annotations,
which the net472 floor does not carry; the null-argument guards it enforces are themselves netstandard2.0. -->
<Compile Remove="NullArgumentGuardConventionTests.cs" />
</ItemGroup>

</Project>
456 changes: 456 additions & 0 deletions JustDummies.UnitTests/NullArgumentGuardConventionTests.cs

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion JustDummies/Any.cs
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ public static void Reproducibly(int seed, Action body, Action<string>? report =
/// <returns>A task that completes when <paramref name="body" /> completes, and faults with the body's exception.</returns>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="body" /> is <c>null</c>.</exception>
public static Task ReproduciblyAsync(Func<Task> body, Action<string>? report = null) {
if (body is null) { throw new ArgumentNullException(nameof(body)); }

return ReproduciblyAsync(AmbientRandomSource.NewSeed(), body, report);
}

Expand All @@ -562,9 +564,15 @@ public static Task ReproduciblyAsync(Func<Task> body, Action<string>? report = n
/// <param name="report">The sink the seed is written to on failure. Defaults to <see cref="Console.Error" /> when <c>null</c>.</param>
/// <returns>A task that completes when <paramref name="body" /> completes.</returns>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="body" /> is <c>null</c>.</exception>
public static async Task ReproduciblyAsync(int seed, Func<Task> body, Action<string>? report = null) {
public static Task ReproduciblyAsync(int seed, Func<Task> body, Action<string>? report = null) {
if (body is null) { throw new ArgumentNullException(nameof(body)); }

return RunReproduciblyAsync(seed, body, report);
}

// Kept separate from the public entry so the null-argument guard above throws synchronously at the call site,
// rather than being deferred into the returned task's fault — which a caller who forgets to await would miss.
private static async Task RunReproduciblyAsync(int seed, Func<Task> body, Action<string>? report) {
using (AmbientRandomSource.UseSeed(seed)) {
try {
await body().ConfigureAwait(false);
Expand Down
4 changes: 4 additions & 0 deletions JustDummies/AnyArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ public AnyArray<T> Distinct(IEqualityComparer<T> comparer) {
}

private protected override AnyArray<T> With(CollectionState<T> state) {
if (state is null) { throw new ArgumentNullException(nameof(state)); }

return new AnyArray<T>(SourceOrNull, state);
}

private protected override T[] Build(List<T> items) {
if (items is null) { throw new ArgumentNullException(nameof(items)); }

return items.ToArray();
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyBoolean.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public sealed class AnyBoolean : IAny<bool>, IHasRandomSource, ICardinalityHint<
#region Statics members declarations

internal static AnyBoolean Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyBoolean(source, null, null);
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyByte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public sealed class AnyByte : IAny<byte>, IHasRandomSource, ICardinalityHint<byt
#region Statics members declarations

internal static AnyByte Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyByte(source, OrdinalIntervalSpec.Unconstrained("Byte", ordinal => V(Val(ordinal)), Ord(byte.MinValue), Ord(byte.MaxValue)));
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyChar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public sealed class AnyChar : IAny<char>, IHasRandomSource, ICardinalityHint<cha
#region Statics members declarations

internal static AnyChar Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyChar(source, null, null, null, null, null, null, []);
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/// <typeparam name="TItem">The element type.</typeparam>
/// <typeparam name="TResult">The collection type <see cref="Generate" /> produces.</typeparam>
/// <typeparam name="TSelf">The concrete generator type, so the fluent methods return it.</typeparam>
public abstract class AnyCollection<TItem, TResult, TSelf> : IAny<TResult>, IHasRandomSource

Check warning on line 19 in JustDummies/AnyCollection.cs

View workflow job for this annotation

GitHub Actions / SonarQube Cloud analysis

Reduce the number of generic parameters in the 'AnyCollection' class to no more than the 2 authorized.
where TSelf : AnyCollection<TItem, TResult, TSelf> {

#region Fields declarations
Expand All @@ -27,6 +27,8 @@
#endregion

private protected AnyCollection(RandomSource? source, CollectionState<TItem> state) {
if (state is null) { throw new ArgumentNullException(nameof(state)); }

SourceOrNull = source;
State = state;
}
Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyDateOnly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public sealed class AnyDateOnly : IAny<DateOnly>, IHasRandomSource, ICardinality
#region Statics members declarations

internal static AnyDateOnly Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyDateOnly(source, OrdinalIntervalSpec.Unconstrained("DateOnly", ordinal => V(Val(ordinal)), Ord(DateOnly.MinValue), Ord(DateOnly.MaxValue)));
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public sealed class AnyDateTime : IAny<DateTime>, IHasRandomSource, ICardinality
#region Statics members declarations

internal static AnyDateTime Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyDateTime(source, OrdinalIntervalSpec.Unconstrained("DateTime", ordinal => V(Val(ordinal)), Ord(DateTime.MinValue), Ord(DateTime.MaxValue)));
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyDateTimeOffset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#region Statics members declarations

internal static AnyDateTimeOffset Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyDateTimeOffset(source, OrdinalIntervalSpec.Unconstrained("DateTimeOffset", ordinal => V(Val(ordinal)), Ord(DateTimeOffset.MinValue), Ord(DateTimeOffset.MaxValue)), null, false, 0, 0);
}

Expand Down Expand Up @@ -267,7 +269,7 @@
throw new ConflictingAnyConstraintException($"Cannot apply {applying} because an offset constraint is already defined.");
}

// Tighten the instant so local ticks = UtcTicks + offset stay in [0, MaxTicks] for every offset in the range;

Check warning on line 272 in JustDummies/AnyDateTimeOffset.cs

View workflow job for this annotation

GitHub Actions / SonarQube Cloud analysis

Remove this commented out code.
// the offset can then be drawn independently, never producing an out-of-range DateTimeOffset.
long minOffsetTicks = minMinutes * TimeSpan.TicksPerMinute;
long maxOffsetTicks = maxMinutes * TimeSpan.TicksPerMinute;
Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyDecimal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public sealed class AnyDecimal : IAny<decimal>, IHasRandomSource, ICardinalityHi
#region Statics members declarations

internal static AnyDecimal Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyDecimal(source, DecimalIntervalSpec.Unconstrained("Decimal", V));
}

Expand Down
11 changes: 11 additions & 0 deletions JustDummies/AnyDerivation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ internal sealed class DerivedAny<T> : IAny<T>, IHasRandomSource, IReproducibilit
#endregion

internal DerivedAny(RandomSource? source, bool drawsOnlyFromSource, Func<T> generate) {
if (generate is null) { throw new ArgumentNullException(nameof(generate)); }

_source = source;
_drawsOnlyFromSource = drawsOnlyFromSource;
_generate = generate;
Expand All @@ -46,6 +48,8 @@ internal static class AnyDerivation {

/// <summary>The random context of <paramref name="generator" />, when it is one of the library's own.</summary>
internal static RandomSource? SourceOf<T>(IAny<T> generator) {
if (generator is null) { throw new ArgumentNullException(nameof(generator)); }

return (generator as IHasRandomSource)?.Source;
}

Expand All @@ -58,6 +62,8 @@ internal static class AnyDerivation {
/// replayed from that seed.
/// </summary>
internal static bool IsReproducible<T>(IAny<T> generator) {
if (generator is null) { throw new ArgumentNullException(nameof(generator)); }

if (generator is IReproducibilityHint hint) { return hint.DrawsOnlyFromSource; }

return SourceOf(generator) is not null;
Expand All @@ -68,6 +74,8 @@ internal static bool IsReproducible<T>(IAny<T> generator) {
/// advertises one through <see cref="ICardinalityHint{T}" />; <c>null</c> when the domain is unbounded or unknown.
/// </summary>
internal static long? CardinalityOf<T>(IAny<T> generator) {
if (generator is null) { throw new ArgumentNullException(nameof(generator)); }

return (generator as ICardinalityHint<T>)?.DistinctCardinality;
}

Expand All @@ -79,6 +87,9 @@ internal static bool IsReproducible<T>(IAny<T> generator) {
/// promising a full replay the seed cannot deliver. The library's own exceptions pass through untouched.
/// </summary>
internal static T Invoke<T>(Func<T> invoke, RandomSource? source, bool reproducible, string failure) {
if (invoke is null) { throw new ArgumentNullException(nameof(invoke)); }
if (failure is null) { throw new ArgumentNullException(nameof(failure)); }

try {
return invoke();
} catch (AnyException) {
Expand Down
5 changes: 4 additions & 1 deletion JustDummies/AnyDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ public sealed class AnyDictionary<TKey, TValue> : IAny<Dictionary<TKey, TValue>>
#endregion

internal AnyDictionary(RandomSource? source, CollectionState<TKey> keys, IAny<TValue> values)
: this(source, keys, values, NoPinnedValues) { }
: this(source, keys, values, NoPinnedValues) {
if (keys is null) { throw new ArgumentNullException(nameof(keys)); }
if (values is null) { throw new ArgumentNullException(nameof(values)); }
}

private AnyDictionary(RandomSource? source, CollectionState<TKey> keys, IAny<TValue> values, IReadOnlyDictionary<TKey, TValue> pinnedValues) {
_source = source;
Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyDouble.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public sealed class AnyDouble : IAny<double>, IHasRandomSource, ICardinalityHint
#region Statics members declarations

internal static AnyDouble Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyDouble(source, ContinuousIntervalSpec.Unconstrained("Double", V, value => value, ContinuousIntervalSpec.NextUp, -double.MaxValue, double.MaxValue));
}

Expand Down
1 change: 1 addition & 0 deletions JustDummies/AnyEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public sealed class AnyEnum<TEnum> : IAny<TEnum>, IHasRandomSource, ICardinality
private static TEnum[]? _combinations;

internal static AnyEnum<TEnum> Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }
if (Declared.Length == 0) {
throw new AnyGenerationException($"Cannot generate an arbitrary {typeof(TEnum).Name} value because the enum declares no members.");
}
Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyFtpUri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public sealed class AnyFtpUri : IAny<Uri>, IHasRandomSource {
#endregion

internal AnyFtpUri(RandomSource source, UriSpec spec) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }
if (spec is null) { throw new ArgumentNullException(nameof(spec)); }
_source = source;
_spec = spec;
}
Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyGuid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public sealed class AnyGuid : IAny<Guid>, IHasRandomSource, ICardinalityHint<Gui
#region Statics members declarations

internal static AnyGuid Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyGuid(source, null, null, null, null, []);
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyHalf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public sealed class AnyHalf : IAny<Half>, IHasRandomSource, ICardinalityHint<Hal
#region Statics members declarations

internal static AnyHalf Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyHalf(source, ContinuousIntervalSpec.Unconstrained("Half", value => V((Half)value), value => (double)(Half)value, value => NextUp((Half)value), -(double)Half.MaxValue, (double)Half.MaxValue));
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyInt128.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public sealed class AnyInt128 : IAny<Int128>, IHasRandomSource, ICardinalityHint
#region Statics members declarations

internal static AnyInt128 Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyInt128(source, WideIntervalSpec.Unconstrained("Int128", ordinal => V(Val(ordinal)), Ord(Int128.MinValue), Ord(Int128.MaxValue)));
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyInt16.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public sealed class AnyInt16 : IAny<short>, IHasRandomSource, ICardinalityHint<s
#region Statics members declarations

internal static AnyInt16 Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyInt16(source, OrdinalIntervalSpec.Unconstrained("Int16", ordinal => V(Val(ordinal)), Ord(short.MinValue), Ord(short.MaxValue)));
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyInt32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public sealed class AnyInt32 : IAny<int>, IHasRandomSource, ICardinalityHint<int
#region Statics members declarations

internal static AnyInt32 Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyInt32(source, OrdinalIntervalSpec.Unconstrained("Int32", ordinal => V(Val(ordinal)), Ord(int.MinValue), Ord(int.MaxValue)));
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyInt64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public sealed class AnyInt64 : IAny<long>, IHasRandomSource, ICardinalityHint<lo
#region Statics members declarations

internal static AnyInt64 Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnyInt64(source, OrdinalIntervalSpec.Unconstrained("Int64", ordinal => V(Val(ordinal)), Ord(long.MinValue), Ord(long.MaxValue)));
}

Expand Down
4 changes: 4 additions & 0 deletions JustDummies/AnyList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ public AnyList<T> Distinct(IEqualityComparer<T> comparer) {
}

private protected override AnyList<T> With(CollectionState<T> state) {
if (state is null) { throw new ArgumentNullException(nameof(state)); }

return new AnyList<T>(SourceOrNull, state);
}

private protected override List<T> Build(List<T> items) {
if (items is null) { throw new ArgumentNullException(nameof(items)); }

return items;
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyMailtoUri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public sealed class AnyMailtoUri : IAny<Uri>, IHasRandomSource {
#endregion

internal AnyMailtoUri(RandomSource source, UriSpec spec) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }
if (spec is null) { throw new ArgumentNullException(nameof(spec)); }
_source = source;
_spec = spec;
}
Expand Down
7 changes: 5 additions & 2 deletions JustDummies/AnyOneOf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ public sealed class AnyOneOf<T> : IAny<T>, IHasRandomSource, ICardinalityHint<T>

#region Statics members declarations

// Validates and deduplicates the caller's pool, then builds the generator. The array-null check belongs to the
// public factories (they own the parameter name); by the time we get here the pool is non-null and materialized.
// Validates and deduplicates the caller's pool, then builds the generator. As an internal boundary it guards its
// own arguments per the null-argument convention (ADR-0045); the public factories additionally reject a null
// array first, under the caller-facing parameter name, before delegating here.
internal static AnyOneOf<T> FromPool(RandomSource source, IReadOnlyList<T> values) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }
if (values is null) { throw new ArgumentNullException(nameof(values)); }
if (values.Count == 0) { throw new ArgumentException("At least one value is required.", nameof(values)); }
if (values.Any(value => value is null)) { throw new ArgumentException("The values must not contain a null element; use OrNull() to make the whole generator nullable.", nameof(values)); }

Expand Down
4 changes: 4 additions & 0 deletions JustDummies/AnyPattern.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public sealed class AnyPattern : IAny<string>, IHasRandomSource {
private const int GenerationLimit = 65536;

internal static AnyPattern FromPattern(RandomSource source, string pattern, bool ignoreCase) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }
if (pattern is null) { throw new ArgumentNullException(nameof(pattern)); }
return new AnyPattern(source, RegexParser.Parse(pattern, ignoreCase));
}

Expand All @@ -49,6 +51,8 @@ internal static AnyPattern FromPattern(RandomSource source, string pattern, bool
#endregion

internal AnyPattern(RandomSource source, RegexNode root) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }
if (root is null) { throw new ArgumentNullException(nameof(root)); }
_source = source;
_root = root;
}
Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyRelativeUri.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public sealed class AnyRelativeUri : IAny<Uri>, IHasRandomSource {
#endregion

internal AnyRelativeUri(RandomSource source, UriSpec spec) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }
if (spec is null) { throw new ArgumentNullException(nameof(spec)); }
_source = source;
_spec = spec;
}
Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnySByte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public sealed class AnySByte : IAny<sbyte>, IHasRandomSource, ICardinalityHint<s
#region Statics members declarations

internal static AnySByte Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnySByte(source, OrdinalIntervalSpec.Unconstrained("SByte", ordinal => V(Val(ordinal)), Ord(sbyte.MinValue), Ord(sbyte.MaxValue)));
}

Expand Down
4 changes: 4 additions & 0 deletions JustDummies/AnySequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ public AnySequence<T> Distinct(IEqualityComparer<T> comparer) {
}

private protected override AnySequence<T> With(CollectionState<T> state) {
if (state is null) { throw new ArgumentNullException(nameof(state)); }

return new AnySequence<T>(SourceOrNull, state);
}

private protected override IEnumerable<T> Build(List<T> items) {
if (items is null) { throw new ArgumentNullException(nameof(items)); }

return items;
}

Expand Down
4 changes: 4 additions & 0 deletions JustDummies/AnySet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ public sealed class AnySet<T> : AnyCollection<T, HashSet<T>, AnySet<T>> {
internal AnySet(RandomSource? source, CollectionState<T> state) : base(source, state) { }

private protected override AnySet<T> With(CollectionState<T> state) {
if (state is null) { throw new ArgumentNullException(nameof(state)); }

return new AnySet<T>(SourceOrNull, state);
}

private protected override HashSet<T> Build(List<T> items) {
if (items is null) { throw new ArgumentNullException(nameof(items)); }

// The state already deduplicated under the comparer; the set carries the same comparer so later lookups
// by the caller behave identically.
return new HashSet<T>(items, State.Comparer);
Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnySingle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public sealed class AnySingle : IAny<float>, IHasRandomSource, ICardinalityHint<
#region Statics members declarations

internal static AnySingle Create(RandomSource source) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }

return new AnySingle(source, ContinuousIntervalSpec.Unconstrained("Single", value => V((float)value), value => (float)value, value => NextUp((float)value), -float.MaxValue, float.MaxValue));
}

Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
return string.Join(", ", values.Select(value => $"\"{value}\""));
}

private static string RequireText(string value, string parameterName) {

Check warning on line 49 in JustDummies/AnyString.cs

View workflow job for this annotation

GitHub Actions / SonarQube Cloud analysis

Change return type to 'void'; not a single caller uses the returned value.
if (value is null) { throw new ArgumentNullException(parameterName); }
if (value.Length == 0) { throw new ArgumentException("The value must not be empty.", parameterName); }

Expand All @@ -69,6 +69,8 @@
#endregion

internal AnyString(RandomSource source, StringSpec spec) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }
if (spec is null) { throw new ArgumentNullException(nameof(spec)); }
_source = source;
_spec = spec;
}
Expand Down
2 changes: 2 additions & 0 deletions JustDummies/AnyStringOneOf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public sealed class AnyStringOneOf : IAny<string>, IHasRandomSource, ICardinalit
#endregion

internal AnyStringOneOf(RandomSource source, IReadOnlyList<string> values) {
if (source is null) { throw new ArgumentNullException(nameof(source)); }
if (values is null) { throw new ArgumentNullException(nameof(values)); }
_source = source;
_values = values;
}
Expand Down
Loading
Loading