Closed slucky31 closed 2 months ago
The recent changes enhance local storage management within the application by introducing the ILibraryLocalStorage
interface. This addition improves folder handling for library creation, update, and deletion processes, incorporating robust error management. Dependency injection has been refined to support these updates, allowing for better customization. The testing framework has also been expanded to ensure thorough coverage of new local storage functionalities, promoting reliability and maintainability.
File(s) | Change Summary |
---|---|
Application/Libraries/Create/CreateLibraryCommandHandler.cs , |
Added ILibraryLocalStorage dependency for folder management; enhanced error handling in Handle . |
Application/Libraries/Delete/DeleteLibraryCommandHandler.cs , |
Added ILibraryLocalStorage dependency to handle directory deletion; improved error handling. |
Application/Libraries/Update/UpdateLibraryCommandHandler.cs , |
Added ILibraryLocalStorage dependency for folder moving; improved error handling. |
Domain/Libraries/LibrariesError.cs |
Introduced FolderNotCreated , FolderNotDeleted , and FolderNotMoved error constants for specific error handling. |
Domain/Primitives/TError.cs |
Added static readonly instance Any for predefined error state. |
tests/Application.UnitTests/Libraries/CreateLibraryCommandTests.cs , |
Updated tests to accommodate new ILibraryLocalStorage dependency and added coverage for error scenarios. |
tests/Application.UnitTests/Libraries/DeleteLibraryCommandTests.cs , |
Updated tests to include ILibraryLocalStorage mock for deletion scenarios; added error handling tests. |
tests/Application.UnitTests/Libraries/UpdateLibraryCommandTests.cs , |
Updated tests to include ILibraryLocalStorage for move operations; added tests for error cases. |
sequenceDiagram
participant User
participant CreateHandler
participant DeleteHandler
participant UpdateHandler
participant LocalStorage
User->>CreateHandler: Create Library Command
CreateHandler->>LocalStorage: Create Directory
alt Success
LocalStorage-->>CreateHandler: Success
CreateHandler-->>User: Library Created
else Failure
LocalStorage-->>CreateHandler: FolderNotCreated
CreateHandler-->>User: Error: Folder Not Created
end
User->>DeleteHandler: Delete Library Command
DeleteHandler->>LocalStorage: Delete Directory
alt Success
LocalStorage-->>DeleteHandler: Success
DeleteHandler-->>User: Library Deleted
else Failure
LocalStorage-->>DeleteHandler: FolderNotDeleted
DeleteHandler-->>User: Error: Folder Not Deleted
end
User->>UpdateHandler: Update Library Command
UpdateHandler->>LocalStorage: Move Directory
alt Success
LocalStorage-->>UpdateHandler: Success
UpdateHandler-->>User: Library Updated
else Failure
LocalStorage-->>UpdateHandler: FolderNotMoved
UpdateHandler-->>User: Error: Folder Not Moved
end
🐇 "In the meadow where the libraries grow,
New paths emerge with a joyful glow.
Folders created, errors handled with care,
Our storage adventures, a hop beyond compare!
With dependencies added and tests refined,
A future of libraries, beautifully aligned!" 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Coverage variation | Diff coverage |
---|---|
Report missing for 3c3e3eaf348596427d3358b923e31024da4dd99b[^1] | :white_check_mark: 100.00% (target: 80.00%) |
Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more [^1]: Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
https://github.com/slucky31/mycomicsmanager/issues/634
Summary by CodeRabbit
New Features
Bug Fixes
Tests