# Test Project Alignment Implementation Plan > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. **Goal:** Restructure test projects to achieve 1:1 mapping with source projects. **Architecture:** Create 5 new test projects, move existing tests from the generic JdeScoping.Tests to their proper homes, and delete the catch-all project. **Tech Stack:** .NET 10, xUnit, NSubstitute, Shouldly --- ## Phase 1: Create New Test Projects ### Task 1.1: Create JdeScoping.Core.Tests project **Files:** - Create: `tests/JdeScoping.Core.Tests/JdeScoping.Core.Tests.csproj` - Create: `tests/JdeScoping.Core.Tests/Unit/` directory **Step 1: Create directory structure** Run: ```bash mkdir -p /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Core.Tests/Unit ``` **Step 2: Create .csproj file** Create `tests/JdeScoping.Core.Tests/JdeScoping.Core.Tests.csproj`: ```xml net10.0 enable enable false ``` --- ### Task 1.2: Create JdeScoping.Infrastructure.Tests project **Files:** - Create: `tests/JdeScoping.Infrastructure.Tests/JdeScoping.Infrastructure.Tests.csproj` - Create: `tests/JdeScoping.Infrastructure.Tests/Unit/` directory **Step 1: Create directory structure** Run: ```bash mkdir -p /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Infrastructure.Tests/Unit ``` **Step 2: Create .csproj file** Create `tests/JdeScoping.Infrastructure.Tests/JdeScoping.Infrastructure.Tests.csproj`: ```xml net10.0 enable enable false ``` --- ### Task 1.3: Create JdeScoping.Client.Tests project (placeholder) **Files:** - Create: `tests/JdeScoping.Client.Tests/JdeScoping.Client.Tests.csproj` - Create: `tests/JdeScoping.Client.Tests/Placeholder.cs` **Step 1: Create directory structure** Run: ```bash mkdir -p /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Client.Tests ``` **Step 2: Create .csproj file** Create `tests/JdeScoping.Client.Tests/JdeScoping.Client.Tests.csproj`: ```xml net10.0 enable enable false ``` **Step 3: Create placeholder file** Create `tests/JdeScoping.Client.Tests/Placeholder.cs`: ```csharp // This file exists to ensure the test project compiles. // Add tests here as needed. namespace JdeScoping.Client.Tests; public class Placeholder { // Tests will be added here } ``` --- ### Task 1.4: Create JdeScoping.Database.Tests project (placeholder) **Files:** - Create: `tests/JdeScoping.Database.Tests/JdeScoping.Database.Tests.csproj` - Create: `tests/JdeScoping.Database.Tests/Placeholder.cs` **Step 1: Create directory structure** Run: ```bash mkdir -p /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Database.Tests ``` **Step 2: Create .csproj file** Create `tests/JdeScoping.Database.Tests/JdeScoping.Database.Tests.csproj`: ```xml net10.0 enable enable false ``` **Step 3: Create placeholder file** Create `tests/JdeScoping.Database.Tests/Placeholder.cs`: ```csharp // This file exists to ensure the test project compiles. // Add tests here as needed. namespace JdeScoping.Database.Tests; public class Placeholder { // Tests will be added here } ``` --- ### Task 1.5: Create JdeScoping.Host.Tests project (placeholder) **Files:** - Create: `tests/JdeScoping.Host.Tests/JdeScoping.Host.Tests.csproj` - Create: `tests/JdeScoping.Host.Tests/Placeholder.cs` **Step 1: Create directory structure** Run: ```bash mkdir -p /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Host.Tests ``` **Step 2: Create .csproj file** Create `tests/JdeScoping.Host.Tests/JdeScoping.Host.Tests.csproj`: ```xml net10.0 enable enable false ``` **Step 3: Create placeholder file** Create `tests/JdeScoping.Host.Tests/Placeholder.cs`: ```csharp // This file exists to ensure the test project compiles. // Add tests here as needed. namespace JdeScoping.Host.Tests; public class Placeholder { // Tests will be added here } ``` --- ## Phase 2: Move Test Files ### Task 2.1: Move JdeDateConverterTests to Core.Tests **Files:** - Move: `tests/JdeScoping.Tests/Unit/JdeDateConverterTests.cs` → `tests/JdeScoping.Core.Tests/Unit/` **Step 1: Copy file to new location** Run: ```bash cp /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Tests/Unit/JdeDateConverterTests.cs /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Core.Tests/Unit/ ``` **Step 2: Update namespace** In `tests/JdeScoping.Core.Tests/Unit/JdeDateConverterTests.cs`, change: ```csharp namespace JdeScoping.Tests.Unit; ``` to: ```csharp namespace JdeScoping.Core.Tests.Unit; ``` --- ### Task 2.2: Move QueryTypesTests to Core.Tests **Files:** - Move: `tests/JdeScoping.Tests/Unit/QueryTypesTests.cs` → `tests/JdeScoping.Core.Tests/Unit/` **Step 1: Copy file to new location** Run: ```bash cp /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Tests/Unit/QueryTypesTests.cs /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Core.Tests/Unit/ ``` **Step 2: Update namespace** In `tests/JdeScoping.Core.Tests/Unit/QueryTypesTests.cs`, change: ```csharp namespace JdeScoping.Tests.Unit; ``` to: ```csharp namespace JdeScoping.Core.Tests.Unit; ``` --- ### Task 2.3: Move FakeAuthServiceTests to Infrastructure.Tests **Files:** - Move: `tests/JdeScoping.Tests/Unit/FakeAuthServiceTests.cs` → `tests/JdeScoping.Infrastructure.Tests/Unit/` **Step 1: Copy file to new location** Run: ```bash cp /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Tests/Unit/FakeAuthServiceTests.cs /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Infrastructure.Tests/Unit/ ``` **Step 2: Update namespace** In `tests/JdeScoping.Infrastructure.Tests/Unit/FakeAuthServiceTests.cs`, change: ```csharp namespace JdeScoping.Tests.Unit; ``` to: ```csharp namespace JdeScoping.Infrastructure.Tests.Unit; ``` --- ## Phase 3: Update Solution File ### Task 3.1: Update JdeScoping.slnx **Files:** - Modify: `JdeScoping.slnx` **Step 1: Read current solution file** Run: ```bash cat /Users/dohertj2/Desktop/JdeScopingTool/NEW/JdeScoping.slnx ``` **Step 2: Add new test projects and remove old one** Add these project entries: ```xml ``` Remove this project entry: ```xml ``` --- ## Phase 4: Delete Old Test Project ### Task 4.1: Delete JdeScoping.Tests directory **Step 1: Remove the old test project directory** Run: ```bash rm -rf /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/JdeScoping.Tests ``` --- ## Phase 5: Verification ### Task 5.1: Build the solution **Step 1: Run build** Run: ```bash cd /Users/dohertj2/Desktop/JdeScopingTool/NEW && dotnet build ``` Expected: Build succeeded with 0 errors. --- ### Task 5.2: Run all tests **Step 1: Execute test suite** Run: ```bash cd /Users/dohertj2/Desktop/JdeScopingTool/NEW && dotnet test --verbosity quiet ``` Expected: All tests pass. **Step 2: Verify test count** Run: ```bash cd /Users/dohertj2/Desktop/JdeScopingTool/NEW && dotnet test --list-tests 2>/dev/null | grep -c "^\s" || dotnet test --verbosity normal 2>&1 | grep "Passed\|Failed" | tail -20 ``` Expected: - JdeScoping.Core.Tests: ~77 tests (JdeDateConverter + QueryTypes) - JdeScoping.Infrastructure.Tests: ~4 tests (FakeAuthService) - Placeholder projects: 0 tests each --- ### Task 5.3: Verify project structure **Step 1: List test projects** Run: ```bash ls -1 /Users/dohertj2/Desktop/JdeScopingTool/NEW/tests/ ``` Expected output: ``` JdeScoping.Api.IntegrationTests JdeScoping.Api.Tests JdeScoping.Client.Tests JdeScoping.Core.Tests JdeScoping.DataAccess.Tests JdeScoping.Database.Tests JdeScoping.DataSync.Tests JdeScoping.ExcelExport.Tests JdeScoping.Host.Tests JdeScoping.Infrastructure.Tests ``` --- ## Summary **Total Tasks:** 14 tasks across 5 phases - **Phase 1:** Create 5 new test projects (5 tasks) - **Phase 2:** Move 3 test files with namespace updates (3 tasks) - **Phase 3:** Update solution file (1 task) - **Phase 4:** Delete old test project (1 task) - **Phase 5:** Verification (3 tasks)