huysentruitw / entity-framework-core-mock

Easy Mock wrapper for mocking EFCore5 DbContext and DbSet using Moq or NSubstitute
MIT License
132 stars 24 forks source link

Find behavior on missing element #10

Closed GeneratedNickname closed 5 years ago

GeneratedNickname commented 5 years ago

Find does not return null if the key is not found, but throws a System.Collections.Generic.KeyNotFoundException.

The documentation of DbSet states:

If no entity is found, then null is returned.

huysentruitw commented 5 years ago

True, will fix right away! Thanks for bringing this up.

huysentruitw commented 5 years ago

This problem should be fixed by now. Please re-open if there are still some issues.