Skip to content

Add comprehensive test cases to improve test coverage#93

Draft
Copilot wants to merge 1 commit into
developfrom
copilot/analyze-test-coverage-improve-tests
Draft

Add comprehensive test cases to improve test coverage#93
Copilot wants to merge 1 commit into
developfrom
copilot/analyze-test-coverage-improve-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Summary

Analyzed test coverage across the codebase and added 56 new tests across 5 test files to cover previously untested public APIs.

Coverage Analysis

Project Before After
Util 2 test files (10 tests) 4 test files (21 tests)
MetaData 14 test files (109 tests) 17 test files (147 tests)
Thread 6 test files (38 tests) No change
MetaDataDB 10 test files (51 tests) No change

New Test Files

Util/Tests/AsyncExtTests.cs (5 tests)

Tests for ForEachAsync extension method: empty collection, single item, multiple items, transformation, sequential execution.

Util/Tests/EnumerableExtTests.cs (6 tests)

Tests for OrderRandom extension method: empty collection, single element, element preservation, count preservation, duplicates, string types.

MetaData/Tests/ProcessingInfosExtTests.cs (18 tests)

Tests for all ProcessingInfosExt methods: AreAllFaceDetectionsDone, AreAllFrontalFaceDetectionsDone, IsFrontalFaceDetection, IsCnnFaceDetection with various flag combinations.

MetaData/Tests/ImageExtTests.cs (9 tests)

Tests for InvalidateId (Image, Person, Face, PersonTag) and GetFace extension methods including null/empty collection edge cases.

MetaData/Tests/UtilTests.cs (18 tests)

Tests for IsSupportedFileType, SortPersonTags, GetValueOrDefault, Trim, and HasMinimalDifference including edge cases like recycle bin paths, empty collections, and floating-point comparisons.

Remaining Gaps (for future work)

  • GPS project: No test project exists (requires file I/O test infrastructure)
  • Logging project: No test project exists (requires Serilog test setup)
  • Thread internal types: AsyncUpdateScope, SemaphoreSlimLock, WaitHandleExt are internal with no InternalsVisibleTo

Add tests for previously untested code:
- Util/Tests/AsyncExtTests.cs: ForEachAsync extension method
- Util/Tests/EnumerableExtTests.cs: OrderRandom extension method
- MetaData/Tests/ProcessingInfosExtTests.cs: ProcessingInfos flag checks
- MetaData/Tests/ImageExtTests.cs: InvalidateId and GetFace extensions
- MetaData/Tests/UtilTests.cs: IsSupportedFileType, SortPersonTags,
  GetValueOrDefault, Trim, HasMinimalDifference

Agent-Logs-Url: https://github.com/tgoessler/TCSystemCS/sessions/5128e577-3dff-48cb-81ea-e68243037a37

Co-authored-by: tgoessler <89462205+tgoessler@users.noreply.github.com>
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.

2 participants