Commit Graph

13 Commits

Author SHA1 Message Date
Joseph Doherty 0c8657713b refactor(core): reorganize DTOs into Models and ViewModels folders
Move DTOs from ApiContracts to appropriate locations:
- SignalR DTOs → ViewModels (renamed Dto→ViewModel suffix)
- Pipeline DTOs → Models/Pipelines
- UserInfoDto → Models/Auth
- DataUpdateDto → Models/Infrastructure
2026-01-19 00:34:57 -05:00
Joseph Doherty 7e36bb4225 refactor: remove unused classes and consolidate ViewModels in Core
Remove 9 unused types from Core (duplicate extension classes, TableSpec, ColumnSpec, LotLocation), move ComponentLotViewModel and OperatorViewModel from Client to Core, and refactor DataSync.Dev to use pipeline-based configuration. Fix Login.razor to use UserInfoDto directly.
2026-01-19 00:13:12 -05:00
Joseph Doherty 6cb852c164 test: add FileApiClientTests with route, success, and error tests
Add comprehensive unit tests for FileApiClient covering:
- Route verification tests for all 4 download endpoints (POST method)
- Route verification tests for 2 upload endpoints (POST method)
- Success tests for downloads returning byte arrays
- Success tests verifying existing data can be passed to downloads
- Success tests for uploads returning IReadOnlyList<T>
- Multipart content-type and filename verification test
- Error tests (404 for download, 400 validation error for upload)
2026-01-06 11:33:31 -05:00
Joseph Doherty 55bfdb3532 test: add AuthApiClientTests with route and success tests
Add unit tests for AuthApiClient covering:
- Route verification tests for GetPublicKey, Login, Logout, GetCurrentUser
- Success tests for all 4 methods
- Proper handling of 204 NoContent for Logout (returns Unit)
2026-01-06 11:31:49 -05:00
Joseph Doherty d06d5f27e2 test: add LookupApiClientTests with route and encoding tests
- Route verification tests for all 4 methods (FindItems, FindProfitCenters,
  FindWorkCenters, FindOperators)
- Query string encoding tests verifying special characters (&, =) and spaces
  are properly URL-encoded
- Success tests for all lookup methods verifying deserialization
- Representative error test for 500 status code
2026-01-06 11:29:46 -05:00
Joseph Doherty 76ce35458c test: add SearchApiClientTests with route and success/error tests
Add comprehensive unit tests for SearchApiClient covering:
- Route verification tests for all 6 methods (GetUserSearches, GetQueuedSearches,
  GetSearch, CopySearch, CreateSearch, GetResults)
- Success tests verifying deserialization for all methods
- Representative error tests (404 for GetSearch, 401 for GetUserSearches)

Uses MockHttpMessageHandler to verify correct API routes are called
and ApiResult<T> pattern maps responses correctly.
2026-01-06 11:27:33 -05:00
Joseph Doherty 299099f716 test: add POST and bytes tests to ApiClientBaseTests
Added 11 new tests covering:
- POST method tests (200 success, 401 unauthorized, no-body variant)
- Bytes tests (GET 200, GET 404, POST 200)
- Non-GET status code tests (POST 400 validation, bytes 500, multipart 401/200)

All 23 ApiClientBaseTests now pass.
2026-01-06 11:25:49 -05:00
Joseph Doherty c626ffbd69 test: add edge case tests to ApiClientBaseTests
Add 7 edge case tests for ApiClientBase:
- GetAsync_Returns200_EmptyBody_MapsToApiError
- GetAsync_Returns200_InvalidJson_MapsToApiError
- GetAsync_Returns204_ForUnitType_MapsToSuccess
- GetAsync_Returns204_ForNonUnitType_MapsToApiError
- GetAsync_NetworkException_MapsToApiError
- GetAsync_Timeout_MapsToApiError
- GetAsync_Returns400_WithoutValidationFormat_MapsToApiError

Also fix bug in ApiClientBase where 204 NoContent for Unit type
failed due to incorrect type casting. The implicit conversion from
Unit to ApiResult<Unit> must be applied before the runtime cast.
2026-01-06 11:23:54 -05:00
Joseph Doherty 6af5a4f9d6 test: add all 6 status code mapping tests to ApiClientBaseTests
- Add GetAsync_Returns404_MapsToNotFound test
- Add GetAsync_Returns400_WithValidationErrors_MapsToValidationError test
- Add GetAsync_Returns401_MapsToUnauthorized test
- Add GetAsync_Returns403_MapsToForbidden test
- Add GetAsync_Returns500_MapsToApiError test
- Add FrameworkReference to Microsoft.AspNetCore.App for ValidationProblemDetails
2026-01-06 11:20:43 -05:00
Joseph Doherty e75ebe1ffb test: add ApiClientBaseTests with 200 OK mapping test 2026-01-06 11:17:19 -05:00
Joseph Doherty 626b7a63f2 test: add TestableApiClient helper for ApiClientBase unit tests 2026-01-06 11:15:10 -05:00
Joseph Doherty 5c19cf0dbd test(client): add CryptoService tests 2026-01-03 08:48:24 -05:00
Joseph Doherty 26ff8d9b4f Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/),
new .NET 10 Blazor solution (NEW/), OpenSpec specifications,
documentation, and project configuration.
2026-01-02 07:43:29 -05:00