-
Notifications
You must be signed in to change notification settings - Fork 765
Closed
Labels
Milestone
Description
Currently the following code is not possible:
var actual = new[] { 3, 2, 1 };
Assert.That(actual, Is.EquivalentTo([1, 2, 3]));
// CS9174 Cannot initialize type 'IEnumerable' with a collection expression because the type is not constructible.I suggest to add IEnumerable<T> overloads for all constraint methods, which currently accept non-generic IEnumerable:
public static CollectionEquivalentConstraint EquivalentTo<T>(IEnumerable<T> expected)
{
return new CollectionEquivalentConstraint(expected);
}
public static CollectionSubsetConstraint SubsetOf<T>(IEnumerable<T> expected)
{
return new CollectionSubsetConstraint(expected);
}
// etcNote: it is partially related to #53, but tackles a very specific issue of using collection expressions.
Reactions are currently unavailable