Summary
The SettingsManager tests exist but are incomplete — they test serialization in isolation and bypass the file system. There is no test covering the full save → load round-trip, and the ICryptographyService mock does not assert that keys are actually encrypted before being written to disk.
What needs to be done
- Full round-trip test:
Save(settings) → read file → Load() → assert values match
- Verify encrypted file: file on disk must not contain plain-text API key string
- Verify that
Load() on a missing file returns default settings (no exception)
- Verify that
Load() on a corrupted file returns default settings and logs an error
- Verify that
Save() uses ICryptographyService.Encrypt for credential fields
- Test
ExchangeCredential add/remove/set-active flows
Acceptance criteria
References
src/Omnijure.Core/Features/Settings/
tests/Omnijure.Core.Tests/SettingsManagerTests.cs
Summary
The
SettingsManagertests exist but are incomplete — they test serialization in isolation and bypass the file system. There is no test covering the full save → load round-trip, and theICryptographyServicemock does not assert that keys are actually encrypted before being written to disk.What needs to be done
Save(settings)→ read file →Load()→ assert values matchLoad()on a missing file returns default settings (no exception)Load()on a corrupted file returns default settings and logs an errorSave()usesICryptographyService.Encryptfor credential fieldsExchangeCredentialadd/remove/set-active flowsAcceptance criteria
DisposeReferences
src/Omnijure.Core/Features/Settings/tests/Omnijure.Core.Tests/SettingsManagerTests.cs