Skip to content

Commit

Permalink
coverage: avoid skipping brittle tests in FileSystemWatcher (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbreuss authored Mar 22, 2024
1 parent 4d75f94 commit 8796d35
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher;

// ReSharper disable AccessToDisposedClosure
// ReSharper disable once PartialTypeWithSinglePart
public abstract partial class IncludeSubdirectoriesTests<TFileSystem>
: FileSystemTestBase<TFileSystem>
Expand Down Expand Up @@ -65,8 +66,6 @@ public void
public void IncludeSubdirectories_SetToTrue_ShouldTriggerNotificationOnSubdirectories(
string baseDirectory, string subdirectoryName)
{
SkipIfBrittleTestsShouldBeSkipped(!Test.RunsOnWindows);

FileSystem.Initialize()
.WithSubdirectory(baseDirectory).Initialized(s => s
.WithSubdirectory(subdirectoryName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public abstract partial class Tests<TFileSystem>
[AutoData]
public void BeginInit_ShouldStopListening(string path)
{
SkipIfBrittleTestsShouldBeSkipped();

FileSystem.Initialize();
using ManualResetEventSlim ms = new();
using IFileSystemWatcher fileSystemWatcher =
Expand Down Expand Up @@ -68,8 +66,6 @@ public void Container_ShouldBeInitializedWithNull()
[AutoData]
public void EndInit_ShouldRestartListening(string path)
{
SkipIfBrittleTestsShouldBeSkipped();

FileSystem.Initialize();
using ManualResetEventSlim ms = new();
using IFileSystemWatcher fileSystemWatcher =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public abstract partial class WaitForChangedTests<TFileSystem>
[AutoData]
public void WaitForChanged_ShouldBlockUntilEventHappens(string path)
{
SkipIfBrittleTestsShouldBeSkipped();

using ManualResetEventSlim ms = new();
using IFileSystemWatcher fileSystemWatcher =
FileSystem.FileSystemWatcher.New(BasePath);
Expand Down Expand Up @@ -54,8 +52,6 @@ public void WaitForChanged_ShouldBlockUntilEventHappens(string path)
public void WaitForChanged_Timeout_ShouldReturnTimedOut(string path,
Func<IFileSystemWatcher, IWaitForChangedResult> callback)
{
SkipIfBrittleTestsShouldBeSkipped();

using ManualResetEventSlim ms = new();
using IFileSystemWatcher fileSystemWatcher =
FileSystem.FileSystemWatcher.New(BasePath);
Expand Down

0 comments on commit 8796d35

Please sign in to comment.