You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since AutoFixture can already supply non-empty collections, and one of the constructor overloads for SortedSet<T> takes a IEnumerable<T>, it ought to be fairly easy to add a relay from SortedSet<T> to IEnumerable<T>.
The implementation could for example be a new ISpecimenBuilder that handles requests for any SortedSet<T> by resolving IEnumerable<T> from the context, and then invoking the appropriate constructor overload with the returned value.
Another implementation option is to mimic the way hash sets are already filled. See the combination of EnumerableFavoringConstructorQuery and HashSetSpecification in the Fixture class.
The text was updated successfully, but these errors were encountered:
When you ask AutoFixture for a hash set, it provides a non-empty value:
When you request a sorted set, on the other hand, the returned set is empty. This test fails its assertion:
Since AutoFixture can already supply non-empty collections, and one of the constructor overloads for
SortedSet<T>
takes aIEnumerable<T>
, it ought to be fairly easy to add a relay fromSortedSet<T>
toIEnumerable<T>
.The implementation could for example be a new
ISpecimenBuilder
that handles requests for anySortedSet<T>
by resolvingIEnumerable<T>
from thecontext
, and then invoking the appropriate constructor overload with the returned value.Another implementation option is to mimic the way hash sets are already filled. See the combination of
EnumerableFavoringConstructorQuery
andHashSetSpecification
in theFixture
class.The text was updated successfully, but these errors were encountered: