-
-
Notifications
You must be signed in to change notification settings - Fork 9
fix: update the location of moved or replaced containers #861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the UpdateLocation method for storage containers to properly update their location references when files are moved or replaced. This fixes an issue where containers retained stale location information after file system operations.
- Adds
UpdateLocationmethod to theIStorageContainerinterface and all implementing classes - Updates file move and replace operations to call
UpdateLocationwhen containers change location - Adds test coverage for multiple replace operations to verify the fix works correctly
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/Testably.Abstractions.Testing/Storage/IStorageContainer.cs | Adds UpdateLocation method to the interface |
| Source/Testably.Abstractions.Testing/Storage/InMemoryContainer.cs | Implements UpdateLocation by updating the internal location field |
| Source/Testably.Abstractions.Testing/Storage/NullContainer.cs | Implements UpdateLocation as a no-op for the null container |
| Tests/Testably.Abstractions.Testing.Tests/TestHelpers/LockableContainer.cs | Implements UpdateLocation as a no-op for the test helper |
| Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs | Updates replace and move operations to call UpdateLocation |
| Tests/Testably.Abstractions.Tests/FileSystem/File/ReplaceTests.cs | Adds test for multiple replace operations |
| Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ReplaceTests.cs | Adds test for multiple replace operations |
|
|
This is addressed in release v4.3.7. |



This PR implements the
UpdateLocationmethod for storage containers to properly update their location references when files are moved or replaced. This fixes an issue where containers retained stale location information after file system operations.Key changes:
UpdateLocationmethod to theIStorageContainerinterface and all implementing classesUpdateLocationwhen containers change location