Skip to content

TS-024 - Add unit tests from copilot#101

Merged
m-GDEV merged 3 commits intomasterfrom
TS-024
Feb 28, 2026
Merged

TS-024 - Add unit tests from copilot#101
m-GDEV merged 3 commits intomasterfrom
TS-024

Conversation

@m-GDEV
Copy link
Owner

@m-GDEV m-GDEV commented Feb 28, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 28, 2026 05:38
@deepsource-io
Copy link
Contributor

deepsource-io bot commented Feb 28, 2026

DeepSource Code Review

We reviewed changes in 0698792...986f75b on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
C# Feb 28, 2026 6:00a.m. Review ↗
Test coverage Feb 28, 2026 6:01a.m. Review ↗

Code Coverage Summary

Language Line Coverage (New Code) Line Coverage (Overall)
Aggregate
100%
[✓ above threshold]
54.8%
[⤫ below threshold]
C#
100%
54.8%

➟ Additional coverage metrics may have been reported. See full coverage report ↗

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds broad NUnit/FluentAssertions unit-test coverage across the Shared, Presentation, and API layers, plus a small UI-state bug fix in WardrobeViewModel to support the new tests.

Changes:

  • Added many new unit tests for Shared DTOs/models/static resources and Presentation view models/services/identity components.
  • Added a comprehensive API test suite for endpoints, middleware, repositories, services, and database behaviors (plus EF Core test dependencies).
  • Fixed WardrobeViewModel.UpdateActionDialogState to set ShowEdit for ActionType.Edit (previously toggled delete).

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
WardrobeManager.Shared.Tests/WardrobeManager.Shared.Tests.csproj Normalizes project file header/formatting.
WardrobeManager.Shared.Tests/StaticResources/StaticValidatorsTests.cs Adds tests for shared static validator registry behavior.
WardrobeManager.Shared.Tests/StaticResources/ProjectConstantsTests.cs Adds tests for shared constant values and basic formatting checks.
WardrobeManager.Shared.Tests/StaticResources/MiscMethodsTests.cs Adds tests for MiscMethods helpers (emoji/name formatting/base64/etc).
WardrobeManager.Shared.Tests/Models/ResultTests.cs Adds tests for Result<T> record behavior.
WardrobeManager.Shared.Tests/Models/NewOrEditedClothingItemDTOTests.cs Adds tests for NewClothingItemDTO defaults/mutation.
WardrobeManager.Shared.Tests/Models/FilterModelTests.cs Adds tests for FilterModel defaults/mutation.
WardrobeManager.Shared.Tests/Models/EditedUserDTOTests.cs Adds tests for EditedUserDTO construction/mutation.
WardrobeManager.Shared.Tests/DTOs/LogDTOTests.cs Adds tests for LogDTO property set behavior.
WardrobeManager.Presentation/ViewModels/WardrobeViewModel.cs Fixes edit-dialog flag assignment (ShowEdit vs ShowDelete).
WardrobeManager.Presentation.Tests/ViewModels/WardrobeViewModelTests.cs Adds tests for wardrobe loading, deleting, and dialog-state logic.
WardrobeManager.Presentation.Tests/ViewModels/SignupViewModelTests.cs Adds tests for signup flow behaviors.
WardrobeManager.Presentation.Tests/ViewModels/NavBarViewModelTests.cs Adds tests for nav bar view model state and logout behavior.
WardrobeManager.Presentation.Tests/ViewModels/LoginViewModelTests.cs Adds tests for login flow behaviors and enter-key handling.
WardrobeManager.Presentation.Tests/ViewModels/HomeViewModelTests.cs Adds basic instantiation test for HomeViewModel.
WardrobeManager.Presentation.Tests/ViewModels/DashboardViewModelTests.cs Adds basic instantiation test for DashboardViewModel.
WardrobeManager.Presentation.Tests/ViewModels/AddClothingItemViewModelTests.cs Adds tests for submit validation, notifications, and enum collections.
WardrobeManager.Presentation.Tests/Services/NotificationServiceTests.cs Adds tests for notification add/remove and OnChange firing.
WardrobeManager.Presentation.Tests/Services/IdentityServiceTests.cs Adds tests for identity service wrapper behavior and notifications.
WardrobeManager.Presentation.Tests/Identity/UserInfoTests.cs Adds tests for identity UserInfo defaults/mutation.
WardrobeManager.Presentation.Tests/Identity/CookieHandlerTests.cs Adds tests for CustomHttpMessageHandler (headers/errors).
WardrobeManager.Presentation.Tests/Identity/CookieAuthenticationStateProviderTests.cs Adds tests for cookie auth provider login/register/auth-state parsing.
WardrobeManager.Presentation.Tests/Helpers/FakeNavigationManager.cs Adds a test helper NavigationManager implementation.
WardrobeManager.Presentation.Tests/ApiServiceTests.cs Extends API client tests for connectivity, logging, onboarding, clothing CRUD.
WardrobeManager.Api/Middleware/GlobalExceptionHandler.cs Changes exception handler visibility to public (to support testing).
WardrobeManager.Api.Tests/WardrobeManager.Api.Tests.csproj Adds EF Core InMemory/Sqlite packages and normalizes formatting.
WardrobeManager.Api.Tests/Services/UserServiceTests.cs Adds tests for UserService behaviors (admin checks, update/delete/create).
WardrobeManager.Api.Tests/Services/FileServiceTests.cs Adds tests for image save/get/delete behaviors and size limit enforcement.
WardrobeManager.Api.Tests/Services/DataDirectoryServiceTests.cs Adds tests for directory path creation/structure and configuration errors.
WardrobeManager.Api.Tests/Repositories/GenericRepositoryTests.cs Adds tests for generic repository CRUD/save behaviors.
WardrobeManager.Api.Tests/Repositories/ClothingRepositoryTests.cs Adds tests for user-scoped clothing repository queries.
WardrobeManager.Api.Tests/Middleware/UserCreationMiddlewareTests.cs Adds tests for user creation middleware context behavior.
WardrobeManager.Api.Tests/Middleware/LoggingMiddlewareTests.cs Adds tests for request logging middleware behavior.
WardrobeManager.Api.Tests/Middleware/GlobalExceptionHandlerTests.cs Adds tests for exception handler status code and logging behavior.
WardrobeManager.Api.Tests/Helpers/AsyncQueryHelper.cs Adds helper to emulate async queryable enumeration in tests.
WardrobeManager.Api.Tests/Endpoints/UserEndpointsTests.cs Adds tests for user endpoints returning expected results and calling services.
WardrobeManager.Api.Tests/Endpoints/MiscEndpointsTests.cs Adds tests for ping/auth messaging and log endpoint mapping/calls.
WardrobeManager.Api.Tests/Endpoints/ImageEndpointsTests.cs Adds tests for image endpoint delegating to file service.
WardrobeManager.Api.Tests/Endpoints/IdentityEndpointsTests.cs Adds tests for onboarding identity endpoints and roles/logout behaviors.
WardrobeManager.Api.Tests/Endpoints/ClothingEndpointsTests.cs Adds tests for clothing endpoints validation and service calls.
WardrobeManager.Api.Tests/Database/Entities/ClothingItemTests.cs Adds tests for entity wear/wash counters and defaults.
WardrobeManager.Api.Tests/Database/DatabaseInitializerTests.cs Adds tests for role creation and early-return behavior.
WardrobeManager.Api.Tests/Database/DatabaseContextTests.cs Adds tests for DbSet presence and relationship/cascade behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

m-GDEV and others added 2 commits February 28, 2026 01:00
…ctors

Co-authored-by: m-GDEV <65223925+m-GDEV@users.noreply.github.com>
@m-GDEV m-GDEV merged commit 29dffb1 into master Feb 28, 2026
8 checks passed
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.

3 participants