Framework: Pester 3.4.0+
Total Tests: 106 (58 unit + 48 integration)
Pass Rate: 100%
Execution Time: ~15 seconds total
File: FileLabeler.Tests.ps1
Tests: 58
Focus: Individual function testing with mock data
Execution Time: ~6 seconds
Documentation: docs/features/unit-tests.md
File: FileLabeler.Integration.Tests.ps1
Tests: 48
Focus: End-to-end workflows with real file operations
Execution Time: ~9 seconds
Documentation: INTEGRATION_TESTS.md
# Run all tests (unit + integration)
Invoke-Pester -Path .\tests\# From project root
Invoke-Pester -Path .\tests\FileLabeler.Tests.ps1# Using convenience script
.\run_integration_tests.ps1
# Or directly with Pester
Invoke-Pester -Path .\tests\FileLabeler.Integration.Tests.ps1Invoke-Pester -Path .\tests\FileLabeler.Tests.ps1 -PassThru | Select-Object PassedCount, FailedCount, TotalCount, Time# Run only cache tests
Invoke-Pester -Path .\tests\FileLabeler.Tests.ps1 -TestName "*Label Cache*"
# Run only folder scanning tests
Invoke-Pester -Path .\tests\FileLabeler.Tests.ps1 -TestName "*Folder File Scanning*"-
Label Cache Management (5 tests)
- Initialization, storage, retrieval, cache misses, clearing
-
Folder File Scanning (5 tests)
- Recursive/non-recursive scanning, deduplication, empty folders
-
File Type Filtering (3 tests)
- Support for 7 Office file types, filtering logic
-
Duplicate Detection (3 tests)
- Detecting, filtering, and merging duplicate files
-
Label Change Categorization (5 tests)
- New, Upgrade, Downgrade, Unchanged, Same label detection
-
Warning Detection (5 tests)
- Mass downgrade, large batch, no changes, mixed changes
-
Configuration Management (6 tests)
- Load, save, validate configuration structure
-
Error Handling and Logging (6 tests)
- Structured logging, error patterns, exception handling
-
Drag-and-Drop Support (3 tests)
- File/folder identification, mixed content processing
-
UI Layout and Dynamic Sizing (4 tests)
- Height calculations, min/max row enforcement
-
Norwegian Character Encoding (3 tests)
- UTF-8 preservation of æ, ø, å
-
Statistics Tracking (4 tests)
- Counter initialization, increments, success rate calculation
- End-to-end workflow validation
- Edge cases (empty selections, large batches)
PassedCount : 58
FailedCount : 0
TotalCount : 58
Time : 00:00:06.28
Status: ✅ ALL TESTS PASSING
Pester 3.4.0 is included with Windows PowerShell 5.1+:
Get-Module -ListAvailable -Name Pester- Windows 10/11
- PowerShell 5.1 or later
- Write access to
$env:TEMPfor temporary test files
tests/
├── FileLabeler.Tests.ps1 # Unit test suite (58 tests)
├── FileLabeler.Integration.Tests.ps1 # Integration test suite (48 tests) ⭐ NEW
├── INTEGRATION_TESTS.md # Integration test documentation ⭐ NEW
├── IntegrationTestData/ # Auto-generated test files (cleaned after tests)
└── README.md # This file
Root:
run_integration_tests.ps1 # Integration test runner script ⭐ NEW
Focus: Individual functions with mock data
- Label Cache Management (5 tests)
- Folder File Scanning (5 tests)
- File Type Filtering (3 tests)
- Duplicate Detection (3 tests)
- Label Change Categorization (5 tests)
- Warning Detection (5 tests)
- Configuration Management (6 tests)
- Error Handling and Logging (6 tests)
- Drag-and-Drop Support (3 tests)
- UI Layout and Dynamic Sizing (4 tests)
- Norwegian Character Encoding (3 tests)
- Statistics Tracking (4 tests)
- Integration Scenarios (6 tests)
Focus: End-to-end workflows with real file operations
- Test Framework Setup (4 tests) - Subtask 17.1
- Complete Workflow Simulation (5 tests) - Subtask 17.2
- Large Batch Processing (4 tests) - Subtask 17.3
- Mixed Label Scenarios (8 tests) - Subtask 17.4
- Protection Handling (4 tests) - Subtask 17.5
- Error Recovery & Special Locations (8 tests) - Subtask 17.6
- End-to-End Workflow (3 tests)
- Real AIP Module Integration (4 tests, skip if module unavailable)
- Performance Benchmarks (2 tests)
- Cleanup Verification (1 test)
- Detailed test descriptions
- Implementation notes
- Key findings
- Performance metrics
- Workflow testing
- Performance thresholds
- Real AIP integration
- Setup and execution guide
| Context | Tests | Coverage |
|---|---|---|
| Label Cache Management | 5 | Cache operations |
| Folder File Scanning | 5 | Recursive scanning, deduplication |
| File Type Filtering | 3 | Supported extensions |
| Duplicate Detection | 3 | File merging |
| Label Change Categorization | 5 | Change analysis |
| Warning Detection | 5 | Smart warnings |
| Configuration Management | 6 | Config load/save/validate |
| Error Handling | 6 | Logging, error patterns |
| Drag-and-Drop | 3 | Path processing |
| UI Layout | 4 | Dynamic sizing |
| Norwegian Encoding | 3 | UTF-8 characters |
| Statistics Tracking | 4 | Counter operations |
| Integration | 2 | Workflow validation |
| Edge Cases | 4 | Error scenarios |
You may be using Pester 5.x syntax. This test suite requires Pester 3.x:
# Check Pester version
Get-Module -ListAvailable -Name Pester | Select-Object Version
# If you have Pester 5.x, use:
Import-Module Pester -MaximumVersion 3.99
Invoke-Pester -Path .\tests\FileLabeler.Tests.ps1Tests clean up after themselves, but if interrupted:
# Manually clean temp folders
Get-ChildItem $env:TEMP -Filter "PesterTest_*" -Directory | Remove-Item -Recurse -ForceMaintained by: FileLabeler Development Team
Last Updated: 2025-10-26
Test Framework: Pester 3.4.0