romantitov / MockQueryable

Mocking Entity Framework Core operations such ToListAsync, FirstOrDefaultAsync etc
MIT License
767 stars 74 forks source link

Breaking change with 7.0.2 namespacing? #79

Closed StevePy closed 3 weeks ago

StevePy commented 3 weeks ago

Updating from 7.0.1 to 7.0.2 caused a breaking change with the namespacing for BuildMock(this IEnumerable[]). The BuildMock() method was no longer resolvable. I suspect that originally this class was using a default global namespace as in 7.0.1 I did not need a using statement to access the BuildMock extension method, but now I need a namespace using for MockQueryable.EntityFrameworkCore to access the BuildMock method, which I suspect may be a bug as Mocking IEnumerable shouldn't be limited to EFCore. (Issue introduced merging support for mocking DbSet?)

Ideally can this be fixed to avoid the need for adding a namespace requirement for the default BuildMock call? Otherwise caution needed when doing what appear to be revision releases n.0.x that contain breaking changes. Reverting to 7.0,1 for the time being.

romantitov commented 3 weeks ago

Hi @StevePy. Thanks for your feedback. The change was requested in #77. Feel free to comment/reopen that issue, if in your opinion, this is a bug but not a feature. If you additionally provide a pull request with fix of the issue I would be happy to include it to the next release. I'm closing this issue to avoid duplication.