// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using FakeItEasy; namespace Squidex.Domain.Apps.Core.TestHelpers { public static class AExtensions { public static T[] Is(this INegatableArgumentConstraintManager that, params T[]? values) { return values == null ? that.IsNull() : that.IsSameSequenceAs(values); } public static IEnumerable Is(this INegatableArgumentConstraintManager> that, params T[]? values) { return values == null ? that.IsNull() : that.IsSameSequenceAs(values); } public static HashSet Is(this INegatableArgumentConstraintManager> that, IEnumerable? values) { return values == null ? that.IsNull() : that.Matches(x => x.Intersect(values).Count() == values.Count()); } public static HashSet Is(this INegatableArgumentConstraintManager> that, params T[]? values) { return values == null ? that.IsNull() : that.Matches(x => x.Intersect(values).Count() == values.Length); } } }