/// <summary> /// Verifies that <paramref name="maybe"/> is NOT empty and contains /// <paramref name="expected"/>. /// </summary> public static void Some <T>([DisallowNull] T expected, Maybe <T> maybe) { False(maybe.IsNone, "The maybe should not be empty."); #if VISIBLE_INTERNALS True(maybe.IsSome, "The maybe should not be empty."); // BONSANG! When IsSome is true, Value is NOT null. Equal(expected, maybe.Value !); #else if (maybe.TryGetValue(out T? value)) { Equal(expected, value); } else { Failure("The maybe should not be empty."); } #endif #if !PATCH_EQUALITY NotEqual(Maybe <T> .None, maybe); #endif // We also test Contains(). True(maybe.Contains(expected)); }