Skip to content

Unit tests#45

Merged
vampi62 merged 9 commits intomainfrom
unitTest
Dec 5, 2025
Merged

Unit tests#45
vampi62 merged 9 commits intomainfrom
unitTest

Conversation

@vampi62
Copy link
Owner

@vampi62 vampi62 commented Nov 22, 2025

This pull request significantly expands and refactors the test coverage for the electrostore API.

Introduces a TestBase class to centralize test setup for in-memory database and AutoMapper configuration.
Introduced unit tests for BoxTagService, ItemTagService, StoreTagService, and TagService, covering CRUD operations and bulk actions.
Refactored CameraService and ConfigService to use IHttpClientFactory for HTTP requests and updated their constructors for dependency injection. Improved SmtpService to support easier testing and added SendMailAsync to the interface.
Added unit tests for SessionService and SmtpService, including a new HttpContextAccessorMockFactory utility for test setup. Enhanced TagServiceTests for null safety and expanded ProgramTests with Swagger and authentication-related tests.
Introduces IJwtService interface and updates JwtService to implement it with async token generation. Refactors AuthService to depend on IJwtService. Updates dependency injection registration and adds comprehensive unit tests for AuthService and ConfigService.
Introduces comprehensive unit tests for FileService and JwiService, covering file operations (S3/local), thumbnail generation, directory management, and JWT/session management. Also fixes token revocation logic in JwiService to consider expiration, and corrects parameter usage in FileService thumbnail generation.
unit tests for CommandCommentaireService, CommandItemService, CommandService, ItemBoxService, and ProjetService.
unit tests for ProjetCommentaireService, ProjetItemService, ProjetProjetTagService, ProjetStatusService, and ProjetTagService.
Introduces unit tests API controllers
Added unit tests for validators and for ExceptionsHandler middleware to verify correct HTTP status codes and logging behavior for various exception types. Updated IAService to use IHttpClientFactory for HTTP client creation, improving testability.
@vampi62 vampi62 merged commit 2e89b96 into main Dec 5, 2025
1 check passed
@vampi62 vampi62 deleted the unitTest branch December 5, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant