Closed natehitze closed 2 years ago
Hello @natehitze. Thank you for your feedback. I'm glad to see so impressive performance improvement. And your benchmark looks very processing. But we also need to take in to account real use cases, and make sure that that it works for test scenarios and for all mock frameworks.
If we can use TestAsyncEnumerableEfCore<T>
instead of BuildMock()
may I ask you just update existing unit tests in MockQueryable.Sample
(as an option you can just change implementation of BuildMock
extensions with your approach).
If will not be any side effects of usage TestAsyncEnumerableEfCore<T>
and all tests will be green, I would be happy to include merge your pull request to the repository and update all nuget packages. In this case we even don't need to update documentation. I will also add a special thanks for you to release notes.
Thanks! I did add a little bit to the README since I'm not sure I explained it very well in this issue but hopefully that change along with the PR description makes more sense.
Thanks @natehitze for the PR but I expected a bit different changes. In spite of this I will include special thanks for you in the next release notes (release 5.0.2). Based on your suggestion I've made own PR #57 (it takes into account backward compatibility and tested by all existing changes). Unfortunately I cannot merge it to the repo. Thanks for your contribution!
For simple usage with no customization to the
IQueryable<T>
mock (such as the "How do I get started" example in the readme) there is no need for a mocking framework to be involved. UsingTestAsyncEnumerableEfCore<T>
directly is almost 1000x faster which was a very easy performance win for me :). My small test suite is about 15% faster now.This issue is to request documenting
TestAsyncEnumerableEfCore<T>
in the readme. I would be happy to write it and submit a PR if that would be acceptable.Thank you for this package!
Here's the benchmark I used and its results: