Skip to content
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 @@ -193,7 +193,7 @@ internal FileStreamMock(MockFileSystem fileSystem,
#if FEATURE_FILESYSTEM_UNIXFILEMODE
,UnixFileMode? unixFileMode = null
#endif
)
)
: this(new MemoryStream(),
fileSystem,
path.EnsureValidFormat(fileSystem, nameof(path)),
Expand All @@ -205,10 +205,11 @@ internal FileStreamMock(MockFileSystem fileSystem,
#if FEATURE_FILESYSTEM_UNIXFILEMODE
,unixFileMode
#endif
)
)
{
}

#pragma warning disable S3776 // Cognitive Complexity of methods should not be too high
private FileStreamMock(MemoryStream stream,
MockFileSystem fileSystem,
string? path,
Expand All @@ -220,7 +221,7 @@ FileOptions options
#if FEATURE_FILESYSTEM_UNIXFILEMODE
,UnixFileMode? unixFileMode
#endif
)
)
: base(
stream,
path == null ? "" : fileSystem.Execute.Path.GetFullPath(path),
Expand Down Expand Up @@ -293,6 +294,7 @@ FileOptions options

InitializeStream();
}
#pragma warning restore S3776 // Cognitive Complexity of methods should not be too high

#region IFileSystemExtensibility Members

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ private void TriggerRenameNotification(ChangeDescription item)
}
}

#pragma warning disable S3776 // Cognitive Complexity of methods should not be too high
private void TriggerWindowsRenameNotification(ChangeDescription item, RenamedContext context)
{
CheckRenamePremise(context);
Expand Down Expand Up @@ -718,6 +719,7 @@ private void TriggerLinuxRenameNotification(ChangeDescription item, RenamedConte
Renamed?.Invoke(this, eventArgs!);
}
}
#pragma warning restore S3776 // Cognitive Complexity of methods should not be too high

private static void CheckRenamePremise(RenamedContext context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ internal IDisposable RegisterMethod<T1, T2, T3, T4, T5, T6>(string name, T1 para

return release;
}

#pragma warning disable S107 // Method has too many parameters
/// <summary>
/// Registers the method <paramref name="name" /> with <paramref name="parameter1" />, <paramref name="parameter2" />,
/// <paramref name="parameter3" />, <paramref name="parameter4" />, <paramref name="parameter5" /> and
Expand All @@ -205,6 +205,7 @@ internal IDisposable RegisterMethod<T1, T2, T3, T4, T5, T6, T7>(string name, T1

return release;
}
#pragma warning restore S107 // Method has too many parameters

#if FEATURE_SPAN
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private static void CheckMethods(StringBuilder builder,
.OrderBy(m => m.Name)
.ThenBy(m => m.GetParameters().Length))
{
if (methodInfo.GetCustomAttribute<ObsoleteAttribute>() != null)
if (methodInfo.IsDefined(typeof(ObsoleteAttribute)))
{
continue;
}
Expand Down Expand Up @@ -125,7 +125,7 @@ private static void CheckProperties(StringBuilder builder,
.Where(p => !p.IsSpecialName && (p.CanRead || p.CanWrite))
.OrderBy(m => m.Name))
{
if (propertyInfo.GetCustomAttribute<ObsoleteAttribute>() != null ||
if (propertyInfo.IsDefined(typeof(ObsoleteAttribute)) ||
string.Equals(propertyInfo.Name, nameof(IFileSystemEntity.FileSystem),
StringComparison.Ordinal))
{
Expand Down
6 changes: 3 additions & 3 deletions Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ await That(ms2.Wait(ExpectSuccess, TestContext.Current.CancellationToken))
{
// Ignore any ObjectDisposedException
}
}, null, TimeSpan.FromMilliseconds(0 * TimerMultiplier),
}, null, TimeSpan.FromMilliseconds(TimerMultiplier),
TimeSpan.FromMilliseconds(200 * TimerMultiplier)))
#pragma warning restore MA0147 // Avoid async void method for delegate
{
Expand All @@ -354,7 +354,7 @@ await That(ms2.Wait(ExpectSuccess, TestContext.Current.CancellationToken))
// ReSharper disable once AccessToDisposedClosure
try
{
timer1.Change(TimeSpan.FromMilliseconds(0 * TimerMultiplier),
timer1.Change(TimeSpan.FromMilliseconds(TimerMultiplier),
TimeSpan.FromMilliseconds(200 * TimerMultiplier));
// ReSharper disable once AccessToDisposedClosure
ms2.Set();
Expand All @@ -364,7 +364,7 @@ await That(ms2.Wait(ExpectSuccess, TestContext.Current.CancellationToken))
// Ignore any ObjectDisposedException
}
}, null, TimeSpan.FromMilliseconds(100 * TimerMultiplier),
TimeSpan.FromMilliseconds(0 * TimerMultiplier));
TimeSpan.FromMilliseconds(TimerMultiplier));

await That(ms3.Wait(ExpectSuccess, TestContext.Current.CancellationToken)).IsTrue();
}
Expand Down
Loading