Skip to content

Commit

Permalink
Review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vbreuss committed Jan 11, 2025
1 parent e33b82f commit 639f41d
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public interface IInterceptionHandler : IFileSystemEntity
/// If set to <see langword="null" /> (default value) all callbacks are intercepted.
/// </param>
/// <remarks>This allows e.g. to throw custom exceptions instead.</remarks>
/// <returns>An <see cref="IAwaitableCallback{ChangeDescription}" /> to un-register the callback on dispose.</returns>
IAwaitableCallback<ChangeDescription> Event(Action<ChangeDescription> interceptionCallback,
Func<ChangeDescription, bool>? predicate = null);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface INotificationHandler : IFileSystemEntity
/// (optional) A predicate used to filter which callbacks should be notified.<br />
/// If set to <see langword="null" /> (default value) all callbacks are notified.
/// </param>
/// <returns>A <see cref="IAwaitableCallback{ChangeDescription}" /> to un-register the callback on dispose.</returns>
/// <returns>An <see cref="IAwaitableCallback{ChangeDescription}" /> to un-register the callback on dispose.</returns>
IAwaitableCallback<ChangeDescription> OnEvent(
Action<ChangeDescription>? notificationCallback = null,
Func<ChangeDescription, bool>? predicate = null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static class InterceptionHandlerExtensions
/// <param name="interceptionCallback">The callback to execute before the <paramref name="fileSystemType" /> is changed.</param>
/// <param name="globPattern">
/// (optional) The glob pattern that the <paramref name="fileSystemType" /> path must match.<br />
/// Defaults to "**/*" which matches everything.
/// Defaults to "*" which matches everything.
/// </param>
/// <param name="predicate">
/// (optional) A predicate used to filter which callbacks should be intercepted.<br />
Expand All @@ -31,7 +31,7 @@ public static IAwaitableCallback<ChangeDescription> Changing(
this IInterceptionHandler handler,
FileSystemTypes fileSystemType,
Action<ChangeDescription> interceptionCallback,
string globPattern = "**/*",
string globPattern = "*",
Func<ChangeDescription, bool>? predicate = null)
=> handler.Event(interceptionCallback,
changeDescription => changeDescription.Matches(
Expand All @@ -50,7 +50,7 @@ public static IAwaitableCallback<ChangeDescription> Changing(
/// <param name="interceptionCallback">The callback to execute before the <paramref name="fileSystemType" /> is created.</param>
/// <param name="globPattern">
/// (optional) The glob pattern that the <paramref name="fileSystemType" /> path must match.<br />
/// Defaults to "**/*" which matches everything.
/// Defaults to "*" which matches everything.
/// </param>
/// <param name="predicate">
/// (optional) A predicate used to filter which callbacks should be intercepted.<br />
Expand All @@ -62,7 +62,7 @@ public static IAwaitableCallback<ChangeDescription> Creating(
this IInterceptionHandler handler,
FileSystemTypes fileSystemType,
Action<ChangeDescription> interceptionCallback,
string globPattern = "**/*",
string globPattern = "*",
Func<ChangeDescription, bool>? predicate = null)
=> handler.Event(interceptionCallback,
changeDescription => changeDescription.Matches(
Expand All @@ -81,7 +81,7 @@ public static IAwaitableCallback<ChangeDescription> Creating(
/// <param name="interceptionCallback">The callback to execute before the <paramref name="fileSystemType" /> is deleted.</param>
/// <param name="globPattern">
/// (optional) The glob pattern that the <paramref name="fileSystemType" /> path must match.<br />
/// Defaults to "**/*" which matches everything.
/// Defaults to "*" which matches everything.
/// </param>
/// <param name="predicate">
/// (optional) A predicate used to filter which callbacks should be intercepted.<br />
Expand All @@ -93,7 +93,7 @@ public static IAwaitableCallback<ChangeDescription> Deleting(
this IInterceptionHandler handler,
FileSystemTypes fileSystemType,
Action<ChangeDescription> interceptionCallback,
string globPattern = "**/*",
string globPattern = "*",
Func<ChangeDescription, bool>? predicate = null)
=> handler.Event(interceptionCallback,
changeDescription => changeDescription.Matches(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static class NotificationHandlerExtensions
/// <param name="notificationCallback">The callback to execute after the <paramref name="fileSystemType" /> was changed.</param>
/// <param name="globPattern">
/// (optional) The glob pattern that the <paramref name="fileSystemType" /> path must match.<br />
/// Defaults to "**/*" which matches everything.
/// Defaults to "*" which matches everything.
/// </param>
/// <param name="predicate">
/// (optional) A predicate used to filter which callbacks should be notified.<br />
Expand All @@ -31,7 +31,7 @@ public static IAwaitableCallback<ChangeDescription>
this INotificationHandler handler,
FileSystemTypes fileSystemType,
Action<ChangeDescription>? notificationCallback = null,
string globPattern = "**/*",
string globPattern = "*",
Func<ChangeDescription, bool>? predicate = null)
=> handler.OnEvent(notificationCallback,
changeDescription => changeDescription.Matches(
Expand All @@ -50,7 +50,7 @@ public static IAwaitableCallback<ChangeDescription>
/// <param name="notificationCallback">The callback to execute after the <paramref name="fileSystemType" /> was created.</param>
/// <param name="globPattern">
/// (optional) The glob pattern that the <paramref name="fileSystemType" /> path must match.<br />
/// Defaults to "**/*" which matches everything.
/// Defaults to "*" which matches everything.
/// </param>
/// <param name="predicate">
/// (optional) A predicate used to filter which callbacks should be notified.<br />
Expand All @@ -62,7 +62,7 @@ public static IAwaitableCallback<ChangeDescription>
this INotificationHandler handler,
FileSystemTypes fileSystemType,
Action<ChangeDescription>? notificationCallback = null,
string globPattern = "**/*",
string globPattern = "*",
Func<ChangeDescription, bool>? predicate = null)
=> handler.OnEvent(notificationCallback,
changeDescription => changeDescription.Matches(
Expand All @@ -81,7 +81,7 @@ public static IAwaitableCallback<ChangeDescription>
/// <param name="notificationCallback">The callback to execute after the <paramref name="fileSystemType" /> was deleted.</param>
/// <param name="globPattern">
/// (optional) The glob pattern that the <paramref name="fileSystemType" /> path must match.<br />
/// Defaults to "**/*" which matches everything.
/// Defaults to "*" which matches everything.
/// </param>
/// <param name="predicate">
/// (optional) A predicate used to filter which callbacks should be notified.<br />
Expand All @@ -93,7 +93,7 @@ public static IAwaitableCallback<ChangeDescription>
this INotificationHandler handler,
FileSystemTypes fileSystemType,
Action<ChangeDescription>? notificationCallback = null,
string globPattern = "**/*",
string globPattern = "*",
Func<ChangeDescription, bool>? predicate = null)
=> handler.OnEvent(notificationCallback,
changeDescription => changeDescription.Matches(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ namespace Testably.Abstractions.Testing
}
public static class InterceptionHandlerExtensions
{
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Changing(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Creating(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Deleting(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Changing(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Creating(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Deleting(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
}
public sealed class MockFileSystem : System.IO.Abstractions.IFileSystem
{
Expand Down Expand Up @@ -168,9 +168,9 @@ namespace Testably.Abstractions.Testing
}
public static class NotificationHandlerExtensions
{
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnChanged(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnCreated(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnDeleted(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnChanged(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnCreated(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnDeleted(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
}
public static class RandomProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ namespace Testably.Abstractions.Testing
}
public static class InterceptionHandlerExtensions
{
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Changing(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Creating(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Deleting(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Changing(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Creating(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> Deleting(this Testably.Abstractions.Testing.FileSystem.IInterceptionHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription> interceptionCallback, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
}
public sealed class MockFileSystem : System.IO.Abstractions.IFileSystem
{
Expand Down Expand Up @@ -168,9 +168,9 @@ namespace Testably.Abstractions.Testing
}
public static class NotificationHandlerExtensions
{
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnChanged(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnCreated(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnDeleted(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "**/*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnChanged(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnCreated(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
public static Testably.Abstractions.Testing.IAwaitableCallback<Testably.Abstractions.Testing.FileSystem.ChangeDescription> OnDeleted(this Testably.Abstractions.Testing.FileSystem.INotificationHandler handler, Testably.Abstractions.Testing.FileSystemTypes fileSystemType, System.Action<Testably.Abstractions.Testing.FileSystem.ChangeDescription>? notificationCallback = null, string globPattern = "*", System.Func<Testably.Abstractions.Testing.FileSystem.ChangeDescription, bool>? predicate = null) { }
}
public static class RandomProvider
{
Expand Down
Loading

0 comments on commit 639f41d

Please sign in to comment.