I am not trying unit test EF, but my business logic.
if (_context.GetValidationErrors.Count > 0) { foreach (DbEntityValidationResult validationResult in _context.ValidationErrors) { foreach (DbValidationError error in validationResult.ValidationErrors) {
I use Mock in my unit tests. I can easily make fun of the number of validation errors, but mocking the lists in foreach loops really puzzles me. I would like to be able to mock loops for the sake of code coverage.
source share