frasermclean / adoptrix

Pet adoption centre platform
https://demo.adoptrix.com
MIT License
1 stars 0 forks source link

EF Core exception handling #100

Closed frasermclean closed 1 month ago

frasermclean commented 1 month ago

Make use of EntityFrameworkCore.Exceptions.SqlServer package to gracefully handle EF Core exceptions.

github-actions[bot] commented 1 month ago

Solution test results

74 tests  +1   74 :white_check_mark: +1   12s :stopwatch: +2s  6 suites ±0    0 :zzz: ±0   6 files   ±0    0 :x: ±0 

Results for commit b3339a6e. ± Comparison against base commit 2645d8fa.

This pull request removes 3 and adds 4 tests. Note that renamed tests count towards both. ``` Adoptrix.Jobs.Tests.Functions.CleanupDeletedAnimalTests ‑ ExecuteAsync_WithValidEventData_ShouldPass(eventData: AnimalDeletedEvent { AnimalSlug = AnimalSluged140f74-67df-49a3-b35e-893723e64b5d }, animalImagesManagerMock: Mock, function: CleanupDeletedAnimal { }) Adoptrix.Jobs.Tests.Functions.ProcessAnimalImageTests ‑ ExecuteAsync_WithInvalidAnimalSlug_ShouldThrowException(data: AnimalImageAddedEvent { AnimalSlug = AnimalSluga12bd5b0-6239-4c37-a23c-8c4de1ed6231, ImageId = 49b41853-5cd0-4908-b688-cd86d4c4573e, BlobName = BlobNamed20f847d-d8c0-4de8-a4fa-51829a3c0db9 }, animalImagesManagerMock: Mock, function: ProcessAnimalImage { }) Adoptrix.Jobs.Tests.Functions.ProcessAnimalImageTests ‑ ExecuteAsync_WithValidEventData_ShouldPass(data: AnimalImageAddedEvent { AnimalSlug = AnimalSluga07b0306-48d5-4167-86ba-c1ab4ea6660b, ImageId = 0e708d89-fca5-45e5-9a7e-03437f41e651, BlobName = BlobNamea830aca5-e214-40dc-954d-6cbe7632ad21 }, animalImagesManagerMock: Mock, function: ProcessAnimalImage { }) ``` ``` Adoptrix.Api.Tests.Endpoints.Breeds.UpdateBreedEndpointTests ‑ UpdateBreed_WithExistingBreed_ShouldReturnConflict Adoptrix.Jobs.Tests.Functions.CleanupDeletedAnimalTests ‑ ExecuteAsync_WithValidEventData_ShouldPass(eventData: AnimalDeletedEvent { AnimalSlug = AnimalSlugf5295e07-f515-46b0-8a81-32623a5a69b6 }, animalImagesManagerMock: Mock, function: CleanupDeletedAnimal { }) Adoptrix.Jobs.Tests.Functions.ProcessAnimalImageTests ‑ ExecuteAsync_WithInvalidAnimalSlug_ShouldThrowException(data: AnimalImageAddedEvent { AnimalSlug = AnimalSlug46314b48-623c-4868-b003-406a7cf31029, ImageId = 95d9980d-6a53-45ad-9143-ce3d6af1e1b5, BlobName = BlobNamed128ac9e-db41-47c2-8284-511cca12fcc8 }, animalImagesManagerMock: Mock, function: ProcessAnimalImage { }) Adoptrix.Jobs.Tests.Functions.ProcessAnimalImageTests ‑ ExecuteAsync_WithValidEventData_ShouldPass(data: AnimalImageAddedEvent { AnimalSlug = AnimalSlug8c032604-ba76-4cf7-b46b-6bdc9a2af204, ImageId = 416eb4b5-b1d0-4dd3-8a96-9739f3642340, BlobName = BlobName799236de-b4da-438f-b71a-96ca76b800f4 }, animalImagesManagerMock: Mock, function: ProcessAnimalImage { }) ```
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.70%. Comparing base (2645d8f) to head (b3339a6). Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...optrix.Persistence/Services/ServiceRegistration.cs 71.42% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #100 +/- ## ========================================== + Coverage 73.58% 73.70% +0.12% ========================================== Files 119 119 Lines 1533 1544 +11 Branches 96 97 +1 ========================================== + Hits 1128 1138 +10 - Misses 384 385 +1 Partials 21 21 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.