From 8b915e0aa909201fbd91f2312bf5456dbbccb571 Mon Sep 17 00:00:00 2001 From: Valentin Date: Mon, 16 Dec 2024 11:46:12 +0100 Subject: [PATCH] Fix further issues --- .../FileSystem/FileSystemWatcherStatisticsTests.cs | 1 + .../FileSystem/FileSystemWatcher/EventTests.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherStatisticsTests.cs index d87f07f8..618f5f39 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherStatisticsTests.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Testably.Abstractions.Testing.Statistics; using Testably.Abstractions.Testing.Tests.TestHelpers; +// ReSharper disable MethodSupportsCancellation namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs index 06f6bb69..52380dfe 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs @@ -2,6 +2,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +// ReSharper disable MethodSupportsCancellation namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; @@ -50,7 +51,7 @@ void FileSystemWatcherOnChanged(object sender, FileSystemEventArgs e) while (!token.IsCancellationRequested) { string content = i++.ToString(CultureInfo.InvariantCulture); - FileSystem.File.WriteAllText(path, content); + await FileSystem.File.WriteAllTextAsync(path, content, token); await Task.Delay(10); ms1.Set(); } @@ -261,7 +262,7 @@ void FileSystemWatcherOnRenamed(object sender, FileSystemEventArgs e) try { int i = 0; - FileSystem.File.WriteAllText($"path-{i}", ""); + await FileSystem.File.WriteAllTextAsync($"path-{i}", "", token); while (!token.IsCancellationRequested) { FileSystem.File.Move($"path-{i}", $"path-{++i}");