Last active
December 27, 2018 04:30
-
-
Save csharpforevermore/ebb49d0fa21839da2617d1ddead204ff to your computer and use it in GitHub Desktop.
Does A contain all items of B? When A = actual, B = expected. Both are lists because they implement IEnumerable and so work with LINQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Code { | |
public static bool ContainsAll<T>(this IEnumerable<T> actual, IEnumerable<T> expected) { | |
return actual.All(a => expected.Contains(a)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment