Repository navigation
Unit Tests
Alessio Di Salvo edited this page Oct 30, 2026
·
4 revisions
The ModularNet.UnitTests project verifies ModularNet.Business managers in isolation using xUnit and Moq.
For mandatory test naming conventions and helper rules, see Coding Standards — Section 4 (Tests).
-
Test Classes:
-
UsersManagerTests.cs: Tests user registration, transaction-coordinated login, and retrieval inUsersManager. -
UsersSettingsManagerTests.cs: Tests user settings caching, retrieval, and transaction-coordinated batch updates. -
UnitOfWorkTests.cs: Tests transaction coordination delegation toIDbConnectionFactory. -
DbConnectionFactoryTests.cs: Tests scoped connection lifecycle, transaction begin, commit, rollback, and disposal inDbConnectionFactory. -
CacheManagerTests.cs: Tests in-memory and Redis cache routing inCacheManager. -
EncryptManagerTests.cs: Tests AES encryption/decryption, hashing, and verification codes inEncryptManager.
-
-
Test Data Helpers (
Helpers/):-
UsersHelper.GetUser(): Returns a populatedUserinstance so tests only override properties relevant to the case under test. -
UserSettingsHelper: Returns populatedUserSetting,UserSettingDto, andCreateOrUpdateUserSettingsRequestinstances. -
AppSettingsHelper.GetAppSettings(): Returns a populatedAppSettingsinstance for unit tests.
-