Skip to content

CollectionBuilderAttribute not considered for "default empty" #1565

@znakeeye

Description

@znakeeye

See #173. I think we should allow "default empty" for custom collections too. Moq should consider the CollectionBuilder attribute. That way, changing e.g.:

IEnumerable<T> Foo { get; }

to

IMyCollection<T> Foo { get; }

will not necessarily break unit tests - if you added the necessary attributes:

[CollectionBuilder(typeof(MyCollectionBuilder), nameof(MyCollectionBuilder.Create))]
public interface IMyCollection<out T> : IReadOnlyCollection<T>
{
}

Back this issue
Back this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions