Summary
The tests/Unit.Tests project is redundant — its handler tests either already exist in tests/Web.Tests or need to be merged there. This issue removes Unit.Tests entirely after migrating all unique tests.
Work Required
1. Migrate unique tests into Web.Tests
| File |
Action |
Handlers/GetBlogPostByIdHandlerTests.cs |
Add to Web.Tests/Handlers/ (not present there) |
Handlers/CreateBlogPostHandlerTests.cs |
Merge unique tests (Handle_Success_DoesNotCallInvalidateById) into Web.Tests version |
Handlers/EditBlogPostHandlerTests.cs |
Merge unique tests (Handle_ConcurrentUpdate_ReturnsConcurrencyErrorCode) into Web.Tests version |
Handlers/GetBlogPostsHandlerTests.cs |
Compare and merge any unique tests |
Handlers/DeleteBlogPostHandlerTests.cs |
Compare and merge any unique tests |
- Update all namespaces from
Unit.Handlers → Web.Handlers
- Update
Web.Tests/GlobalUsings.cs to add any missing usings (e.g. Microsoft.EntityFrameworkCore, MyBlog.Domain.Abstractions)
- Ensure
Web.Tests.csproj has Microsoft.EntityFrameworkCore package reference if needed for DbUpdateConcurrencyException
2. Remove Unit.Tests project
3. Verify
dotnet build passes with zero errors
dotnet test tests/Web.Tests passes
Branch
squad/144-migrate-unit-tests-to-web-tests (use next available issue number once created)
Acceptance Criteria
Summary
The
tests/Unit.Testsproject is redundant — its handler tests either already exist intests/Web.Testsor need to be merged there. This issue removesUnit.Testsentirely after migrating all unique tests.Work Required
1. Migrate unique tests into
Web.TestsHandlers/GetBlogPostByIdHandlerTests.csWeb.Tests/Handlers/(not present there)Handlers/CreateBlogPostHandlerTests.csHandle_Success_DoesNotCallInvalidateById) intoWeb.TestsversionHandlers/EditBlogPostHandlerTests.csHandle_ConcurrentUpdate_ReturnsConcurrencyErrorCode) intoWeb.TestsversionHandlers/GetBlogPostsHandlerTests.csHandlers/DeleteBlogPostHandlerTests.csUnit.Handlers→Web.HandlersWeb.Tests/GlobalUsings.csto add any missing usings (e.g.Microsoft.EntityFrameworkCore,MyBlog.Domain.Abstractions)Web.Tests.csprojhasMicrosoft.EntityFrameworkCorepackage reference if needed forDbUpdateConcurrencyException2. Remove Unit.Tests project
tests/Unit.Tests/directory entirelyMyBlog.slnx.github/workflows/squad-release.yml(3 references)src/Web/Properties/AssemblyInfo.cs: removeInternalsVisibleTo("Unit.Tests"), addInternalsVisibleTo("Web.Tests")(if not already added by [Sprint 6] fix(quality): resolve CA1515 — make Web feature typesinternal#138)3. Verify
dotnet buildpasses with zero errorsdotnet test tests/Web.TestspassesBranch
squad/144-migrate-unit-tests-to-web-tests(use next available issue number once created)Acceptance Criteria
tests/Unit.Tests/directory is gone