Skip to content

Conversation

@vbreuss
Copy link
Member

@vbreuss vbreuss commented Sep 12, 2025

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.

Key changes:

  • Adds UpdateLocation method to the IStorageContainer interface and all implementing classes
  • Updates file move and replace operations to call UpdateLocation when containers change location
  • Adds test coverage for multiple replace operations to verify the fix works correctly

@vbreuss vbreuss self-assigned this Sep 12, 2025
Copilot AI review requested due to automatic review settings September 12, 2025 06:25
@vbreuss vbreuss added the bug Something isn't working label Sep 12, 2025
Copy link

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

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 UpdateLocation method to the IStorageContainer interface and all implementing classes
  • Updates file move and replace operations to call UpdateLocation when 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

@vbreuss vbreuss enabled auto-merge (squash) September 12, 2025 06:27
@sonarqubecloud
Copy link

@vbreuss vbreuss merged commit 36a9473 into main Sep 12, 2025
13 checks passed
@vbreuss vbreuss deleted the topic/update-location-of-moved-containers branch September 12, 2025 06:51
@github-actions
Copy link

This is addressed in release v4.3.7.

This was referenced Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working state: released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: MockFileInfo.Replace throws error if same filePath is used twice

2 participants