Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix failing tests
  • Loading branch information
vbreuss committed Sep 16, 2025
commit 9128b4dbdbc99610dc00e3e1b404b39b49e4da41
Original file line number Diff line number Diff line change
Expand Up @@ -553,15 +553,15 @@ private string TransformPathAndName(

private void TriggerRenameNotification(ChangeDescription item)
{
if (_fileSystem.Execute.IsWindows)
if (!item.Path.StartsWith(Path, _fileSystem.Execute.StringComparisonMode) &&
item.OldPath != null)
{
if (!item.Path.StartsWith(Path, _fileSystem.Execute.StringComparisonMode) &&
item.OldPath != null)
{
Deleted?.Invoke(this, ToFileSystemEventArgs(
WatcherChangeTypes.Deleted, item.OldPath, item.OldName));
}
else if (TryMakeRenamedEventArgs(item,
Deleted?.Invoke(this, ToFileSystemEventArgs(
WatcherChangeTypes.Deleted, item.OldPath, item.OldName));
}
else if (_fileSystem.Execute.IsWindows)
{
if (TryMakeRenamedEventArgs(item,
out RenamedEventArgs? eventArgs))
{
Renamed?.Invoke(this, eventArgs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public async Task RenamedEventArgs_ShouldUseDirectorySeparatorFromSimulatedFileS
fileSystem.File.WriteAllText(expectedOldFullPath, "foo");

using IFileSystemWatcher fileSystemWatcher =
fileSystem.FileSystemWatcher.New(parentDirectory);
fileSystem.FileSystemWatcher.New(fileSystem.Path.GetFullPath(parentDirectory));
using ManualResetEventSlim ms = new();
fileSystemWatcher.Renamed += (_, eventArgs) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@
public async Task NotifyFilter_MoveDirectory_ShouldTriggerChangedEventOnNotifyFilters(
NotifyFilters notifyFilter, string sourceName, string destinationName)
{
//SkipIfLongRunningTestsShouldBeSkipped();
SkipIfLongRunningTestsShouldBeSkipped();

Check notice on line 619 in Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs#L619

Remove this commented out code.

FileSystem.Initialize();
FileSystem.Directory.CreateDirectory(sourceName);
Expand Down Expand Up @@ -658,7 +658,7 @@
public async Task NotifyFilter_MoveDirectoryOutOfTheWatchedDirectory_ShouldTriggerChangedEventOnNotifyFilters(
NotifyFilters notifyFilter, string sourceName, string destinationName)
{
//SkipIfLongRunningTestsShouldBeSkipped();
SkipIfLongRunningTestsShouldBeSkipped();

FileSystem.Initialize().WithSubdirectory("watched");
var sourcePath = FileSystem.Path.Combine("watched", sourceName);
Expand Down
Loading