Skip to content
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

coverage: avoid skipping brittle tests in FileSystemWatcher #521

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading