-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Description
Standardize exception testing across all test files to use consistent NUnit patterns and improve test reliability.
Phase
Phase 0: Test Technical Debt Cleanup
Epic
Related to #202
Acceptance Criteria
- Audit all exception testing patterns in test files
- Standardize on
Assert.Throws<T>()pattern - Ensure exception messages are validated where appropriate
- Remove inconsistent exception testing approaches
- Add missing exception tests for edge cases
Current Inconsistencies
- Mix of
Assert.Throws,try-catchblocks, andExpectedExceptionattributes - Inconsistent validation of exception messages
- Some tests only check exception type, not message content
Preferred Pattern
// PREFERRED: Modern NUnit pattern
var ex = Assert.Throws<ArgumentNullException>(() => database.AddVector(null));
Assert.That(ex.ParamName, Is.EqualTo("vector"));
// PREFERRED: For async methods
var ex = Assert.ThrowsAsync<ArgumentOutOfRangeException>(async () =>
await database.SearchAsync(query, -1));
Assert.That(ex.Message, Contains.Substring("k must be positive"));Files to Review
- All test files with exception testing
- Focus on argument validation tests
- Search algorithm parameter validation
- Database operation error conditions