From 470dbddbcb7155c7ddb0ddaf59ca571cb8213cfa Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 24 Jan 2025 11:37:57 +0100 Subject: [PATCH 1/9] Savepoint --- Directory.Packages.props | 14 +- Feature.Flags.props | 17 +- Source/Directory.Build.props | 2 +- Tests/Directory.Build.props | 12 +- .../AutoDomainDataAttribute.cs | 10 +- .../Testably.Abstractions.TestHelpers/Skip.cs | 53 +++++ .../Testably.Abstractions.TestHelpers.csproj | 3 +- .../SourceGenerationHelper.FileSystem.cs | 13 +- .../SourceGenerationHelper.RandomSystem.cs | 1 - .../SourceGenerationHelper.TimeSystem.cs | 5 +- ....Abstractions.Tests.SourceGenerator.csproj | 6 +- .../AccessControlHelperTests.cs | 6 +- .../DirectoryAclExtensionsTests.cs | 18 +- .../DirectoryInfoAclExtensionsTests.cs | 24 +-- .../ExceptionMissingFileTests.cs | 18 +- .../ExceptionTests.cs | 14 +- .../FileAclExtensionsTests.cs | 16 +- .../FileInfoAclExtensionsTests.cs | 16 +- .../FileStreamAclExtensionsTests.cs | 6 +- .../TestHelpers/Usings.cs | 2 +- .../ZipArchive/ExtensionTests.cs | 22 +-- .../ZipArchive/Tests.cs | 12 +- .../ZipArchiveEntry/ExtensionTests.cs | 14 +- .../ZipArchiveEntry/Tests.cs | 30 +-- .../ZipArchiveFactory/Tests.cs | 10 +- .../ZipFile/CreateFromDirectoryTests.cs | 34 ++-- .../ZipFile/ExtractToDirectoryTests.cs | 30 +-- .../ZipFile/OpenTests.cs | 8 +- .../ZipFile/Tests.cs | 2 +- .../Net48ParityTests.cs | 1 - .../Net6ParityTests.cs | 1 - .../Net7ParityTests.cs | 18 -- .../Net8ParityTests.cs | 1 - .../ParityTests.cs | 1 - .../TestHelpers/ParityCheck.cs | 1 - .../FileSystem/ChangeHandlerTests.cs | 9 +- .../DefaultAccessControlStrategyTests.cs | 4 +- .../DefaultSafeFileHandleStrategyTests.cs | 4 +- .../FileSystem/DriveInfoMockTests.cs | 40 ++-- .../FileSystem/FileMockTests.cs | 4 +- ...leStreamFactoryMockTests.SafeFileHandle.cs | 8 +- .../FileSystem/FileStreamFactoryMockTests.cs | 2 +- .../FileSystemExtensibilityTests.cs | 30 +-- .../FileSystemWatcherFactoryMockTests.cs | 4 +- .../FileSystem/FileSystemWatcherMockTests.cs | 15 +- .../DirectoryCleanerTests.cs | 11 +- .../FileSystemInitializerExtensionsTests.cs | 2 +- ...FilePlatformIndependenceExtensionsTests.cs | 6 +- .../Helpers/PathHelperTests.cs | 4 +- .../MockFileSystemInitializationTests.cs | 6 +- .../MockFileSystemTests.cs | 40 ++-- .../NotificationTests.cs | 18 +- .../RandomSystemExtensibilityTests.cs | 8 +- .../DirectoryInfoFactoryStatisticsTests.cs | 6 +- .../DirectoryInfoStatisticsTests.cs | 112 +++++------ .../FileSystem/DirectoryStatisticsTests.cs | 100 +++++----- .../DriveInfoFactoryStatisticsTests.cs | 8 +- .../FileSystem/DriveInfoStatisticsTests.cs | 22 +-- .../FileInfoFactoryStatisticsTests.cs | 6 +- .../FileSystem/FileInfoStatisticsTests.cs | 98 +++++----- .../FileSystem/FileStatisticsTests.cs | 182 +++++++++--------- .../FileStreamFactoryStatisticsTests.cs | 24 +-- .../FileSystem/FileStreamStatisticsTests.cs | 74 +++---- ...FileSystemWatcherFactoryStatisticsTests.cs | 10 +- .../FileSystemWatcherStatisticsTests.cs | 46 ++--- .../FileVersionInfoFactoryStatisticsTests.cs | 2 +- .../FileVersionInfoStatisticsTests.cs | 54 +++--- .../FileSystem/PathStatisticsTests.cs | 96 ++++----- .../Statistics/StatisticsTests.Helpers.cs | 6 +- .../Storage/LocationExtensionsTests.cs | 14 +- .../TestHelpers/Test.cs | 17 +- .../TestHelpers/Usings.cs | 4 +- ...Testably.Abstractions.Testing.Tests.csproj | 2 + .../TimeSystemExtensibilityTests.cs | 14 +- .../TimeSystem/TimerMockTests.cs | 10 +- .../Directory/CreateDirectoryTests.cs | 30 +-- .../Directory/CreateSymbolicLinkTests.cs | 12 +- .../FileSystem/Directory/DeleteTests.cs | 24 +-- .../Directory/EnumerateDirectoriesTests.cs | 42 ++-- .../EnumerateFileSystemInfosTests.cs | 20 +- .../Directory/EnumerateFilesTests.cs | 30 +-- .../FileSystem/Directory/ExceptionTests.cs | 16 +- .../FileSystem/Directory/ExistsTests.cs | 12 +- .../Directory/GetDirectoriesTests.cs | 20 +- .../Directory/GetDirectoryRootTests.cs | 6 +- .../Directory/GetFileSystemInfosTests.cs | 18 +- .../FileSystem/Directory/GetFilesTests.cs | 30 +-- .../FileSystem/Directory/MoveTests.cs | 20 +- .../Directory/ResolveLinkTargetTests.cs | 18 +- .../FileSystem/Directory/SearchFilterTests.cs | 28 +-- .../FileSystem/Directory/Tests.AdjustTimes.cs | 8 +- .../FileSystem/Directory/Tests.Times.cs | 58 +++--- .../FileSystem/Directory/Tests.cs | 18 +- .../DirectoryInfo/AttributesTests.cs | 8 +- .../CreateAsSymbolicLinkTests.cs | 10 +- .../DirectoryInfo/CreateSubdirectoryTests.cs | 6 +- .../FileSystem/DirectoryInfo/CreateTests.cs | 12 +- .../FileSystem/DirectoryInfo/DeleteTests.cs | 10 +- .../EnumerateDirectoriesTests.cs | 14 +- .../EnumerateFileSystemInfosTests.cs | 16 +- .../DirectoryInfo/EnumerateFilesTests.cs | 16 +- .../DirectoryInfo/ExceptionTests.cs | 17 +- .../FileSystem/DirectoryInfo/ExistsTests.cs | 18 +- .../DirectoryInfo/GetDirectoriesTests.cs | 14 +- .../DirectoryInfo/GetFileSystemInfosTests.cs | 16 +- .../FileSystem/DirectoryInfo/GetFilesTests.cs | 14 +- .../FileSystem/DirectoryInfo/MoveToTests.cs | 10 +- .../FileSystem/DirectoryInfo/Tests.cs | 42 ++-- .../DirectoryInfoFactory/ExceptionTests.cs | 16 +- .../FileSystem/DirectoryInfoFactory/Tests.cs | 12 +- .../FileSystem/DriveInfo/Tests.cs | 4 +- .../DriveInfoFactory/ExceptionTests.cs | 10 +- .../FileSystem/DriveInfoFactory/Tests.cs | 20 +- .../File/AppendAllLinesAsyncTests.cs | 45 +++-- .../FileSystem/File/AppendAllLinesTests.cs | 14 +- .../File/AppendAllTextAsyncTests.cs | 29 +-- .../FileSystem/File/AppendAllTextTests.cs | 18 +- .../FileSystem/File/AppendTextTests.cs | 4 +- .../FileSystem/File/CopyTests.cs | 34 ++-- .../File/CreateSymbolicLinkTests.cs | 6 +- .../FileSystem/File/CreateTests.cs | 14 +- .../FileSystem/File/CreateTextTests.cs | 4 +- .../FileSystem/File/DeleteTests.cs | 6 +- .../FileSystem/File/EncryptDecryptTests.cs | 10 +- .../File/ExceptionMissingFileTests.cs | 8 +- .../FileSystem/File/ExceptionTests.cs | 16 +- .../FileSystem/File/ExistsTests.cs | 6 +- .../FileSystem/File/GetAttributesTests.cs | 2 +- .../FileSystem/File/MoveTests.cs | 24 +-- .../FileSystem/File/OpenReadTests.cs | 29 +-- .../FileSystem/File/OpenTests.cs | 14 +- .../FileSystem/File/OpenTextTests.cs | 4 +- .../FileSystem/File/OpenWriteTests.cs | 8 +- .../FileSystem/File/ReadAllBytesAsyncTests.cs | 6 +- .../FileSystem/File/ReadAllBytesTests.cs | 10 +- .../FileSystem/File/ReadAllLinesAsyncTests.cs | 10 +- .../FileSystem/File/ReadAllLinesTests.cs | 10 +- .../FileSystem/File/ReadAllTextAsyncTests.cs | 8 +- .../FileSystem/File/ReadAllTextTests.cs | 24 +-- .../FileSystem/File/ReadLinesAsyncTests.cs | 28 +-- .../FileSystem/File/ReadLinesTests.cs | 8 +- .../FileSystem/File/ReplaceTests.cs | 24 +-- .../FileSystem/File/ResolveLinkTargetTests.cs | 22 +-- .../FileSystem/File/SetAttributesTests.cs | 4 +- .../FileSystem/File/Tests.cs | 32 +-- .../FileSystem/File/UnixFileModeTests.cs | 10 +- .../File/WriteAllBytesAsyncTests.cs | 30 +-- .../FileSystem/File/WriteAllBytesTests.cs | 10 +- .../File/WriteAllLinesAsyncTests.cs | 32 +-- .../FileSystem/File/WriteAllLinesTests.cs | 16 +- .../FileSystem/File/WriteAllTextAsyncTests.cs | 35 ++-- .../FileSystem/File/WriteAllTextTests.cs | 18 +- .../FileSystem/FileInfo/AppendTextTests.cs | 4 +- .../FileSystem/FileInfo/AttributesTests.cs | 4 +- .../FileSystem/FileInfo/CopyToTests.cs | 22 +-- .../FileInfo/CreateAsSymbolicLinkTests.cs | 22 +-- .../FileSystem/FileInfo/CreateTests.cs | 6 +- .../FileSystem/FileInfo/CreateTextTests.cs | 8 +- .../FileSystem/FileInfo/DeleteTests.cs | 8 +- .../FileInfo/EncryptDecryptTests.cs | 10 +- .../FileSystem/FileInfo/ExceptionTests.cs | 12 +- .../FileSystem/FileInfo/ExistsTests.cs | 6 +- .../FileSystem/FileInfo/LengthTests.cs | 14 +- .../FileSystem/FileInfo/MoveToTests.cs | 24 +-- .../FileSystem/FileInfo/OpenReadTests.cs | 4 +- .../FileSystem/FileInfo/OpenTests.cs | 26 +-- .../FileSystem/FileInfo/OpenTextTests.cs | 4 +- .../FileSystem/FileInfo/OpenWriteTests.cs | 4 +- .../FileSystem/FileInfo/ReplaceTests.cs | 32 +-- .../FileSystem/FileInfo/Tests.cs | 24 +-- .../FileInfoFactory/ExceptionTests.cs | 17 +- .../FileSystem/FileInfoFactory/Tests.cs | 20 +- .../FileSystem/FileStream/AdjustTimesTests.cs | 24 +-- .../FileSystem/FileStream/CopyToTests.cs | 50 +++-- .../FileSystem/FileStream/DisposeTests.cs | 6 +- .../FileSystem/FileStream/FileAccessTests.cs | 18 +- .../FileSystem/FileStream/OptionsTests.cs | 10 +- .../FileSystem/FileStream/ReadTests.cs | 42 ++-- .../FileSystem/FileStream/Tests.cs | 40 ++-- .../FileSystem/FileStream/WriteTests.cs | 32 +-- .../FileStreamFactory/ExceptionTests.cs | 16 +- .../FileStreamFactory/SafeFileHandleTests.cs | 12 +- .../FileSystem/FileStreamFactory/Tests.cs | 20 +- .../CreateAsSymbolicLinkTests.cs | 4 +- .../FileSystemInfo/ExceptionTests.cs | 8 +- .../FileSystemInfo/ResolveLinkTargetTests.cs | 16 +- .../FileSystem/FileSystemInfo/Tests.cs | 16 +- .../FileSystemInfo/UnixFileModeTests.cs | 8 +- .../FileSystemTests.Extensibility.cs | 12 +- .../FileSystem/FileSystemTests.cs | 2 +- .../EnableRaisingEventsTests.cs | 4 +- .../FileSystemWatcher/EventTests.cs | 8 +- .../FileSystemWatcher/FilterTests.cs | 6 +- .../IncludeSubdirectoriesTests.cs | 6 +- .../FileSystemWatcher/NotifyFiltersTests.cs | 32 +-- .../FileSystem/FileSystemWatcher/PathTests.cs | 8 +- .../FileSystem/FileSystemWatcher/Tests.cs | 16 +- .../FileSystemWatcher/WaitForChangedTests.cs | 4 +- .../ExceptionTests.cs | 17 +- .../FileSystemWatcherFactory/Tests.cs | 8 +- .../FileSystem/FileVersionInfo/Tests.cs | 2 +- .../FileVersionInfoFactory/ExceptionTests.cs | 12 +- .../FileVersionInfoFactory/Tests.cs | 4 +- .../FileSystem/Path/ChangeExtensionTests.cs | 14 +- .../FileSystem/Path/CombineTests.cs | 42 ++-- .../Path/EndsInDirectorySeparatorTests.cs | 18 +- .../FileSystem/Path/ExceptionTests.cs | 12 +- .../FileSystem/Path/ExistsTests.cs | 10 +- .../FileSystem/Path/GetDirectoryNameTests.cs | 18 +- .../FileSystem/Path/GetExtensionTests.cs | 12 +- .../FileSystem/Path/GetFileNameTests.cs | 12 +- .../Path/GetFileNameWithoutExtensionTests.cs | 12 +- .../FileSystem/Path/GetFullPathTests.cs | 22 +-- .../FileSystem/Path/GetPathRootTests.cs | 12 +- .../FileSystem/Path/GetRandomFileNameTests.cs | 6 +- .../FileSystem/Path/GetRelativePathTests.cs | 14 +- .../FileSystem/Path/GetTempFileNameTests.cs | 4 +- .../FileSystem/Path/GetTempPathTests.cs | 10 +- .../FileSystem/Path/HasExtensionTests.cs | 6 +- .../Path/IsPathFullyQualifiedTests.cs | 10 +- .../FileSystem/Path/IsPathRootedTests.cs | 4 +- .../FileSystem/Path/JoinTests.cs | 34 ++-- .../FileSystem/Path/Tests.cs | 22 +-- .../Path/TrimEndingDirectorySeparatorTests.cs | 14 +- .../FileSystem/Path/TryJoinTests.cs | 12 +- .../Internal/FileStreamWrapperTests.cs | 1 - .../RandomSystem/GuidTests.cs | 28 +-- .../RandomSystem/RandomFactoryTests.cs | 8 +- .../RandomSystem/RandomTests.cs | 20 +- .../TestHelpers/Usings.cs | 2 +- .../TimeSystem/DateTimeTests.cs | 12 +- .../TimeSystem/TaskTests.cs | 47 +++-- .../TimeSystem/ThreadTests.cs | 8 +- .../TimeSystem/TimerFactoryTests.cs | 14 +- .../TimeSystem/TimerTests.cs | 34 ++-- 235 files changed, 2095 insertions(+), 2023 deletions(-) create mode 100644 Tests/Helpers/Testably.Abstractions.TestHelpers/Skip.cs delete mode 100644 Tests/Testably.Abstractions.Parity.Tests/Net7ParityTests.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index aebc55930..ab1e672bc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -13,13 +13,10 @@ - - - - + @@ -38,15 +35,14 @@ - - + + - - - + + diff --git a/Feature.Flags.props b/Feature.Flags.props index 8fac0f4e1..f798affb0 100644 --- a/Feature.Flags.props +++ b/Feature.Flags.props @@ -1,10 +1,9 @@ - 1 - 1 - 1 - 1 + 1 + 1 + 1 $(DefineConstants);NETFRAMEWORK $(DefineConstants);CAN_SIMULATE_OTHER_OS @@ -25,11 +24,11 @@ $(DefineConstants);FEATURE_RANDOM_ADVANCED $(DefineConstants);FEATURE_FILESYSTEMWATCHER_ADVANCED $(DefineConstants);FEATURE_EXCEPTION_HRESULT - $(DefineConstants);FEATURE_ZIPFILE_NET7 - $(DefineConstants);FEATURE_FILESYSTEM_NET7 - $(DefineConstants);FEATURE_FILESYSTEM_SAFEFILEHANDLE - $(DefineConstants);FEATURE_FILESYSTEM_UNIXFILEMODE - $(DefineConstants);FEATURE_GUID_FORMATPROVIDER + $(DefineConstants);FEATURE_ZIPFILE_NET7 + $(DefineConstants);FEATURE_FILESYSTEM_NET7 + $(DefineConstants);FEATURE_FILESYSTEM_SAFEFILEHANDLE + $(DefineConstants);FEATURE_FILESYSTEM_UNIXFILEMODE + $(DefineConstants);FEATURE_GUID_FORMATPROVIDER $(DefineConstants);FEATURE_RANDOM_ITEMS $(DefineConstants);FEATURE_COMPRESSION_STREAM diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index 3fc706412..81054c19a 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -13,7 +13,7 @@ - net6.0;net7.0;net8.0;netstandard2.1;netstandard2.0 + net6.0;net8.0;netstandard2.1;netstandard2.0 netstandard2.0 diff --git a/Tests/Directory.Build.props b/Tests/Directory.Build.props index 999f3f2d9..9e39f7ee1 100644 --- a/Tests/Directory.Build.props +++ b/Tests/Directory.Build.props @@ -5,8 +5,8 @@ - net6.0;net7.0;net8.0;net48 - net6.0;net7.0;net8.0 + net6.0;net8.0;net48 + net6.0;net8.0 net48 @@ -15,7 +15,8 @@ disable enable false - $(NoWarn);701;1702;CA1845;MA0003;MA0004;MA0018;MA0020;MA0042;MA0076;xUnit1044;xUnit1045;NU1603 + Exe + $(NoWarn);701;1702;CA1845;MA0003;MA0004;MA0018;MA0020;MA0042;MA0076;xUnit1044;xUnit1045;xUnit1051;NU1603 @@ -25,10 +26,9 @@ - + - - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Tests/Helpers/Testably.Abstractions.TestHelpers/AutoDomainDataAttribute.cs b/Tests/Helpers/Testably.Abstractions.TestHelpers/AutoDomainDataAttribute.cs index 9978aee58..557353ca6 100644 --- a/Tests/Helpers/Testably.Abstractions.TestHelpers/AutoDomainDataAttribute.cs +++ b/Tests/Helpers/Testably.Abstractions.TestHelpers/AutoDomainDataAttribute.cs @@ -1,5 +1,5 @@ using AutoFixture; -using AutoFixture.Xunit2; +using AutoFixture.Xunit3; using AutoFixture.AutoNSubstitute; using System; using System.Linq; @@ -13,16 +13,16 @@ namespace Testably.Abstractions.TestHelpers; public class AutoDomainDataAttribute : AutoDataAttribute { private Type? _customizeWith; - private readonly FixtureFactory _fixtureFactory; + private readonly DomainFixtureFactory _fixtureFactory; /// /// Extension of that uses applies domain-specific customizations. /// - public AutoDomainDataAttribute() : this(new FixtureFactory()) + public AutoDomainDataAttribute() : this(new DomainFixtureFactory()) { } - private AutoDomainDataAttribute(FixtureFactory fixtureFactory) + private AutoDomainDataAttribute(DomainFixtureFactory fixtureFactory) : base(fixtureFactory.GetFixtureFactory) { _fixtureFactory = fixtureFactory; @@ -44,7 +44,7 @@ public Type? CustomizeWith } } - private sealed class FixtureFactory + private sealed class DomainFixtureFactory { private ICustomization? _customizeWith; private static Lazy _domainCustomisation { get; } = new(Initialize); diff --git a/Tests/Helpers/Testably.Abstractions.TestHelpers/Skip.cs b/Tests/Helpers/Testably.Abstractions.TestHelpers/Skip.cs new file mode 100644 index 000000000..120093b6c --- /dev/null +++ b/Tests/Helpers/Testably.Abstractions.TestHelpers/Skip.cs @@ -0,0 +1,53 @@ +using System.Runtime.CompilerServices; + +namespace Testably.Abstractions.TestHelpers +{ + + public static class Skip + { + public static void IfNot(bool condition, + [CallerArgumentExpression("condition")] string reason = "") + { + aweXpect.Skip.Unless(condition, reason); + } + + public static void If(bool condition, + [CallerArgumentExpression("condition")] string reason = "") + { + aweXpect.Skip.When(condition, reason); + } + } +} + +#if !NET6_0_OR_GREATER + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// ReSharper disable once CheckNamespace +namespace System.Runtime.CompilerServices +{ + /// + /// Indicates that a parameter captures the expression passed for another parameter as a string. + /// + [AttributeUsage(AttributeTargets.Parameter)] + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + internal sealed class CallerArgumentExpressionAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + /// The name of the parameter whose expression should be captured as a string. + public CallerArgumentExpressionAttribute(string parameterName) + { + ParameterName = parameterName; + } + + /// + /// Gets the name of the parameter whose expression should be captured as a string. + /// + public string ParameterName { get; } + } +} + +#endif diff --git a/Tests/Helpers/Testably.Abstractions.TestHelpers/Testably.Abstractions.TestHelpers.csproj b/Tests/Helpers/Testably.Abstractions.TestHelpers/Testably.Abstractions.TestHelpers.csproj index 26cd2db4d..a68cc3235 100644 --- a/Tests/Helpers/Testably.Abstractions.TestHelpers/Testably.Abstractions.TestHelpers.csproj +++ b/Tests/Helpers/Testably.Abstractions.TestHelpers/Testably.Abstractions.TestHelpers.csproj @@ -7,6 +7,7 @@ $(TargetFrameworks);netstandard2.0 false + Library @@ -18,7 +19,7 @@ - + diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.FileSystem.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.FileSystem.cs index 783b8af91..7b3cacd04 100644 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.FileSystem.cs +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.FileSystem.cs @@ -15,7 +15,6 @@ public static string GenerateFileSystemTestClasses(ClassModel model) using Testably.Abstractions.Testing.Initializer; using Testably.Abstractions.TestHelpers; using Testably.Abstractions.TestHelpers.Settings; - using Xunit.Abstractions; namespace {{model.Namespace}} { @@ -116,12 +115,12 @@ public RealFileSystemTests(ITestOutputHelper testOutputHelper, TestSettingsFixtu #if DEBUG if (fixture.RealFileSystemTests != TestSettingStatus.AlwaysEnabled) { - throw new Xunit.SkipException($"Tests against the real file system are {fixture.RealFileSystemTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.RealFileSystemTests."); + aweXpect.Skip.Test($"Tests against the real file system are {fixture.RealFileSystemTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.RealFileSystemTests."); } #else if (fixture.RealFileSystemTests == TestSettingStatus.AlwaysDisabled) { - throw new Xunit.SkipException($"Tests against the real file system are {fixture.RealFileSystemTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.RealFileSystemTests."); + aweXpect.Skip.Test($"Tests against the real file system are {fixture.RealFileSystemTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.RealFileSystemTests."); } #endif _fixture = fixture; @@ -136,24 +135,24 @@ public void Dispose() #if DEBUG /// public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - => Xunit.Skip.If(condition && _fixture.BrittleTests != TestSettingStatus.AlwaysEnabled, + => aweXpect.Skip.When(condition && _fixture.BrittleTests != TestSettingStatus.AlwaysEnabled, $"Brittle tests are {_fixture.BrittleTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.BrittleTests."); #else /// public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - => Xunit.Skip.If(condition && _fixture.BrittleTests == TestSettingStatus.AlwaysDisabled, + => aweXpect.Skip.When(condition && _fixture.BrittleTests == TestSettingStatus.AlwaysDisabled, $"Brittle tests are {_fixture.BrittleTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.BrittleTests."); #endif #if DEBUG /// public override void SkipIfLongRunningTestsShouldBeSkipped() - => Xunit.Skip.If(_fixture.LongRunningTests != TestSettingStatus.AlwaysEnabled, + => aweXpect.Skip.When(_fixture.LongRunningTests != TestSettingStatus.AlwaysEnabled, $"Long-running tests are {_fixture.LongRunningTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.LongRunningTests."); #else /// public override void SkipIfLongRunningTestsShouldBeSkipped() - => Xunit.Skip.If(_fixture.LongRunningTests == TestSettingStatus.AlwaysDisabled, + => aweXpect.Skip.When(_fixture.LongRunningTests == TestSettingStatus.AlwaysDisabled, $"Long-running tests are {_fixture.LongRunningTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.LongRunningTests."); #endif } diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.RandomSystem.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.RandomSystem.cs index ab3482b66..81715fb6e 100644 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.RandomSystem.cs +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.RandomSystem.cs @@ -11,7 +11,6 @@ public static string GenerateRandomSystemTestClasses(ClassModel model) StringBuilder? sb = GetSourceBuilder(); sb.AppendLine($$""" using Testably.Abstractions.TestHelpers; - using Xunit.Abstractions; namespace {{model.Namespace}} { diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.TimeSystem.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.TimeSystem.cs index 90320cbd1..e86efcdb2 100644 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.TimeSystem.cs +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.TimeSystem.cs @@ -12,7 +12,6 @@ public static string GenerateTimeSystemTestClasses(ClassModel model) sb.AppendLine($$""" using Testably.Abstractions.TestHelpers; using Testably.Abstractions.TestHelpers.Settings; - using Xunit.Abstractions; namespace {{model.Namespace}} { @@ -77,12 +76,12 @@ public RealTimeSystemTests(TestSettingsFixture fixture) : base(new RealTimeSyste #if DEBUG /// public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - => Xunit.Skip.If(condition && _fixture.BrittleTests != TestSettingStatus.AlwaysEnabled, + => aweXpect.Skip.When(condition && _fixture.BrittleTests != TestSettingStatus.AlwaysEnabled, $"Brittle tests are {_fixture.BrittleTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.BrittleTests."); #else /// public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - => Xunit.Skip.If(condition && _fixture.BrittleTests == TestSettingStatus.AlwaysDisabled, + => aweXpect.Skip.When(condition && _fixture.BrittleTests == TestSettingStatus.AlwaysDisabled, $"Brittle tests are {_fixture.BrittleTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.BrittleTests."); #endif } diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Testably.Abstractions.Tests.SourceGenerator.csproj b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Testably.Abstractions.Tests.SourceGenerator.csproj index 2fd8416ca..0b63eecf2 100644 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Testably.Abstractions.Tests.SourceGenerator.csproj +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Testably.Abstractions.Tests.SourceGenerator.csproj @@ -4,6 +4,7 @@ netstandard2.0 false latest + Library true @@ -21,11 +22,10 @@ - + - - + diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/AccessControlHelperTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/AccessControlHelperTests.cs index aa0dd56ec..356ad83b4 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/AccessControlHelperTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/AccessControlHelperTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.AccessControl.Tests; [FileSystemTests] public partial class AccessControlHelperTests { - [SkippableFact] + [Fact] public async Task GetExtensibilityOrThrow_DirectoryInfo_ShouldNotThrow() { IDirectoryInfo sut = FileSystem.DirectoryInfo.New("foo"); @@ -13,7 +13,7 @@ public async Task GetExtensibilityOrThrow_DirectoryInfo_ShouldNotThrow() await That(() => sut.GetExtensibilityOrThrow()).DoesNotThrow(); } - [SkippableFact] + [Fact] public async Task GetExtensibilityOrThrow_FileInfo_ShouldNotThrow() { IFileInfo sut = FileSystem.FileInfo.New("foo"); @@ -21,7 +21,7 @@ public async Task GetExtensibilityOrThrow_FileInfo_ShouldNotThrow() await That(() => sut.GetExtensibilityOrThrow()).DoesNotThrow(); } - [SkippableFact] + [Fact] public async Task GetExtensibilityOrThrow_FileSystemStream_ShouldNotThrow() { FileSystemStream sut = FileSystem.FileStream.New("foo", FileMode.Create); diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs index 2d0df6d33..266d030bb 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs @@ -1,13 +1,13 @@ using System.Security.AccessControl; using Testably.Abstractions.AccessControl.Tests.TestHelpers; -using Skip = Xunit.Skip; +using Skip = Testably.Abstractions.TestHelpers.Skip; namespace Testably.Abstractions.AccessControl.Tests; [FileSystemTests] public partial class DirectoryAclExtensionsTests { - [SkippableFact] + [Fact] public async Task CreateDirectory_NullDirectorySecurity_ShouldThrowArgumentNullException() { Skip.IfNot(Test.RunsOnWindows); @@ -21,7 +21,7 @@ await That(Act).Throws() .WithParamName("directorySecurity"); } - [SkippableTheory] + [Theory] [InlineData("bar")] [InlineData("bar\\foo")] public async Task CreateDirectory_ShouldChangeAccessControl(string path) @@ -39,7 +39,7 @@ public async Task CreateDirectory_ShouldChangeAccessControl(string path) await That(FileSystem.Directory.Exists(path)).IsTrue(); } - [SkippableFact] + [Fact] public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() { Skip.IfNot(Test.RunsOnWindows); @@ -54,7 +54,7 @@ public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_ShouldReturnSetResult() { Skip.IfNot(Test.RunsOnWindows); @@ -75,7 +75,7 @@ public async Task GetAccessControl_ShouldReturnSetResult() #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_ShouldBeInitializedWithNotNullValue() { Skip.IfNot(Test.RunsOnWindows); @@ -91,7 +91,7 @@ public async Task GetAccessControl_WithAccessControlSections_ShouldBeInitialized #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_ShouldReturnSetResult() { Skip.IfNot(Test.RunsOnWindows); @@ -112,7 +112,7 @@ public async Task GetAccessControl_WithAccessControlSections_ShouldReturnSetResu #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task SetAccessControl_ShouldChangeAccessControl() { Skip.IfNot(Test.RunsOnWindows); @@ -131,7 +131,7 @@ await That(currentAccessControl.HasSameAccessRightsAs(originalAccessControl)) .IsTrue(); } - [SkippableFact] + [Fact] public async Task SetAccessControl_ShouldNotUpdateTimes() { Skip.IfNot(Test.RunsOnWindows); diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs index 190a5eba9..e14420574 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs @@ -1,15 +1,15 @@ -using AutoFixture.Xunit2; +using AutoFixture.Xunit3; using System.IO; using System.Security.AccessControl; using Testably.Abstractions.AccessControl.Tests.TestHelpers; -using Skip = Xunit.Skip; +using Skip = Testably.Abstractions.TestHelpers.Skip; namespace Testably.Abstractions.AccessControl.Tests; [FileSystemTests] public partial class DirectoryInfoAclExtensionsTests { - [SkippableFact] + [Fact] public async Task Create_NullDirectorySecurity_ShouldThrowArgumentNullException() { Skip.IfNot(Test.RunsOnWindows); @@ -24,7 +24,7 @@ await That(Act).Throws() .WithParamName("directorySecurity"); } - [SkippableTheory] + [Theory] [InlineData("foo")] [InlineData("foo\\bar")] public async Task Create_ShouldChangeAccessControl(string path) @@ -42,7 +42,7 @@ public async Task Create_ShouldChangeAccessControl(string path) await That(FileSystem.Directory.Exists(path)).IsTrue(); } - [SkippableFact] + [Fact] public async Task GetAccessControl_MissingDirectory_ShouldThrowDirectoryNotFoundException() { Skip.IfNot(Test.RunsOnWindows); @@ -56,7 +56,7 @@ await That(Act).Throws() .WithHResult(-2147024893); } - [SkippableFact] + [Fact] public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() { Skip.IfNot(Test.RunsOnWindows); @@ -71,7 +71,7 @@ public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_ShouldReturnSetResult() { Skip.IfNot(Test.RunsOnWindows); @@ -92,7 +92,7 @@ public async Task GetAccessControl_ShouldReturnSetResult() #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_MissingDirectory_ShouldThrowDirectoryNotFoundException() { @@ -107,7 +107,7 @@ await That(Act).Throws() .WithHResult(-2147024893); } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_ShouldBeInitializedWithNotNullValue() { @@ -124,7 +124,7 @@ public async Task #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_ShouldReturnSetResult() { Skip.IfNot(Test.RunsOnWindows); @@ -145,7 +145,7 @@ public async Task GetAccessControl_WithAccessControlSections_ShouldReturnSetResu #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task SetAccessControl_ShouldChangeAccessControl() { Skip.IfNot(Test.RunsOnWindows); @@ -164,7 +164,7 @@ await That(currentAccessControl.HasSameAccessRightsAs(originalAccessControl)) .IsTrue(); } - [SkippableTheory] + [Theory] [AutoData] public async Task SetAccessControl_ShouldNotUpdateTimes(string path) { diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionMissingFileTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionMissingFileTests.cs index 48cb84b3e..0b14c3212 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionMissingFileTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionMissingFileTests.cs @@ -2,16 +2,16 @@ using System.IO; using System.Linq; using Testably.Abstractions.AccessControl.Tests.TestHelpers; -using Skip = Xunit.Skip; +using Skip = Testably.Abstractions.TestHelpers.Skip; namespace Testably.Abstractions.AccessControl.Tests; [FileSystemTests] public partial class ExceptionMissingFileTests { - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileCallbacks), - parameters: (int)(BaseTypes.Directory | BaseTypes.DirectoryInfo))] + (int)(BaseTypes.Directory | BaseTypes.DirectoryInfo))] public async Task DirectoryOperations_WhenDirectoryIsMissing_ShouldThrowDirectoryNotFoundException( Action callback, BaseTypes baseType, MethodType exceptionType) { @@ -44,9 +44,9 @@ await That(exception).IsNull() } } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileCallbacks), - parameters: (int)(BaseTypes.Directory | BaseTypes.DirectoryInfo))] + (int)(BaseTypes.Directory | BaseTypes.DirectoryInfo))] public async Task DirectoryOperations_WhenFileIsMissing_ShouldThrowFileNotFoundException( Action callback, BaseTypes baseType, MethodType exceptionType) { @@ -79,9 +79,9 @@ await That(exception).IsNull() } } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileCallbacks), - parameters: (int)(BaseTypes.File | BaseTypes.FileInfo | BaseTypes.FileStream))] + (int)(BaseTypes.File | BaseTypes.FileInfo | BaseTypes.FileStream))] public async Task FileOperations_WhenDirectoryIsMissing_ShouldThrowDirectoryNotFoundException( Action callback, BaseTypes baseType, MethodType exceptionType) { @@ -115,9 +115,9 @@ await That(exception).IsNull() } } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileCallbacks), - parameters: (int)(BaseTypes.File | BaseTypes.FileInfo | BaseTypes.FileStream))] + (int)(BaseTypes.File | BaseTypes.FileInfo | BaseTypes.FileStream))] public async Task FileOperations_WhenFileIsMissing_ShouldThrowFileNotFoundException( Action callback, BaseTypes baseType, MethodType exceptionType) { diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionTests.cs index 88d08d5fc..76919efba 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionTests.cs @@ -1,16 +1,16 @@ using System.Collections.Generic; using System.Linq; using System.Security.AccessControl; -using Skip = Xunit.Skip; +using Skip = Testably.Abstractions.TestHelpers.Skip; namespace Testably.Abstractions.AccessControl.Tests; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileCallbacks), - parameters: (int)BaseTypes.All)] + (int)BaseTypes.All)] public async Task Operations_WhenPathIsEmpty_ShouldThrowArgumentException( Action callback, BaseTypes baseType, MethodType exceptionType) { @@ -21,9 +21,9 @@ await That(() => callback.Invoke(FileSystem, "")) .Because($"\n{exceptionType} on {baseType}\n was called with an empty path"); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileCallbacks), - parameters: (int)BaseTypes.All)] + (int)BaseTypes.All)] public async Task Operations_WhenPathIsNull_ShouldThrowArgumentNullException( Action callback, BaseTypes baseType, MethodType exceptionType) { @@ -34,9 +34,9 @@ await That(() => callback.Invoke(FileSystem, null!)) .Because($"\n{exceptionType} on {baseType}\n was called with a null path"); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileCallbacks), - parameters: (int)BaseTypes.All)] + (int)BaseTypes.All)] public async Task Operations_WhenPathIsWhiteSpace_ShouldThrowArgumentException( Action callback, BaseTypes baseType, MethodType exceptionType) { diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/FileAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/FileAclExtensionsTests.cs index c5373c564..aac2689fa 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/FileAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/FileAclExtensionsTests.cs @@ -1,14 +1,14 @@ using System.IO; using System.Security.AccessControl; using Testably.Abstractions.AccessControl.Tests.TestHelpers; -using Skip = Xunit.Skip; +using Skip = Testably.Abstractions.TestHelpers.Skip; namespace Testably.Abstractions.AccessControl.Tests; [FileSystemTests] public partial class FileAclExtensionsTests { - [SkippableFact] + [Fact] public async Task GetAccessControl_MissingFile_ShouldThrowFileNotFoundException() { Skip.IfNot(Test.RunsOnWindows); @@ -24,7 +24,7 @@ await That(Act).Throws() .WithHResult(-2147024894); } - [SkippableFact] + [Fact] public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() { Skip.IfNot(Test.RunsOnWindows); @@ -38,7 +38,7 @@ public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_ShouldReturnSetResult() { Skip.IfNot(Test.RunsOnWindows); @@ -58,7 +58,7 @@ public async Task GetAccessControl_ShouldReturnSetResult() #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_MissingFile_ShouldThrowFileNotFoundException() { @@ -75,7 +75,7 @@ await That(Act).Throws() .WithHResult(-2147024894); } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_ShouldBeInitializedWithNotNullValue() { Skip.IfNot(Test.RunsOnWindows); @@ -90,7 +90,7 @@ public async Task GetAccessControl_WithAccessControlSections_ShouldBeInitialized #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_ShouldReturnSetResult() { Skip.IfNot(Test.RunsOnWindows); @@ -111,7 +111,7 @@ public async Task GetAccessControl_WithAccessControlSections_ShouldReturnSetResu #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task SetAccessControl_ShouldChangeAccessControl() { Skip.IfNot(Test.RunsOnWindows); diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/FileInfoAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/FileInfoAclExtensionsTests.cs index 31b25d020..63b4f2bed 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/FileInfoAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/FileInfoAclExtensionsTests.cs @@ -1,14 +1,14 @@ using System.IO; using System.Security.AccessControl; using Testably.Abstractions.AccessControl.Tests.TestHelpers; -using Skip = Xunit.Skip; +using Skip = Testably.Abstractions.TestHelpers.Skip; namespace Testably.Abstractions.AccessControl.Tests; [FileSystemTests] public partial class FileInfoAclExtensionsTests { - [SkippableFact] + [Fact] public async Task GetAccessControl_MissingFile_ShouldThrowFileNotFoundException() { Skip.IfNot(Test.RunsOnWindows); @@ -25,7 +25,7 @@ await That(Act).Throws() .WithHResult(-2147024894); } - [SkippableFact] + [Fact] public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() { Skip.IfNot(Test.RunsOnWindows); @@ -40,7 +40,7 @@ public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_ShouldReturnSetResult() { Skip.IfNot(Test.RunsOnWindows); @@ -61,7 +61,7 @@ public async Task GetAccessControl_ShouldReturnSetResult() #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_MissingFile_ShouldThrowFileNotFoundException() { @@ -79,7 +79,7 @@ await That(Act).Throws() .WithHResult(-2147024894); } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_ShouldBeInitializedWithNotNullValue() { Skip.IfNot(Test.RunsOnWindows); @@ -95,7 +95,7 @@ public async Task GetAccessControl_WithAccessControlSections_ShouldBeInitialized #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task GetAccessControl_WithAccessControlSections_ShouldReturnSetResult() { Skip.IfNot(Test.RunsOnWindows); @@ -116,7 +116,7 @@ public async Task GetAccessControl_WithAccessControlSections_ShouldReturnSetResu #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task SetAccessControl_ShouldChangeAccessControl() { Skip.IfNot(Test.RunsOnWindows); diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/FileStreamAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/FileStreamAclExtensionsTests.cs index 373420305..ab3f931f7 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/FileStreamAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/FileStreamAclExtensionsTests.cs @@ -1,13 +1,13 @@ using System.Security.AccessControl; using Testably.Abstractions.AccessControl.Tests.TestHelpers; -using Skip = Xunit.Skip; +using Skip = Testably.Abstractions.TestHelpers.Skip; namespace Testably.Abstractions.AccessControl.Tests; [FileSystemTests] public partial class FileStreamAclExtensionsTests { - [SkippableFact] + [Fact] public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() { Skip.IfNot(Test.RunsOnWindows); @@ -21,7 +21,7 @@ public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() #pragma warning restore CA1416 } - [SkippableFact] + [Fact] public async Task SetAccessControl_ShouldChangeAccessControl() { Skip.IfNot(Test.RunsOnWindows); diff --git a/Tests/Testably.Abstractions.Compression.Tests/TestHelpers/Usings.cs b/Tests/Testably.Abstractions.Compression.Tests/TestHelpers/Usings.cs index 77260483c..4de07faf6 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/TestHelpers/Usings.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/TestHelpers/Usings.cs @@ -1,4 +1,4 @@ -global using AutoFixture.Xunit2; +global using AutoFixture.Xunit3; global using System; global using System.Threading.Tasks; global using System.IO.Abstractions; diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/ExtensionTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/ExtensionTests.cs index a0a906506..dd7373e37 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/ExtensionTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/ExtensionTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Compression.Tests.ZipArchive; [FileSystemTests] public partial class ExtensionTests { - [SkippableTheory] + [Theory] [InlineData("2000-01-01T12:14:15")] [InlineData("1980-01-01T00:00:00")] [InlineData("2107-12-31T23:59:59")] @@ -36,7 +36,7 @@ public async Task CreateEntryFromFile_LastWriteTime_ShouldBeCopiedFromFile( await That(entry.LastWriteTime.DateTime).Is(lastWriteTime); } - [SkippableTheory] + [Theory] [InlineData("1930-06-21T14:15:16")] [InlineData("1979-12-31T00:00:00")] [InlineData("2108-01-01T00:00:00")] @@ -67,7 +67,7 @@ public async Task CreateEntryFromFile_LastWriteTimeOutOfRange_ShouldBeFirstJanua await That(entry.LastWriteTime.DateTime).Is(expectedTime); } - [SkippableFact] + [Fact] public async Task CreateEntryFromFile_NullEntryName_ShouldThrowArgumentNullException() { FileSystem.Initialize() @@ -89,7 +89,7 @@ await That(Act).Throws() .WithParamName("entryName"); } - [SkippableFact] + [Fact] public async Task CreateEntryFromFile_NullSourceFileName_ShouldThrowArgumentNullException() { FileSystem.Initialize() @@ -112,7 +112,7 @@ await That(Act).Throws() .WithParamName("sourceFileName"); } - [SkippableFact] + [Fact] public async Task CreateEntryFromFile_ReadOnlyArchive_ShouldThrowNotSupportedException() { FileSystem.Initialize() @@ -133,7 +133,7 @@ void Act() await That(Act).Throws(); } - [SkippableFact] + [Fact] public async Task CreateEntryFromFile_ShouldCreateEntryWithFileContent() { FileSystem.Initialize() @@ -158,7 +158,7 @@ public async Task CreateEntryFromFile_ShouldCreateEntryWithFileContent() await That(FileSystem).HasFile("test.txt").WithContent("FooFooFoo"); } - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_DestinationNull_ShouldThrowArgumentNullException( CompressionLevel compressionLevel) @@ -182,7 +182,7 @@ await That(Act).Throws() } #if FEATURE_COMPRESSION_ADVANCED - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_DestinationNull_WithOverwrite_ShouldThrowArgumentNullException( @@ -206,7 +206,7 @@ void Act() } #endif - [SkippableFact] + [Fact] public async Task ExtractToDirectory_ShouldExtractFilesAndDirectories() { FileSystem.Initialize() @@ -227,7 +227,7 @@ public async Task ExtractToDirectory_ShouldExtractFilesAndDirectories() await That(FileSystem).HasFile("bar/bar.txt"); } - [SkippableFact] + [Fact] public async Task ExtractToDirectory_WithoutOverwrite_ShouldThrowIOException() { FileSystem.Initialize() @@ -253,7 +253,7 @@ await That(FileSystem).HasFile("bar/foo.txt") } #if FEATURE_COMPRESSION_ADVANCED - [SkippableFact] + [Fact] public async Task ExtractToDirectory_WithOverwrite_ShouldOverwriteExistingFile() { FileSystem.Initialize() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/Tests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/Tests.cs index d614a9003..8093c8874 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/Tests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/Tests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Compression.Tests.ZipArchive; public partial class Tests { #if FEATURE_ZIPFILE_NET7 - [SkippableFact] + [Fact] public async Task Comment_ShouldBeInitializedEmpty() { FileSystem.Initialize() @@ -26,7 +26,7 @@ public async Task Comment_ShouldBeInitializedEmpty() } #endif #if FEATURE_ZIPFILE_NET7 - [SkippableTheory] + [Theory] [AutoData] public async Task Comment_ShouldBeSettable(string comment) { @@ -46,7 +46,7 @@ public async Task Comment_ShouldBeSettable(string comment) } #endif - [SkippableFact] + [Fact] public async Task Entries_CreateMode_ShouldThrowNotSupportedException() { using FileSystemStream stream = @@ -59,7 +59,7 @@ public async Task Entries_CreateMode_ShouldThrowNotSupportedException() await That(Act).Throws(); } - [SkippableTheory] + [Theory] [AutoData] public async Task FileSystem_ShouldBeSet( CompressionLevel compressionLevel) @@ -76,7 +76,7 @@ public async Task FileSystem_ShouldBeSet( await That(archive.FileSystem).Is(FileSystem); } - [SkippableFact] + [Fact] public async Task GetEntry_WhenNameIsNotFound_ShouldReturnNull() { FileSystem.Initialize() @@ -94,7 +94,7 @@ public async Task GetEntry_WhenNameIsNotFound_ShouldReturnNull() await That(archive.GetEntry("foo/foo.txt")).IsNotNull(); } - [SkippableTheory] + [Theory] [AutoData] public async Task Mode_ShouldBeSetCorrectly(ZipArchiveMode mode) { diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/ExtensionTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/ExtensionTests.cs index 52b310aa0..1db4a844d 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/ExtensionTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/ExtensionTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Compression.Tests.ZipArchiveEntry; [FileSystemTests] public partial class ExtensionTests { - [SkippableFact] + [Fact] public async Task ExtractToFile_AccessLengthOnWritableStream_ShouldThrowInvalidOperationException() { @@ -29,7 +29,7 @@ void Act() await That(Act).Throws(); } - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToFile_DestinationNull_ShouldThrowArgumentNullException( CompressionLevel compressionLevel) @@ -53,7 +53,7 @@ await That(Act).Throws() .WithParamName("destinationFileName"); } - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToFile_DestinationNull_WithOverwrite_ShouldThrowArgumentNullException( @@ -77,7 +77,7 @@ void Act() await That(Act).Throws(); } - [SkippableFact] + [Fact] public async Task ExtractToFile_IncorrectEntryType_ShouldThrowIOException() { FileSystem.Initialize() @@ -101,7 +101,7 @@ void Act() await That(Act).Throws(); } - [SkippableTheory] + [Theory] [InlineData("2000-01-01T12:14:15")] [InlineData("1980-01-01T00:00:00")] [InlineData("2107-12-31T23:59:59")] @@ -131,7 +131,7 @@ await That(FileSystem).HasFile("bar/bar.txt") .WithLastWriteTime(lastWriteTime); } - [SkippableFact] + [Fact] public async Task ExtractToFile_WithoutOverwrite_ShouldThrowIOException() { FileSystem.Initialize() @@ -157,7 +157,7 @@ await That(FileSystem).HasFile("bar/bar.txt") .WhichContent(f => f.IsNot("FooFooFoo")); } - [SkippableFact] + [Fact] public async Task ExtractToFile_WithOverwrite_ShouldOverwriteExistingFile() { FileSystem.Initialize() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/Tests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/Tests.cs index cc4877aef..3c30ca64e 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/Tests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/Tests.cs @@ -1,14 +1,14 @@ using System.IO; using System.IO.Compression; using System.Linq; -using Skip = Xunit.Skip; +using Skip = Testably.Abstractions.TestHelpers.Skip; namespace Testably.Abstractions.Compression.Tests.ZipArchiveEntry; [FileSystemTests] public partial class Tests { - [SkippableFact] + [Fact] public async Task Archive_ShouldBeSetToArchive() { FileSystem.Initialize() @@ -28,7 +28,7 @@ public async Task Archive_ShouldBeSetToArchive() } #if FEATURE_ZIPFILE_NET7 - [SkippableFact] + [Fact] public async Task Comment_ShouldBeInitializedEmpty() { FileSystem.Initialize() @@ -48,7 +48,7 @@ public async Task Comment_ShouldBeInitializedEmpty() #endif #if FEATURE_ZIPFILE_NET7 - [SkippableTheory] + [Theory] [AutoData] public async Task Comment_ShouldBeSettable(string comment) { @@ -70,7 +70,7 @@ public async Task Comment_ShouldBeSettable(string comment) } #endif - [SkippableFact] + [Fact] public async Task CompressedLength_WithNoCompression_ShouldBeFileLength() { Skip.If(Test.IsNetFramework, "Test is brittle on .NET Framework."); @@ -91,7 +91,7 @@ await That(archive.Entries.Single()) .For(x => x.CompressedLength, l => l.Is(9)); } - [SkippableFact] + [Fact] public async Task CompressedLength_WithOptimalCompressionLevel_ShouldBeLessThanFileLength() { FileSystem.Initialize() @@ -111,7 +111,7 @@ await That(archive.Entries.Single()) } #if FEATURE_COMPRESSION_ADVANCED - [SkippableFact] + [Fact] public async Task Crc32_ShouldBeCalculatedFromTheFileContent() { FileSystem.Initialize() @@ -133,7 +133,7 @@ public async Task Crc32_ShouldBeCalculatedFromTheFileContent() } #endif - [SkippableFact] + [Fact] public async Task Delete_ReadMode_ShouldThrowNotSupportedException() { FileSystem.Initialize() @@ -154,7 +154,7 @@ public async Task Delete_ReadMode_ShouldThrowNotSupportedException() await That(Act).Throws(); } - [SkippableFact] + [Fact] public async Task Delete_ShouldRemoveEntryFromArchive() { FileSystem.Initialize() @@ -176,7 +176,7 @@ public async Task Delete_ShouldRemoveEntryFromArchive() } #if FEATURE_COMPRESSION_ADVANCED - [SkippableTheory] + [Theory] [AutoData] public async Task ExternalAttributes_ShouldBeSettable(int externalAttributes) { @@ -201,7 +201,7 @@ public async Task ExternalAttributes_ShouldBeSettable(int externalAttributes) } #endif - [SkippableFact] + [Fact] public async Task FileSystemExtension_ShouldBeSet() { FileSystem.Initialize() @@ -220,7 +220,7 @@ public async Task FileSystemExtension_ShouldBeSet() await That(entry.FileSystem).Is(FileSystem); } - [SkippableFact] + [Fact] public async Task FullName_ShouldIncludeDirectory() { FileSystem.Initialize() @@ -240,7 +240,7 @@ public async Task FullName_ShouldIncludeDirectory() await That(entry.Name).Is("foo.txt"); } - [SkippableTheory] + [Theory] [AutoData] public async Task LastWriteTime_ReadOnlyArchive_ShouldThrowNotSupportedException( DateTime lastWriteTime) @@ -266,7 +266,7 @@ void Act() await That(Act).Throws(); } - [SkippableTheory] + [Theory] [AutoData] public async Task LastWriteTime_ShouldBeSettable(DateTime lastWriteTime) { @@ -291,7 +291,7 @@ public async Task LastWriteTime_ShouldBeSettable(DateTime lastWriteTime) await That(entry2.LastWriteTime.DateTime).IsNot(lastWriteTime); } - [SkippableFact] + [Fact] public async Task ToString_ShouldBeSetToFileName() { FileSystem.Initialize() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveFactory/Tests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveFactory/Tests.cs index 7cea07341..89c88b466 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveFactory/Tests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Compression.Tests.ZipArchiveFactory; [FileSystemTests] public partial class Tests { - [SkippableFact] + [Fact] public async Task New_ShouldOpenWithReadMode() { FileSystem.Initialize() @@ -25,7 +25,7 @@ public async Task New_ShouldOpenWithReadMode() await That(archive.Entries).Has().Exactly(1).Items(); } - [SkippableFact] + [Fact] public async Task New_UpdateMode_ReadOnlyStream_ShouldThrowArgumentException() { FileSystem.Initialize() @@ -46,7 +46,7 @@ await That(Act).Throws() .WithHResult(-2147024809); } - [SkippableFact] + [Fact] public async Task New_UpdateMode_ShouldOpenArchive() { FileSystem.Initialize() @@ -65,7 +65,7 @@ public async Task New_UpdateMode_ShouldOpenArchive() await That(archive.Entries).Has().Exactly(1).Items(); } - [SkippableTheory] + [Theory] [InlineData(true)] [InlineData(false)] public async Task New_WhenLeaveOpen_ShouldDisposeStreamWhenDisposingArchive(bool leaveOpen) @@ -88,7 +88,7 @@ public async Task New_WhenLeaveOpen_ShouldDisposeStreamWhenDisposingArchive(bool await That(Act).Throws().OnlyIf(!leaveOpen); } - [SkippableTheory] + [Theory] [MemberData(nameof(EntryNameEncoding))] public async Task New_WithEntryNameEncoding_ShouldUseEncoding( string entryName, Encoding encoding, bool encodedCorrectly) diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/CreateFromDirectoryTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/CreateFromDirectoryTests.cs index 15eef5dc3..04448c118 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/CreateFromDirectoryTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/CreateFromDirectoryTests.cs @@ -10,7 +10,7 @@ namespace Testably.Abstractions.Compression.Tests.ZipFile; [FileSystemTests] public partial class CreateFromDirectoryTests { - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_EmptyDirectory_ShouldBeIncluded( @@ -30,7 +30,7 @@ await That(archive.Entries).HasSingle() .Which.For(x => x.FullName, f => f.Is("bar/")); } - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_EmptySource_DoNotIncludeBaseDirectory_ShouldBeEmpty( CompressionLevel compressionLevel) @@ -47,7 +47,7 @@ public async Task CreateFromDirectory_EmptySource_DoNotIncludeBaseDirectory_Shou await That(archive.Entries).IsEmpty(); } - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_EmptySource_IncludeBaseDirectory_ShouldPrependDirectoryName( @@ -66,7 +66,7 @@ await That(archive.Entries).HasSingle() .Which.For(x => x.FullName, f => f.Is("foo/")); } - [SkippableTheory] + [Theory] [MemberData(nameof(EntryNameEncoding))] public async Task CreateFromDirectory_EntryNameEncoding_ShouldUseEncoding( string entryName, Encoding encoding, bool encodedCorrectly) @@ -93,7 +93,7 @@ public async Task CreateFromDirectory_EntryNameEncoding_ShouldUseEncoding( } } - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_IncludeBaseDirectory_ShouldPrependDirectoryName( CompressionLevel compressionLevel) @@ -113,7 +113,7 @@ await That(archive.Entries).HasSingle() } #if FEATURE_COMPRESSION_OVERWRITE - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_Overwrite_WithEncoding_ShouldOverwriteFile( string contents, Encoding encoding) @@ -137,7 +137,7 @@ await That(archive.Entries).HasSingle() } #endif - [SkippableFact] + [Fact] public async Task CreateFromDirectory_ShouldZipDirectoryContent() { FileSystem.Initialize() @@ -156,7 +156,7 @@ await That(FileSystem.File.ReadAllBytes("destination/bar/test.txt")) } #if FEATURE_COMPRESSION_STREAM - [SkippableFact] + [Fact] public async Task CreateFromDirectory_WithReadOnlyStream_ShouldThrowArgumentException() { FileSystem.Initialize() @@ -180,7 +180,7 @@ await That(Act).Throws() #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_WithStream_EmptyDirectory_ShouldBeIncluded( @@ -202,7 +202,7 @@ await That(archive.Entries).HasSingle() #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_WithStream_EmptySource_DoNotIncludeBaseDirectory_ShouldBeEmpty( CompressionLevel compressionLevel) @@ -221,7 +221,7 @@ public async Task CreateFromDirectory_WithStream_EmptySource_DoNotIncludeBaseDir #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_WithStream_EmptySource_IncludeBaseDirectory_ShouldPrependDirectoryName( @@ -242,7 +242,7 @@ await That(archive.Entries).HasSingle() #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [MemberData(nameof(EntryNameEncoding))] public async Task CreateFromDirectory_WithStream_EntryNameEncoding_ShouldUseEncoding( string entryName, Encoding encoding, bool encodedCorrectly) @@ -271,7 +271,7 @@ public async Task CreateFromDirectory_WithStream_EntryNameEncoding_ShouldUseEnco #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_WithStream_IncludeBaseDirectory_ShouldPrependDirectoryName( CompressionLevel compressionLevel) @@ -292,7 +292,7 @@ await That(archive.Entries).HasSingle() #endif #if FEATURE_COMPRESSION_STREAM - [SkippableFact] + [Fact] public async Task CreateFromDirectory_WithStream_NotWritable_ShouldThrowArgumentException() { @@ -311,7 +311,7 @@ await That(Act).Throws() #endif #if FEATURE_COMPRESSION_STREAM - [SkippableFact] + [Fact] public async Task CreateFromDirectory_WithStream_Null_ShouldThrowArgumentNullException() { @@ -328,7 +328,7 @@ await That(Act).Throws() #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [AutoData] public async Task CreateFromDirectory_WithStream_Overwrite_WithEncoding_ShouldOverwriteFile( string contents, Encoding encoding) @@ -354,7 +354,7 @@ await That(archive.Entries).HasSingle() #endif #if FEATURE_COMPRESSION_STREAM - [SkippableFact] + [Fact] public async Task CreateFromDirectory_WithStream_ShouldZipDirectoryContent() { FileSystem.Initialize() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/ExtractToDirectoryTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/ExtractToDirectoryTests.cs index e596e75c7..6fb2a512b 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/ExtractToDirectoryTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/ExtractToDirectoryTests.cs @@ -10,7 +10,7 @@ namespace Testably.Abstractions.Compression.Tests.ZipFile; [FileSystemTests] public partial class ExtractToDirectoryTests { - [SkippableFact] + [Fact] public async Task ExtractToDirectory_MissingDestinationDirectory_ShouldCreateDirectory() { FileSystem.Initialize() @@ -26,7 +26,7 @@ await That(FileSystem.File.ReadAllBytes("bar/test.txt")) .Is(FileSystem.File.ReadAllBytes("foo/test.txt")); } - [SkippableFact] + [Fact] public async Task ExtractToDirectory_MissingSourceFileName_ShouldThrowArgumentNullException() { @@ -42,7 +42,7 @@ await That(Act).Throws() .WithMessage($"*'{FileSystem.Path.GetFullPath(sourceArchiveFileName)}*").AsWildcard(); } - [SkippableFact] + [Fact] public async Task ExtractToDirectory_NullAsSourceFileName_ShouldThrowArgumentNullException() { @@ -59,7 +59,7 @@ await That(Act).Throws() } #if FEATURE_COMPRESSION_OVERWRITE - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_Overwrite_ShouldOverwriteFile( string contents) @@ -82,7 +82,7 @@ await That(FileSystem).HasFile(FileSystem.Path.Combine("bar", "test.txt")) #endif #if FEATURE_COMPRESSION_OVERWRITE - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_WithEncoding_Overwrite_ShouldOverwriteFile( string contents, @@ -105,7 +105,7 @@ await That(FileSystem).HasFile(FileSystem.Path.Combine("bar", "test.txt")) } #endif - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_WithEncoding_ShouldZipDirectoryContent( Encoding encoding) @@ -125,7 +125,7 @@ await That(FileSystem.File.ReadAllBytes(FileSystem.Path.Combine("bar", "test.txt .Is(FileSystem.File.ReadAllBytes(FileSystem.Path.Combine("foo", "test.txt"))); } - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_WithoutOverwriteAndExistingFile_ShouldOverwriteFile( string contents) @@ -154,7 +154,7 @@ await That(FileSystem.File.ReadAllText(destinationPath)) } #if FEATURE_COMPRESSION_STREAM - [SkippableFact] + [Fact] public async Task ExtractToDirectory_WithStream_MissingDestinationDirectory_ShouldCreateDirectory() { FileSystem.Initialize() @@ -173,7 +173,7 @@ await That(FileSystem.File.ReadAllBytes("bar/test.txt")) #endif #if FEATURE_COMPRESSION_STREAM - [SkippableFact] + [Fact] public async Task ExtractToDirectory_WithStream_NotReadable_ShouldThrowArgumentNullException() { @@ -193,7 +193,7 @@ await That(Act).Throws() #endif #if FEATURE_COMPRESSION_STREAM - [SkippableFact] + [Fact] public async Task ExtractToDirectory_WithStream_Null_ShouldThrowArgumentNullException() { @@ -211,7 +211,7 @@ await That(Act).Throws() #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_WithStream_Overwrite_ShouldOverwriteFile( string contents) @@ -235,7 +235,7 @@ await That(FileSystem).HasFile(FileSystem.Path.Combine("bar", "test.txt")) #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_WithStream_WithEncoding_Overwrite_ShouldOverwriteFile( string contents, @@ -260,7 +260,7 @@ await That(FileSystem).HasFile(FileSystem.Path.Combine("bar", "test.txt")) #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_WithStream_WithEncoding_ShouldZipDirectoryContent( Encoding encoding) @@ -283,7 +283,7 @@ await That(FileSystem.File.ReadAllBytes(FileSystem.Path.Combine("bar", "test.txt #endif #if FEATURE_COMPRESSION_STREAM - [SkippableTheory] + [Theory] [AutoData] public async Task ExtractToDirectory_WithStream_WithoutOverwriteAndExistingFile_ShouldOverwriteFile( string contents) @@ -315,7 +315,7 @@ await That(FileSystem.File.ReadAllText(destinationPath)) #endif #if FEATURE_COMPRESSION_STREAM - [SkippableFact] + [Fact] public async Task ExtractToDirectory_WithWriteOnlyStream_ShouldThrowArgumentException() { FileSystem.Initialize() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/OpenTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/OpenTests.cs index 570d0576e..aa28cd633 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/OpenTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/OpenTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Compression.Tests.ZipFile; [FileSystemTests] public partial class OpenTests { - [SkippableFact] + [Fact] public async Task Open_CreateMode_ShouldInitializeEmptyArchive() { IZipArchive archive = FileSystem.ZipFile().Open("destination.zip", ZipArchiveMode.Create); @@ -13,7 +13,7 @@ public async Task Open_CreateMode_ShouldInitializeEmptyArchive() await That(archive.Mode).Is(ZipArchiveMode.Create); } - [SkippableFact] + [Fact] public async Task Open_InvalidMode_ShouldThrowArgumentOutOfRangeException() { ZipArchiveMode invalidMode = (ZipArchiveMode)(-1); @@ -27,7 +27,7 @@ await That(Act).Throws() .WithParamName("mode"); } - [SkippableTheory] + [Theory] [InlineData(ZipArchiveMode.Read)] [InlineData(ZipArchiveMode.Update)] public async Task Open_ShouldOpenExistingArchive(ZipArchiveMode mode) @@ -45,7 +45,7 @@ public async Task Open_ShouldOpenExistingArchive(ZipArchiveMode mode) await That(archive.Entries).Has().Exactly(1).Items(); } - [SkippableFact] + [Fact] public async Task OpenRead_ShouldOpenExistingArchiveInReadMode() { FileSystem.Initialize() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/Tests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/Tests.cs index 30d049fc3..7b3fc1196 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/Tests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/Tests.cs @@ -3,7 +3,7 @@ [FileSystemTests] public partial class Tests { - [SkippableFact] + [Fact] public async Task FileSystemExtension_ShouldBeSet() { IZipFile result = FileSystem.ZipFile(); diff --git a/Tests/Testably.Abstractions.Parity.Tests/Net48ParityTests.cs b/Tests/Testably.Abstractions.Parity.Tests/Net48ParityTests.cs index b001cac65..54bffc9e6 100644 --- a/Tests/Testably.Abstractions.Parity.Tests/Net48ParityTests.cs +++ b/Tests/Testably.Abstractions.Parity.Tests/Net48ParityTests.cs @@ -2,7 +2,6 @@ using System.IO; using System.IO.Compression; using System.Security.AccessControl; -using Xunit.Abstractions; namespace Testably.Abstractions.Parity.Tests; diff --git a/Tests/Testably.Abstractions.Parity.Tests/Net6ParityTests.cs b/Tests/Testably.Abstractions.Parity.Tests/Net6ParityTests.cs index cd8fa5e09..c44cd2e8b 100644 --- a/Tests/Testably.Abstractions.Parity.Tests/Net6ParityTests.cs +++ b/Tests/Testably.Abstractions.Parity.Tests/Net6ParityTests.cs @@ -1,6 +1,5 @@ #if NET6_0 using System.IO; -using Xunit.Abstractions; namespace Testably.Abstractions.Parity.Tests; diff --git a/Tests/Testably.Abstractions.Parity.Tests/Net7ParityTests.cs b/Tests/Testably.Abstractions.Parity.Tests/Net7ParityTests.cs deleted file mode 100644 index 5424be3ab..000000000 --- a/Tests/Testably.Abstractions.Parity.Tests/Net7ParityTests.cs +++ /dev/null @@ -1,18 +0,0 @@ -#if NET7_0 -using System.IO; -using Xunit.Abstractions; - -namespace Testably.Abstractions.Parity.Tests; - -// ReSharper disable once UnusedMember.Global -public class Net7ParityTests : ParityTests -{ - public Net7ParityTests(ITestOutputHelper testOutputHelper) - : base(new TestHelpers.Parity(), testOutputHelper) - { - Parity.File.MissingMethods.Add( - typeof(File).GetMethod(nameof(File.OpenHandle))); - } -} - -#endif diff --git a/Tests/Testably.Abstractions.Parity.Tests/Net8ParityTests.cs b/Tests/Testably.Abstractions.Parity.Tests/Net8ParityTests.cs index a5458ad3f..4ba4882cf 100644 --- a/Tests/Testably.Abstractions.Parity.Tests/Net8ParityTests.cs +++ b/Tests/Testably.Abstractions.Parity.Tests/Net8ParityTests.cs @@ -1,6 +1,5 @@ #if NET8_0 using System.IO; -using Xunit.Abstractions; namespace Testably.Abstractions.Parity.Tests; diff --git a/Tests/Testably.Abstractions.Parity.Tests/ParityTests.cs b/Tests/Testably.Abstractions.Parity.Tests/ParityTests.cs index 825674d63..be73eb6d1 100644 --- a/Tests/Testably.Abstractions.Parity.Tests/ParityTests.cs +++ b/Tests/Testably.Abstractions.Parity.Tests/ParityTests.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Testably.Abstractions.RandomSystem; using Testably.Abstractions.TimeSystem; -using Xunit.Abstractions; using ITimer = Testably.Abstractions.TimeSystem.ITimer; namespace Testably.Abstractions.Parity.Tests; diff --git a/Tests/Testably.Abstractions.Parity.Tests/TestHelpers/ParityCheck.cs b/Tests/Testably.Abstractions.Parity.Tests/TestHelpers/ParityCheck.cs index 7fee72a1d..5618becca 100644 --- a/Tests/Testably.Abstractions.Parity.Tests/TestHelpers/ParityCheck.cs +++ b/Tests/Testably.Abstractions.Parity.Tests/TestHelpers/ParityCheck.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -using Xunit.Abstractions; namespace Testably.Abstractions.Parity.Tests.TestHelpers; #pragma warning disable MA0029 // Combine 'Where' with 'Where' diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/ChangeHandlerTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/ChangeHandlerTests.cs index eb420d4ea..fe739b172 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/ChangeHandlerTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/ChangeHandlerTests.cs @@ -1,5 +1,4 @@ using System.IO; -using Xunit.Abstractions; namespace Testably.Abstractions.Testing.Tests.FileSystem; @@ -11,7 +10,7 @@ public class ChangeHandlerTests(ITestOutputHelper testOutputHelper) #endregion - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_CustomException_ShouldNotCreateDirectory( string path, Exception exceptionToThrow) @@ -30,7 +29,7 @@ public void CreateDirectory_CustomException_ShouldNotCreateDirectory( exception.Should().Be(exceptionToThrow); } - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_CustomException_ShouldOnlyTriggerChangeOccurring( string path, Exception exceptionToThrow) @@ -46,7 +45,7 @@ public void CreateDirectory_CustomException_ShouldOnlyTriggerChangeOccurring( receivedPath!.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_WithParentDirectories_ShouldTriggerNotificationForEachDirectory( @@ -72,7 +71,7 @@ public void eventCount.Should().Be(3); } - [SkippableTheory] + [Theory] [MemberData(nameof(NotificationTriggeringMethods))] public void ExecuteCallback_ShouldTriggerNotification( Action? initialization, diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DefaultAccessControlStrategyTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DefaultAccessControlStrategyTests.cs index 82afe6477..13ed408d0 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DefaultAccessControlStrategyTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DefaultAccessControlStrategyTests.cs @@ -11,7 +11,7 @@ public class DefaultAccessControlStrategyTests #endregion - [SkippableFact] + [Fact] public void Constructor_NullCallback_ShouldThrowArgumentNullException() { Exception? exception = Record.Exception(() => @@ -23,7 +23,7 @@ public void Constructor_NullCallback_ShouldThrowArgumentNullException() .Which.ParamName.Should().Be("callback"); } - [SkippableFact] + [Fact] public void IsAccessGranted_ShouldUseCallback() { DefaultAccessControlStrategy sut = new((p, _) => p.StartsWith('a')); diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DefaultSafeFileHandleStrategyTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DefaultSafeFileHandleStrategyTests.cs index afa1fa39f..ae0786078 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DefaultSafeFileHandleStrategyTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DefaultSafeFileHandleStrategyTests.cs @@ -13,7 +13,7 @@ public class DefaultSafeFileHandleStrategyTests #endregion - [SkippableFact] + [Fact] public void Constructor_NullCallback_ShouldThrowArgumentNullException() { Exception? exception = Record.Exception(() => @@ -25,7 +25,7 @@ public void Constructor_NullCallback_ShouldThrowArgumentNullException() .Which.ParamName.Should().Be("callback"); } - [SkippableFact] + [Fact] public void MapSafeFileHandle_ShouldReturnExpectedValue() { SafeFileHandle fooSafeFileHandle = new(); diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DriveInfoMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DriveInfoMockTests.cs index 0b45e3984..d3837038b 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DriveInfoMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/DriveInfoMockTests.cs @@ -12,7 +12,7 @@ public class DriveInfoMockTests #endregion - [SkippableTheory] + [Theory] [AutoData] public void AvailableFreeSpace_CannotGetNegative(long size) { @@ -24,7 +24,7 @@ public void AvailableFreeSpace_CannotGetNegative(long size) drive.AvailableFreeSpace.Should().Be(size); } - [SkippableTheory] + [Theory] [AutoData] public void AvailableFreeSpace_NotEnoughSpace_ShouldThrowIOException( int fileSize, string path) @@ -44,7 +44,7 @@ public void AvailableFreeSpace_NotEnoughSpace_ShouldThrowIOException( drive.AvailableFreeSpace.Should().Be(fileSize - 1); } - [SkippableTheory] + [Theory] [AutoData] public void AvailableFreeSpace_ShouldBeChangedWhenAppendingToAFile( string fileContent1, string fileContent2, int expectedRemainingBytes, @@ -63,7 +63,7 @@ public void AvailableFreeSpace_ShouldBeChangedWhenAppendingToAFile( drive.AvailableFreeSpace.Should().Be(expectedRemainingBytes); } - [SkippableTheory] + [Theory] [InlineAutoData(0)] [InlineAutoData(1)] [InlineAutoData(10)] @@ -84,7 +84,7 @@ public void AvailableFreeSpace_ShouldBeChangedWhenWorkingWithStreams( drive.AvailableFreeSpace.Should().Be(previousFreeSpace + reduceLength); } - [SkippableTheory] + [Theory] [AutoData] public void AvailableFreeSpace_ShouldBeReducedByWritingToFile( int fileSize, string path) @@ -100,7 +100,7 @@ public void AvailableFreeSpace_ShouldBeReducedByWritingToFile( drive.AvailableFreeSpace.Should().Be(0); } - [SkippableTheory] + [Theory] [AutoData] public void AvailableFreeSpace_ShouldBeReleasedWhenDeletingAFile( int fileSize, string path) @@ -117,7 +117,7 @@ public void AvailableFreeSpace_ShouldBeReleasedWhenDeletingAFile( drive.AvailableFreeSpace.Should().Be(fileSize); } - [SkippableTheory] + [Theory] [AutoData] public void AvailableFreeSpace_ShouldBeSetTotalSize(long size) { @@ -128,7 +128,7 @@ public void AvailableFreeSpace_ShouldBeSetTotalSize(long size) drive.AvailableFreeSpace.Should().Be(size); } - [SkippableTheory] + [Theory] [InlineData(@"//foo", @"//foo")] [InlineData(@"//foo/bar", @"//foo")] [InlineData(@"//foo/bar/xyz", @"//foo")] @@ -144,7 +144,7 @@ public void New_DriveNameWithUncPath_ShouldUseTopMostDirectory( drive.Name.Should().Be(expectedName); } - [SkippableTheory] + [Theory] [InlineData("foo")] public void New_InvalidDriveName_ShouldThrowArgumentException(string driveName) { @@ -156,7 +156,7 @@ public void New_InvalidDriveName_ShouldThrowArgumentException(string driveName) exception.Should().BeOfType(); } - [SkippableFact] + [Fact] public void New_Null_ShouldReturnNull() { IDriveInfo? drive = @@ -165,7 +165,7 @@ public void New_Null_ShouldReturnNull() drive.Should().BeNull(); } - [SkippableFact] + [Fact] public void New_UncPath_ShouldSetFlag() { IDriveInfo drive = @@ -174,7 +174,7 @@ public void New_UncPath_ShouldSetFlag() (drive as DriveInfoMock)?.IsUncPath.Should().BeTrue(); } - [SkippableTheory] + [Theory] [InlineData("C", "C:\\")] [InlineData("d", "D:\\")] public void New_ValidDriveName_ShouldAppendColonAndSlash( @@ -186,7 +186,7 @@ public void New_ValidDriveName_ShouldAppendColonAndSlash( result.Name.Should().Be(expectedDriveName); } - [SkippableTheory] + [Theory] [AutoData] public void NotReady_AccessDirectory_ShouldThrowIOException( string path) @@ -201,7 +201,7 @@ public void NotReady_AccessDirectory_ShouldThrowIOException( exception.Should().BeOfType(); } - [SkippableTheory] + [Theory] [AutoData] public void NotReady_AccessFile_ShouldThrowIOException( string path, string contents) @@ -217,7 +217,7 @@ public void NotReady_AccessFile_ShouldThrowIOException( exception.Should().BeOfType(); } - [SkippableFact] + [Fact] public void SetDriveFormat_Default_ShouldBeNTFS() { FileSystem.WithDrive(d => d.SetDriveFormat()); @@ -226,7 +226,7 @@ public void SetDriveFormat_Default_ShouldBeNTFS() drive.DriveFormat.Should().Be("NTFS"); } - [SkippableTheory] + [Theory] [AutoData] public void SetDriveFormat_ShouldChangeDriveFormat(string driveFormat) { @@ -236,7 +236,7 @@ public void SetDriveFormat_ShouldChangeDriveFormat(string driveFormat) drive.DriveFormat.Should().Be(driveFormat); } - [SkippableFact] + [Fact] public void SetDriveType_Default_ShouldBeFixed() { FileSystem.WithDrive(d => d.SetDriveType()); @@ -245,7 +245,7 @@ public void SetDriveType_Default_ShouldBeFixed() drive.DriveType.Should().Be(DriveType.Fixed); } - [SkippableTheory] + [Theory] [AutoData] public void SetDriveType_ShouldChangeDriveType(DriveType driveType) { @@ -255,7 +255,7 @@ public void SetDriveType_ShouldChangeDriveType(DriveType driveType) drive.DriveType.Should().Be(driveType); } - [SkippableTheory] + [Theory] [InlineData(true)] [InlineData(false)] public void SetIsReady_ShouldChangeIsReady(bool isReady) @@ -266,7 +266,7 @@ public void SetIsReady_ShouldChangeIsReady(bool isReady) drive.IsReady.Should().Be(isReady); } - [SkippableFact] + [Fact] public void SetTotalSize_Default_ShouldBe1Gigabyte() { FileSystem.WithDrive(d => d.SetTotalSize()); diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileMockTests.cs index a30f63cf6..19b267bf5 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileMockTests.cs @@ -29,7 +29,7 @@ public void GetAttributes_SafeFileHandle_WithMissingFile_ShouldThrowFileNotFound } #endif #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableTheory] + [Theory] [AutoData] public void GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows( string path) @@ -220,7 +220,7 @@ public void SetLastWriteTimeUtc_SafeFileHandle_ShouldUpdateValue( #endif #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableTheory] + [Theory] [AutoData] public void SetUnixFileMode_SafeFileHandle_ShouldUpdateValue( string path, UnixFileMode mode) diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileStreamFactoryMockTests.SafeFileHandle.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileStreamFactoryMockTests.SafeFileHandle.cs index 911699fdd..dba2dcd33 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileStreamFactoryMockTests.SafeFileHandle.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileStreamFactoryMockTests.SafeFileHandle.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Testing.Tests.FileSystem; public sealed partial class FileStreamFactoryMockTests { - [SkippableTheory] + [Theory] [AutoData] public void MissingFile_ShouldThrowFileNotFoundException( string path, string contents) @@ -33,7 +33,7 @@ public void MissingFile_ShouldThrowFileNotFoundException( .Which.Message.Should().Contain($"'{MockFileSystem.Path.GetFullPath(path)}'"); } - [SkippableTheory] + [Theory] [AutoData] public void UnregisteredFileHandle_ShouldThrowNotSupportedException( string path, string contents) @@ -55,7 +55,7 @@ public void UnregisteredFileHandle_ShouldThrowNotSupportedException( nameof(MockFileSystem.WithSafeFileHandleStrategy)); } - [SkippableTheory] + [Theory] [AutoData] public void UnregisteredFileHandle_WithBufferSize_ShouldThrowNotSupportedException( string path, string contents, int bufferSize) @@ -77,7 +77,7 @@ public void UnregisteredFileHandle_WithBufferSize_ShouldThrowNotSupportedExcepti nameof(MockFileSystem.WithSafeFileHandleStrategy)); } - [SkippableTheory] + [Theory] [AutoData] public void UnregisteredFileHandle_WithBufferSizeAndIsAsync_ShouldThrowNotSupportedException( diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileStreamFactoryMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileStreamFactoryMockTests.cs index b19992700..bfeb81266 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileStreamFactoryMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileStreamFactoryMockTests.cs @@ -27,7 +27,7 @@ public void Dispose() #endregion - [SkippableTheory] + [Theory] [AutoData] public void Wrap_ShouldThrowNotSupportedException( diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemExtensibilityTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemExtensibilityTests.cs index 386f30cd7..5c7f95f17 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemExtensibilityTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemExtensibilityTests.cs @@ -9,13 +9,13 @@ public class FileSystemExtensibilityTests public static TheoryData GetFileSystems => new() { - new RealFileSystem(), - new MockFileSystem(), + (IFileSystem)new RealFileSystem(), + (IFileSystem)new MockFileSystem(), }; #endregion - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void Directory_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -26,7 +26,7 @@ public void Directory_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void DirectoryInfo_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -37,7 +37,7 @@ public void DirectoryInfo_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void DirectoryInfoFactory_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -48,7 +48,7 @@ public void DirectoryInfoFactory_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void DriveInfo_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -59,7 +59,7 @@ public void DriveInfo_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void DriveInfoFactory_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -70,7 +70,7 @@ public void DriveInfoFactory_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void File_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -81,7 +81,7 @@ public void File_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void FileInfo_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -92,7 +92,7 @@ public void FileInfo_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void FileInfoFactory_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -103,7 +103,7 @@ public void FileInfoFactory_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void FileStreamFactory_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -114,7 +114,7 @@ public void FileStreamFactory_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void FileSystemInfo_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -125,7 +125,7 @@ public void FileSystemInfo_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void FileSystemWatcher_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -136,7 +136,7 @@ public void FileSystemWatcher_ShouldSetExtensionPoint(IFileSystem fileSystem) result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void FileSystemWatcherFactory_ShouldSetExtensionPoint(IFileSystem fileSystem) { @@ -147,7 +147,7 @@ public void FileSystemWatcherFactory_ShouldSetExtensionPoint(IFileSystem fileSys result.Should().BeSameAs(fileSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileSystems))] public void Path_ShouldSetExtensionPoint(IFileSystem fileSystem) { diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherFactoryMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherFactoryMockTests.cs index d5539e695..1a25b17b0 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherFactoryMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherFactoryMockTests.cs @@ -29,7 +29,7 @@ public void Dispose() #endregion - [SkippableTheory] + [Theory] [AutoData] public void Wrap_ShouldUsePropertiesFromFileSystemWatcher( string path, bool includeSubdirectories, NotifyFilters notifyFilter, @@ -56,7 +56,7 @@ public void Wrap_ShouldUsePropertiesFromFileSystemWatcher( } #if FEATURE_FILESYSTEMWATCHER_ADVANCED - [SkippableTheory] + [Theory] [AutoData] public void Wrap_WithFilters_ShouldUsePropertiesFromFileSystemWatcher( string[] filters) diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs index 4572ffc02..f3360a2c7 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs @@ -1,6 +1,7 @@ using System.IO; using System.Threading; using Testably.Abstractions.Testing.Initializer; +using Testably.Abstractions.Testing.Tests.TestHelpers; namespace Testably.Abstractions.Testing.Tests.FileSystem; @@ -32,7 +33,7 @@ public void Dispose() #endregion - [SkippableTheory] + [Theory] [AutoData] public void Error_DefaultTo64Messages_ShouldBeTriggeredWhenBufferOverflows( string path) @@ -87,7 +88,7 @@ public void Error_DefaultTo64Messages_ShouldBeTriggeredWhenBufferOverflows( result!.GetException().Should().BeOfType(); } - [SkippableTheory] + [Theory] [InlineAutoData(4096)] [InlineAutoData(8192)] public void Error_ShouldBeTriggeredWhenBufferOverflows( @@ -146,7 +147,7 @@ public void Error_ShouldBeTriggeredWhenBufferOverflows( } #if FEATURE_FILESYSTEMWATCHER_ADVANCED - [SkippableTheory] + [Theory] [AutoData] public void Filter_ShouldResetFiltersToOnlyContainASingleValue( string[] filters, string expectedFilter) @@ -168,7 +169,7 @@ public void Filter_ShouldResetFiltersToOnlyContainASingleValue( } #endif - [SkippableTheory] + [Theory] [AutoData] public void InternalBufferSize_ShouldResetQueue(string path1, string path2) { @@ -178,7 +179,7 @@ public void InternalBufferSize_ShouldResetQueue(string path1, string path2) FileSystem.FileSystemWatcher.New(BasePath); using ManualResetEventSlim block1 = new(); using ManualResetEventSlim block2 = new(); - ErrorEventArgs result = null; + ErrorEventArgs result = null!; fileSystemWatcher.Error += (_, eventArgs) => { // ReSharper disable once AccessToDisposedClosure @@ -237,7 +238,7 @@ public void InternalBufferSize_ShouldResetQueue(string path1, string path2) #if CAN_SIMULATE_OTHER_OS public sealed class EventArgsTests { - [SkippableTheory] + [Theory] [InlineAutoData(SimulationMode.Linux)] [InlineAutoData(SimulationMode.MacOS)] [InlineAutoData(SimulationMode.Windows)] @@ -280,7 +281,7 @@ public void FileSystemEventArgs_ShouldUseDirectorySeparatorFromSimulatedFileSyst #endif #if CAN_SIMULATE_OTHER_OS - [SkippableTheory] + [Theory] [InlineAutoData(SimulationMode.Linux)] [InlineAutoData(SimulationMode.MacOS)] [InlineAutoData(SimulationMode.Windows)] diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializer/DirectoryCleanerTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializer/DirectoryCleanerTests.cs index 993759f0a..1cd4e3116 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializer/DirectoryCleanerTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializer/DirectoryCleanerTests.cs @@ -2,7 +2,6 @@ using System.IO; using System.Linq; using Testably.Abstractions.Testing.Initializer; -using Testably.Abstractions.Testing.Tests.TestHelpers; namespace Testably.Abstractions.Testing.Tests.FileSystemInitializer; @@ -18,7 +17,7 @@ public DirectoryCleanerTests() #endregion - [SkippableTheory] + [Theory] [AutoData] public void Dispose_PermanentFailure_ShouldNotThrowException( Exception exception) @@ -57,7 +56,7 @@ public void Dispose_PermanentFailure_ShouldNotThrowException( receivedLogs.Should().NotContain("Cleanup was successful :-)"); } - [SkippableFact] + [Fact] public void Dispose_ShouldForceDeleteCurrentDirectory() { MockFileSystem sut = new(); @@ -71,7 +70,7 @@ public void Dispose_ShouldForceDeleteCurrentDirectory() receivedLogs.Should().Contain("Cleanup was successful :-)"); } - [SkippableFact] + [Fact] public void Dispose_ShouldResetCurrentDirectory() { MockFileSystem sut = new(); @@ -82,7 +81,7 @@ public void Dispose_ShouldResetCurrentDirectory() sut.Directory.GetCurrentDirectory().Should().NotBe(currentDirectory); } - [SkippableTheory] + [Theory] [AutoData] public void Dispose_TemporaryFailure_ShouldRetryAgain( Exception exception) @@ -104,7 +103,7 @@ public void Dispose_TemporaryFailure_ShouldRetryAgain( sut.Should().NotHaveDirectory(currentDirectory); } - [SkippableFact] + [Fact] public void InitializeBasePath_ShouldCreateDirectoryAndLogBasePath() { MockFileSystem sut = new(); diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializerExtensionsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializerExtensionsTests.cs index 5b3b399f3..e03ae9271 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializerExtensionsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystemInitializerExtensionsTests.cs @@ -243,7 +243,7 @@ public void result.Should().Contain(x => x.EndsWith("SubResourceFile1.txt")); } - [SkippableTheory] + [Theory] [AutoData] public void InitializeIn_MissingDrive_ShouldCreateDrive(string directoryName) { diff --git a/Tests/Testably.Abstractions.Testing.Tests/Helpers/FilePlatformIndependenceExtensionsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Helpers/FilePlatformIndependenceExtensionsTests.cs index c7b2b16dd..3c0dbe444 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Helpers/FilePlatformIndependenceExtensionsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Helpers/FilePlatformIndependenceExtensionsTests.cs @@ -16,7 +16,7 @@ public void NormalizePath_Null_ShouldReturnNull() path.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void NormalizePath_Unix_RootedPath_ShouldRemoveDriveInfo(string part1) { @@ -31,7 +31,7 @@ public void NormalizePath_Unix_RootedPath_ShouldRemoveDriveInfo(string part1) path.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [AutoData] public void NormalizePath_Unix_ShouldReplaceAltDirectorySeparatorChar( string part1, string part2) @@ -53,7 +53,7 @@ public void NormalizePath_Unix_ShouldReplaceAltDirectorySeparatorChar( } } - [SkippableTheory] + [Theory] [AutoData] public void NormalizePath_Windows_ShouldAlsoKeepAltDirectorySeparatorChar( string part1, string part2) diff --git a/Tests/Testably.Abstractions.Testing.Tests/Helpers/PathHelperTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Helpers/PathHelperTests.cs index e636981f9..2165b444a 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Helpers/PathHelperTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Helpers/PathHelperTests.cs @@ -81,7 +81,7 @@ public void IsUncPath_DirectorySeparatorChar_ShouldReturnTrue(string path) result.Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void IsUncPath_MixedDirectorySeparatorChars_ShouldReturnFalse(string path) { @@ -121,7 +121,7 @@ public void } #if CAN_SIMULATE_OTHER_OS - [SkippableTheory] + [Theory] [InlineData('|')] [InlineData((char)1)] [InlineData((char)31)] diff --git a/Tests/Testably.Abstractions.Testing.Tests/MockFileSystemInitializationTests.cs b/Tests/Testably.Abstractions.Testing.Tests/MockFileSystemInitializationTests.cs index 0295b4658..bb60652ad 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/MockFileSystemInitializationTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/MockFileSystemInitializationTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Testing.Tests; public class MockFileSystemInitializationTests { #if CAN_SIMULATE_OTHER_OS - [SkippableFact] + [Fact] public void MockFileSystem_WhenSimulatingLinux_ShouldBeLinux() { MockFileSystem sut = new(o => o @@ -22,7 +22,7 @@ public void MockFileSystem_WhenSimulatingLinux_ShouldBeLinux() #endif #if CAN_SIMULATE_OTHER_OS - [SkippableFact] + [Fact] public void MockFileSystem_WhenSimulatingMacOS_ShouldBeMac() { MockFileSystem sut = new(o => o @@ -36,7 +36,7 @@ public void MockFileSystem_WhenSimulatingMacOS_ShouldBeMac() #endif #if CAN_SIMULATE_OTHER_OS - [SkippableFact] + [Fact] public void MockFileSystem_WhenSimulatingWindows_ShouldBeWindows() { MockFileSystem sut = new(o => o diff --git a/Tests/Testably.Abstractions.Testing.Tests/MockFileSystemTests.cs b/Tests/Testably.Abstractions.Testing.Tests/MockFileSystemTests.cs index 1f891bdd3..6996e7269 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/MockFileSystemTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/MockFileSystemTests.cs @@ -11,7 +11,7 @@ namespace Testably.Abstractions.Testing.Tests; public class MockFileSystemTests { - [SkippableTheory] + [Theory] [AutoData] public void FileSystemMock_File_Decrypt(string path, string contents) { @@ -28,7 +28,7 @@ public void FileSystemMock_File_Decrypt(string path, string contents) sut.File.ReadAllText(path).Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public void FileSystemMock_File_Encrypt(string path, string contents) { @@ -42,7 +42,7 @@ public void FileSystemMock_File_Encrypt(string path, string contents) sut.File.ReadAllText(path).Should().NotBe(contents); } - [SkippableTheory] + [Theory] [AutoData] public void FileSystemMock_FileInfo_Decrypt(string path, string contents) { @@ -59,7 +59,7 @@ public void FileSystemMock_FileInfo_Decrypt(string path, string contents) sut.File.ReadAllText(path).Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public void FileSystemMock_FileInfo_Encrypt(string path, string contents) { @@ -73,7 +73,7 @@ public void FileSystemMock_FileInfo_Encrypt(string path, string contents) sut.File.ReadAllText(path).Should().NotBe(contents); } - [SkippableFact] + [Fact] public void FileSystemMock_ShouldBeInitializedWithADefaultDrive() { MockFileSystem sut = new(); @@ -92,7 +92,7 @@ public void FileSystemMock_ShouldBeInitializedWithADefaultDrive() drive.VolumeLabel.Should().NotBeNullOrEmpty(); } - [SkippableTheory] + [Theory] [InlineData("A:\\")] [InlineData("G:\\")] [InlineData("z:\\")] @@ -108,7 +108,7 @@ public void FileSystemMock_ShouldInitializeDriveFromCurrentDirectory(string driv drives.Should().Contain(d => d.Name == driveName); } - [SkippableFact] + [Fact] public void ToString_ShouldContainStorageInformation() { MockFileSystem sut = new(); @@ -119,7 +119,7 @@ public void ToString_ShouldContainStorageInformation() result.Should().Contain("directories: 0, files: 1"); } - [SkippableTheory] + [Theory] [AutoData] public void WithAccessControl_Denied_CreateDirectoryShouldThrowIOException( string path) @@ -136,7 +136,7 @@ public void WithAccessControl_Denied_CreateDirectoryShouldThrowIOException( exception.Should().BeOfType(); } - [SkippableTheory] + [Theory] [AutoData] public void WithAccessControl_ShouldConsiderPath( string allowedPath, string deniedPath) @@ -155,7 +155,7 @@ public void WithAccessControl_ShouldConsiderPath( exception.Should().BeOfType(); } - [SkippableTheory] + [Theory] [InlineData("D:\\")] public void WithDrive_Duplicate_ShouldUpdateExistingDrive(string driveName) { @@ -173,7 +173,7 @@ public void WithDrive_Duplicate_ShouldUpdateExistingDrive(string driveName) drive.TotalSize.Should().Be(200); } - [SkippableFact] + [Fact] public void WithDrive_ExistingName_ShouldUpdateDrive() { MockFileSystem sut = new(); @@ -186,7 +186,7 @@ public void WithDrive_ExistingName_ShouldUpdateDrive() drives.Should().ContainSingle(d => d.Name == driveName); } - [SkippableTheory] + [Theory] [InlineData("D:\\")] public void WithDrive_NewName_ShouldCreateNewDrives(string driveName) { @@ -201,7 +201,7 @@ public void WithDrive_NewName_ShouldCreateNewDrives(string driveName) drives.Should().ContainSingle(d => d.Name == driveName); } - [SkippableTheory] + [Theory] [InlineData("D")] [InlineData("D:")] public void WithDrive_ShouldHavePathSeparatorSuffix(string driveName) @@ -218,7 +218,7 @@ public void WithDrive_ShouldHavePathSeparatorSuffix(string driveName) drives.Should().ContainSingle(d => d.Name == expectedDriveName); } - [SkippableTheory] + [Theory] [AutoData] public void WithDrive_WithCallback_ShouldUpdateDrive(long totalSize) { @@ -233,7 +233,7 @@ public void WithDrive_WithCallback_ShouldUpdateDrive(long totalSize) } #if NET6_0_OR_GREATER - [SkippableTheory] + [Theory] [AutoData] public void WithSafeFileHandleStrategy_DefaultStrategy_ShouldUseMappedSafeFileHandleMock( @@ -254,7 +254,7 @@ public void #endif #if NET6_0_OR_GREATER - [SkippableTheory] + [Theory] [AutoData] public void WithSafeFileHandleStrategy_NullStrategy_ShouldThrowException( string path, string contents) @@ -272,7 +272,7 @@ public void WithSafeFileHandleStrategy_NullStrategy_ShouldThrowException( } #endif - [SkippableTheory] + [Theory] [AutoData] public void WithUncDrive_ShouldCreateUncDrive( string path, string contents) @@ -286,7 +286,7 @@ public void WithUncDrive_ShouldCreateUncDrive( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public void WithUncDrive_ShouldNotBeIncludedInGetDrives( string server) @@ -303,7 +303,7 @@ public void WithUncDrive_ShouldNotBeIncludedInGetDrives( sut.DriveInfo.GetDrives().Length.Should().Be(expectedDrives); } - [SkippableTheory] + [Theory] [AutoData] public void WithUncDrive_WriteBytes_ShouldReduceAvailableFreeSpace( string server, string path, byte[] bytes) @@ -320,7 +320,7 @@ public void WithUncDrive_WriteBytes_ShouldReduceAvailableFreeSpace( drive.AvailableFreeSpace.Should().Be(previousFreeSpace - bytes.Length); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_OnUncPath_ShouldThrowDirectoryNotFoundException( string path, string contents) diff --git a/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs b/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs index 98f2a9f3d..8e058391e 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Testing.Tests; public class NotificationTests { - [SkippableFact] + [Fact] public void AwaitableCallback_Amount_ShouldOnlyReturnAfterNumberOfCallbacks() { MockTimeSystem timeSystem = new(); @@ -33,7 +33,7 @@ public void AwaitableCallback_Amount_ShouldOnlyReturnAfterNumberOfCallbacks() receivedCount.Should().BeGreaterOrEqualTo(7); } - [SkippableFact] + [Fact] public async Task AwaitableCallback_Dispose_ShouldStopListening() { MockTimeSystem timeSystem = new(); @@ -51,7 +51,7 @@ public async Task AwaitableCallback_Dispose_ShouldStopListening() isCalled.Should().BeFalse(); } - [SkippableFact] + [Fact] public async Task AwaitableCallback_DisposeFromExecuteWhileWaiting_ShouldStopListening() { MockTimeSystem timeSystem = new(); @@ -71,7 +71,7 @@ public async Task AwaitableCallback_DisposeFromExecuteWhileWaiting_ShouldStopLis isCalled.Should().BeFalse(); } - [SkippableFact] + [Fact] public void AwaitableCallback_Filter_ShouldOnlyUpdateAfterFilteredValue() { MockTimeSystem timeSystem = new(); @@ -96,7 +96,7 @@ public void AwaitableCallback_Filter_ShouldOnlyUpdateAfterFilteredValue() receivedCount.Should().BeGreaterOrEqualTo(6); } - [SkippableFact] + [Fact] public void AwaitableCallback_Predicate_ShouldOnlyUpdateAfterFilteredValue() { MockTimeSystem timeSystem = new(); @@ -131,7 +131,7 @@ public void AwaitableCallback_Predicate_ShouldOnlyUpdateAfterFilteredValue() receivedCount.Should().BeLessOrEqualTo(4); } - [SkippableFact] + [Fact] public void AwaitableCallback_ShouldWaitForCallbackExecution() { using ManualResetEventSlim ms = new(); @@ -171,7 +171,7 @@ public void AwaitableCallback_ShouldWaitForCallbackExecution() } } - [SkippableFact] + [Fact] public void AwaitableCallback_TimeoutExpired_ShouldThrowTimeoutException() { MockTimeSystem timeSystem = new(); @@ -207,7 +207,7 @@ public void AwaitableCallback_TimeoutExpired_ShouldThrowTimeoutException() ms.Set(); } - [SkippableFact] + [Fact] public void AwaitableCallback_Wait_AfterDispose_ShouldThrowObjectDisposedException() { MockTimeSystem timeSystem = new(); @@ -224,7 +224,7 @@ public void AwaitableCallback_Wait_AfterDispose_ShouldThrowObjectDisposedExcepti exception.Should().BeOfType(); } - [SkippableFact] + [Fact] public void AwaitableCallback_WaitedPreviously_ShouldWaitAgainForCallbackExecution() { int secondThreadMilliseconds = 42; diff --git a/Tests/Testably.Abstractions.Testing.Tests/RandomSystem/RandomSystemExtensibilityTests.cs b/Tests/Testably.Abstractions.Testing.Tests/RandomSystem/RandomSystemExtensibilityTests.cs index 1f091c533..c7db3a743 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/RandomSystem/RandomSystemExtensibilityTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/RandomSystem/RandomSystemExtensibilityTests.cs @@ -9,13 +9,13 @@ public class RandomSystemExtensibilityTests public static TheoryData GetRandomSystems => new() { - new RealRandomSystem(), - new MockRandomSystem(), + (IRandomSystem)new RealRandomSystem(), + (IRandomSystem)new MockRandomSystem(), }; #endregion - [SkippableTheory] + [Theory] [MemberData(nameof(GetRandomSystems))] public void Guid_ShouldSetExtensionPoint(IRandomSystem randomSystem) { @@ -26,7 +26,7 @@ public void Guid_ShouldSetExtensionPoint(IRandomSystem randomSystem) result.Should().Be(randomSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetRandomSystems))] public void RandomFactory_ShouldSetExtensionPoint(IRandomSystem randomSystem) { diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryInfoFactoryStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryInfoFactoryStatisticsTests.cs index babdc5ff6..4e103ff12 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryInfoFactoryStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryInfoFactoryStatisticsTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public sealed class DirectoryInfoFactoryStatisticsTests { - [SkippableFact] + [Fact] public void Method_New_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -19,7 +19,7 @@ public void Method_New_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_Wrap_DirectoryInfo_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -32,7 +32,7 @@ public void Method_Wrap_DirectoryInfo_ShouldRegisterCall() directoryInfo); } - [SkippableFact] + [Fact] public void ToString_ShouldBeDirectoryInfo() { IPathStatistics sut diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryInfoStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryInfoStatisticsTests.cs index 586b0b42c..0f0a87440 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryInfoStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryInfoStatisticsTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public sealed class DirectoryInfoStatisticsTests { - [SkippableFact] + [Fact] public void Method_Create_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -19,7 +19,7 @@ public void Method_Create_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Method_CreateAsSymbolicLink_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -34,7 +34,7 @@ public void Method_CreateAsSymbolicLink_String_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_CreateSubdirectory_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -48,7 +48,7 @@ public void Method_CreateSubdirectory_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_Delete_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -63,7 +63,7 @@ public void Method_Delete_Bool_ShouldRegisterCall() recursive); } - [SkippableFact] + [Fact] public void Method_Delete_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -76,7 +76,7 @@ public void Method_Delete_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IDirectoryInfo.Delete)); } - [SkippableFact] + [Fact] public void Method_EnumerateDirectories_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -89,7 +89,7 @@ public void Method_EnumerateDirectories_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_EnumerateDirectories_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -105,7 +105,7 @@ public void Method_EnumerateDirectories_String_EnumerationOptions_ShouldRegister } #endif - [SkippableFact] + [Fact] public void Method_EnumerateDirectories_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -120,7 +120,7 @@ public void Method_EnumerateDirectories_String_SearchOption_ShouldRegisterCall() searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_EnumerateDirectories_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -134,7 +134,7 @@ public void Method_EnumerateDirectories_String_ShouldRegisterCall() searchPattern); } - [SkippableFact] + [Fact] public void Method_EnumerateFiles_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -147,7 +147,7 @@ public void Method_EnumerateFiles_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_EnumerateFiles_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -163,7 +163,7 @@ public void Method_EnumerateFiles_String_EnumerationOptions_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_EnumerateFiles_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -178,7 +178,7 @@ public void Method_EnumerateFiles_String_SearchOption_ShouldRegisterCall() searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_EnumerateFiles_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -192,7 +192,7 @@ public void Method_EnumerateFiles_String_ShouldRegisterCall() searchPattern); } - [SkippableFact] + [Fact] public void Method_EnumerateFileSystemInfos_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -205,7 +205,7 @@ public void Method_EnumerateFileSystemInfos_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_EnumerateFileSystemInfos_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -221,7 +221,7 @@ public void Method_EnumerateFileSystemInfos_String_EnumerationOptions_ShouldRegi } #endif - [SkippableFact] + [Fact] public void Method_EnumerateFileSystemInfos_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -236,7 +236,7 @@ public void Method_EnumerateFileSystemInfos_String_SearchOption_ShouldRegisterCa searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_EnumerateFileSystemInfos_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -250,7 +250,7 @@ public void Method_EnumerateFileSystemInfos_String_ShouldRegisterCall() searchPattern); } - [SkippableFact] + [Fact] public void Method_GetDirectories_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -264,7 +264,7 @@ public void Method_GetDirectories_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_GetDirectories_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -281,7 +281,7 @@ public void Method_GetDirectories_String_EnumerationOptions_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetDirectories_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -297,7 +297,7 @@ public void Method_GetDirectories_String_SearchOption_ShouldRegisterCall() searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_GetDirectories_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -312,7 +312,7 @@ public void Method_GetDirectories_String_ShouldRegisterCall() searchPattern); } - [SkippableFact] + [Fact] public void Method_GetFiles_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -326,7 +326,7 @@ public void Method_GetFiles_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_GetFiles_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -343,7 +343,7 @@ public void Method_GetFiles_String_EnumerationOptions_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetFiles_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -359,7 +359,7 @@ public void Method_GetFiles_String_SearchOption_ShouldRegisterCall() searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_GetFiles_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -374,7 +374,7 @@ public void Method_GetFiles_String_ShouldRegisterCall() searchPattern); } - [SkippableFact] + [Fact] public void Method_GetFileSystemInfos_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -388,7 +388,7 @@ public void Method_GetFileSystemInfos_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_GetFileSystemInfos_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -405,7 +405,7 @@ public void Method_GetFileSystemInfos_String_EnumerationOptions_ShouldRegisterCa } #endif - [SkippableFact] + [Fact] public void Method_GetFileSystemInfos_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -421,7 +421,7 @@ public void Method_GetFileSystemInfos_String_SearchOption_ShouldRegisterCall() searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_GetFileSystemInfos_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -436,7 +436,7 @@ public void Method_GetFileSystemInfos_String_ShouldRegisterCall() searchPattern); } - [SkippableFact] + [Fact] public void Method_MoveTo_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -451,7 +451,7 @@ public void Method_MoveTo_String_ShouldRegisterCall() destDirName); } - [SkippableFact] + [Fact] public void Method_Refresh_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -464,7 +464,7 @@ public void Method_Refresh_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Method_ResolveLinkTarget_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -478,7 +478,7 @@ public void Method_ResolveLinkTarget_Bool_ShouldRegisterCall() returnFinalTarget); } #endif - [SkippableFact] + [Fact] public void Property_Attributes_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -491,7 +491,7 @@ public void Property_Attributes_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.Attributes)); } - [SkippableFact] + [Fact] public void Property_Attributes_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -505,7 +505,7 @@ public void Property_Attributes_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IDirectoryInfo.Attributes)); } - [SkippableFact] + [Fact] public void Property_CreationTime_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -518,7 +518,7 @@ public void Property_CreationTime_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.CreationTime)); } - [SkippableFact] + [Fact] public void Property_CreationTime_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -532,7 +532,7 @@ public void Property_CreationTime_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IDirectoryInfo.CreationTime)); } - [SkippableFact] + [Fact] public void Property_CreationTimeUtc_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -545,7 +545,7 @@ public void Property_CreationTimeUtc_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.CreationTimeUtc)); } - [SkippableFact] + [Fact] public void Property_CreationTimeUtc_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -559,7 +559,7 @@ public void Property_CreationTimeUtc_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IDirectoryInfo.CreationTimeUtc)); } - [SkippableFact] + [Fact] public void Property_Exists_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -572,7 +572,7 @@ public void Property_Exists_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.Exists)); } - [SkippableFact] + [Fact] public void Property_Extension_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -585,7 +585,7 @@ public void Property_Extension_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.Extension)); } - [SkippableFact] + [Fact] public void Property_FullName_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -598,7 +598,7 @@ public void Property_FullName_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.FullName)); } - [SkippableFact] + [Fact] public void Property_LastAccessTime_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -611,7 +611,7 @@ public void Property_LastAccessTime_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.LastAccessTime)); } - [SkippableFact] + [Fact] public void Property_LastAccessTime_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -625,7 +625,7 @@ public void Property_LastAccessTime_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IDirectoryInfo.LastAccessTime)); } - [SkippableFact] + [Fact] public void Property_LastAccessTimeUtc_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -638,7 +638,7 @@ public void Property_LastAccessTimeUtc_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.LastAccessTimeUtc)); } - [SkippableFact] + [Fact] public void Property_LastAccessTimeUtc_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -652,7 +652,7 @@ public void Property_LastAccessTimeUtc_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IDirectoryInfo.LastAccessTimeUtc)); } - [SkippableFact] + [Fact] public void Property_LastWriteTime_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -665,7 +665,7 @@ public void Property_LastWriteTime_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.LastWriteTime)); } - [SkippableFact] + [Fact] public void Property_LastWriteTime_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -679,7 +679,7 @@ public void Property_LastWriteTime_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IDirectoryInfo.LastWriteTime)); } - [SkippableFact] + [Fact] public void Property_LastWriteTimeUtc_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -692,7 +692,7 @@ public void Property_LastWriteTimeUtc_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.LastWriteTimeUtc)); } - [SkippableFact] + [Fact] public void Property_LastWriteTimeUtc_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -707,7 +707,7 @@ public void Property_LastWriteTimeUtc_Set_ShouldRegisterPropertyAccess() } #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Property_LinkTarget_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -721,7 +721,7 @@ public void Property_LinkTarget_Get_ShouldRegisterPropertyAccess() } #endif - [SkippableFact] + [Fact] public void Property_Name_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -734,7 +734,7 @@ public void Property_Name_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.Name)); } - [SkippableFact] + [Fact] public void Property_Parent_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -747,7 +747,7 @@ public void Property_Parent_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDirectoryInfo.Parent)); } - [SkippableFact] + [Fact] public void Property_Root_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -761,7 +761,7 @@ public void Property_Root_Get_ShouldRegisterPropertyAccess() } #if FEATURE_FILESYSTEM_UNIXFILEMODE - [SkippableFact] + [Fact] public void Property_UnixFileMode_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -776,7 +776,7 @@ public void Property_UnixFileMode_Get_ShouldRegisterPropertyAccess() #endif #if FEATURE_FILESYSTEM_UNIXFILEMODE - [SkippableFact] + [Fact] public void Property_UnixFileMode_Set_ShouldRegisterPropertyAccess() { Skip.If(Test.RunsOnWindows); @@ -795,7 +795,7 @@ public void Property_UnixFileMode_Set_ShouldRegisterPropertyAccess() } #endif - [SkippableFact] + [Fact] public void ToString_ShouldBeDirectoryInfoWithPath() { IStatistics sut = new MockFileSystem().Statistics.DirectoryInfo[@"\\some\path"]; diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryStatisticsTests.cs index bae9c6c8f..fd3ed4df9 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DirectoryStatisticsTests.cs @@ -20,7 +20,7 @@ public void Method_CreateDirectory_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_UNIXFILEMODE - [SkippableFact] + [Fact] public void Method_CreateDirectory_String_UnixFileMode_ShouldRegisterCall() { Skip.If(!Test.RunsOnLinux); @@ -38,7 +38,7 @@ public void Method_CreateDirectory_String_UnixFileMode_ShouldRegisterCall() #endif #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Method_CreateSymbolicLink_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -54,7 +54,7 @@ public void Method_CreateSymbolicLink_String_String_ShouldRegisterCall() #endif #if FEATURE_FILESYSTEM_NET7 - [SkippableFact] + [Fact] public void Method_CreateTempSubdirectory_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -69,7 +69,7 @@ public void Method_CreateTempSubdirectory_String_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_Delete_String_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -84,7 +84,7 @@ public void Method_Delete_String_Bool_ShouldRegisterCall() path, recursive); } - [SkippableFact] + [Fact] public void Method_Delete_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -98,7 +98,7 @@ public void Method_Delete_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_EnumerateDirectories_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -113,7 +113,7 @@ public void Method_EnumerateDirectories_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_EnumerateDirectories_String_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -130,7 +130,7 @@ public void Method_EnumerateDirectories_String_String_EnumerationOptions_ShouldR } #endif - [SkippableFact] + [Fact] public void Method_EnumerateDirectories_String_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -146,7 +146,7 @@ public void Method_EnumerateDirectories_String_String_SearchOption_ShouldRegiste path, searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_EnumerateDirectories_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -161,7 +161,7 @@ public void Method_EnumerateDirectories_String_String_ShouldRegisterCall() path, searchPattern); } - [SkippableFact] + [Fact] public void Method_EnumerateFiles_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -175,7 +175,7 @@ public void Method_EnumerateFiles_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_EnumerateFiles_String_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -191,7 +191,7 @@ public void Method_EnumerateFiles_String_String_EnumerationOptions_ShouldRegiste } #endif - [SkippableFact] + [Fact] public void Method_EnumerateFiles_String_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -206,7 +206,7 @@ public void Method_EnumerateFiles_String_String_SearchOption_ShouldRegisterCall( path, searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_EnumerateFiles_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -220,7 +220,7 @@ public void Method_EnumerateFiles_String_String_ShouldRegisterCall() path, searchPattern); } - [SkippableFact] + [Fact] public void Method_EnumerateFileSystemEntries_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -235,7 +235,7 @@ public void Method_EnumerateFileSystemEntries_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_EnumerateFileSystemEntries_String_String_EnumerationOptions_ShouldRegisterCall() { @@ -253,7 +253,7 @@ public void } #endif - [SkippableFact] + [Fact] public void Method_EnumerateFileSystemEntries_String_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -269,7 +269,7 @@ public void Method_EnumerateFileSystemEntries_String_String_SearchOption_ShouldR path, searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_EnumerateFileSystemEntries_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -284,7 +284,7 @@ public void Method_EnumerateFileSystemEntries_String_String_ShouldRegisterCall() path, searchPattern); } - [SkippableFact] + [Fact] public void Method_Exists_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -297,7 +297,7 @@ public void Method_Exists_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetCreationTime_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -310,7 +310,7 @@ public void Method_GetCreationTime_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetCreationTimeUtc_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -323,7 +323,7 @@ public void Method_GetCreationTimeUtc_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetCurrentDirectory_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -335,7 +335,7 @@ public void Method_GetCurrentDirectory_ShouldRegisterCall() nameof(IDirectory.GetCurrentDirectory)); } - [SkippableFact] + [Fact] public void Method_GetDirectories_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -350,7 +350,7 @@ public void Method_GetDirectories_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_GetDirectories_String_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -367,7 +367,7 @@ public void Method_GetDirectories_String_String_EnumerationOptions_ShouldRegiste } #endif - [SkippableFact] + [Fact] public void Method_GetDirectories_String_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -383,7 +383,7 @@ public void Method_GetDirectories_String_String_SearchOption_ShouldRegisterCall( path, searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_GetDirectories_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -398,7 +398,7 @@ public void Method_GetDirectories_String_String_ShouldRegisterCall() path, searchPattern); } - [SkippableFact] + [Fact] public void Method_GetDirectoryRoot_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -411,7 +411,7 @@ public void Method_GetDirectoryRoot_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetFiles_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -426,7 +426,7 @@ public void Method_GetFiles_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_GetFiles_String_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -443,7 +443,7 @@ public void Method_GetFiles_String_String_EnumerationOptions_ShouldRegisterCall( } #endif - [SkippableFact] + [Fact] public void Method_GetFiles_String_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -459,7 +459,7 @@ public void Method_GetFiles_String_String_SearchOption_ShouldRegisterCall() path, searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_GetFiles_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -474,7 +474,7 @@ public void Method_GetFiles_String_String_ShouldRegisterCall() path, searchPattern); } - [SkippableFact] + [Fact] public void Method_GetFileSystemEntries_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -490,7 +490,7 @@ public void Method_GetFileSystemEntries_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void Method_GetFileSystemEntries_String_String_EnumerationOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -508,7 +508,7 @@ public void Method_GetFileSystemEntries_String_String_EnumerationOptions_ShouldR } #endif - [SkippableFact] + [Fact] public void Method_GetFileSystemEntries_String_String_SearchOption_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -525,7 +525,7 @@ public void Method_GetFileSystemEntries_String_String_SearchOption_ShouldRegiste path, searchPattern, searchOption); } - [SkippableFact] + [Fact] public void Method_GetFileSystemEntries_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -541,7 +541,7 @@ public void Method_GetFileSystemEntries_String_String_ShouldRegisterCall() path, searchPattern); } - [SkippableFact] + [Fact] public void Method_GetLastAccessTime_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -554,7 +554,7 @@ public void Method_GetLastAccessTime_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetLastAccessTimeUtc_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -568,7 +568,7 @@ public void Method_GetLastAccessTimeUtc_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetLastWriteTime_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -581,7 +581,7 @@ public void Method_GetLastWriteTime_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetLastWriteTimeUtc_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -594,7 +594,7 @@ public void Method_GetLastWriteTimeUtc_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetLogicalDrives_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -605,7 +605,7 @@ public void Method_GetLogicalDrives_ShouldRegisterCall() sut.Statistics.Directory.ShouldOnlyContainMethodCall(nameof(IDirectory.GetLogicalDrives)); } - [SkippableFact] + [Fact] public void Method_GetParent_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -618,7 +618,7 @@ public void Method_GetParent_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_Move_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -634,7 +634,7 @@ public void Method_Move_String_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Method_ResolveLinkTarget_String_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -649,7 +649,7 @@ public void Method_ResolveLinkTarget_String_Bool_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_SetCreationTime_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -664,7 +664,7 @@ public void Method_SetCreationTime_String_DateTime_ShouldRegisterCall() path, creationTime); } - [SkippableFact] + [Fact] public void Method_SetCreationTimeUtc_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -679,7 +679,7 @@ public void Method_SetCreationTimeUtc_String_DateTime_ShouldRegisterCall() path, creationTimeUtc); } - [SkippableFact] + [Fact] public void Method_SetCurrentDirectory_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -693,7 +693,7 @@ public void Method_SetCurrentDirectory_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_SetLastAccessTime_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -708,7 +708,7 @@ public void Method_SetLastAccessTime_String_DateTime_ShouldRegisterCall() path, lastAccessTime); } - [SkippableFact] + [Fact] public void Method_SetLastAccessTimeUtc_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -724,7 +724,7 @@ public void Method_SetLastAccessTimeUtc_String_DateTime_ShouldRegisterCall() path, lastAccessTimeUtc); } - [SkippableFact] + [Fact] public void Method_SetLastWriteTime_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -739,7 +739,7 @@ public void Method_SetLastWriteTime_String_DateTime_ShouldRegisterCall() path, lastWriteTime); } - [SkippableFact] + [Fact] public void Method_SetLastWriteTimeUtc_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -754,7 +754,7 @@ public void Method_SetLastWriteTimeUtc_String_DateTime_ShouldRegisterCall() path, lastWriteTimeUtc); } - [SkippableFact] + [Fact] public void ToString_ShouldBeDirectory() { IStatistics sut = new MockFileSystem().Statistics.Directory; diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DriveInfoFactoryStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DriveInfoFactoryStatisticsTests.cs index 4eb2a84e9..86aa17e25 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DriveInfoFactoryStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DriveInfoFactoryStatisticsTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public sealed class DriveInfoFactoryStatisticsTests { - [SkippableFact] + [Fact] public void Method_GetDrives_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -18,7 +18,7 @@ public void Method_GetDrives_ShouldRegisterCall() sut.Statistics.DriveInfo.ShouldOnlyContainMethodCall(nameof(IDriveInfoFactory.GetDrives)); } - [SkippableFact] + [Fact] public void Method_New_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -31,7 +31,7 @@ public void Method_New_String_ShouldRegisterCall() driveName); } - [SkippableFact] + [Fact] public void Method_Wrap_DriveInfo_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -44,7 +44,7 @@ public void Method_Wrap_DriveInfo_ShouldRegisterCall() driveInfo); } - [SkippableFact] + [Fact] public void ToString_ShouldBeDriveInfo() { IPathStatistics sut diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DriveInfoStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DriveInfoStatisticsTests.cs index 8bce8a05a..3d7413304 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DriveInfoStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/DriveInfoStatisticsTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public sealed class DriveInfoStatisticsTests { - [SkippableFact] + [Fact] public void Property_AvailableFreeSpace_Get_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -19,7 +19,7 @@ public void Property_AvailableFreeSpace_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDriveInfo.AvailableFreeSpace)); } - [SkippableFact] + [Fact] public void Property_DriveFormat_Get_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -33,7 +33,7 @@ public void Property_DriveFormat_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDriveInfo.DriveFormat)); } - [SkippableFact] + [Fact] public void Property_DriveType_Get_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -47,7 +47,7 @@ public void Property_DriveType_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDriveInfo.DriveType)); } - [SkippableFact] + [Fact] public void Property_IsReady_Get_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -61,7 +61,7 @@ public void Property_IsReady_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDriveInfo.IsReady)); } - [SkippableFact] + [Fact] public void Property_Name_Get_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -74,7 +74,7 @@ public void Property_Name_Get_ShouldRegisterPropertyAccess() sut.Statistics.DriveInfo["F:"].ShouldOnlyContainPropertyGetAccess(nameof(IDriveInfo.Name)); } - [SkippableFact] + [Fact] public void Property_RootDirectory_Get_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -88,7 +88,7 @@ public void Property_RootDirectory_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDriveInfo.RootDirectory)); } - [SkippableFact] + [Fact] public void Property_TotalFreeSpace_Get_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -102,7 +102,7 @@ public void Property_TotalFreeSpace_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDriveInfo.TotalFreeSpace)); } - [SkippableFact] + [Fact] public void Property_TotalSize_Get_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -116,7 +116,7 @@ public void Property_TotalSize_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDriveInfo.TotalSize)); } - [SkippableFact] + [Fact] public void Property_VolumeLabel_Get_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -130,7 +130,7 @@ public void Property_VolumeLabel_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IDriveInfo.VolumeLabel)); } - [SkippableFact] + [Fact] public void Property_VolumeLabel_Set_ShouldRegisterPropertyAccess() { Skip.IfNot(Test.RunsOnWindows); @@ -147,7 +147,7 @@ public void Property_VolumeLabel_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IDriveInfo.VolumeLabel)); } - [SkippableFact] + [Fact] public void ToString_ShouldBeDriveInfoWithPath() { IStatistics sut = new MockFileSystem().Statistics.DriveInfo[@"x:"]; diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileInfoFactoryStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileInfoFactoryStatisticsTests.cs index 78e182168..0685c9b87 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileInfoFactoryStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileInfoFactoryStatisticsTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public class FileInfoFactoryStatisticsTests { - [SkippableFact] + [Fact] public void Method_New_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -19,7 +19,7 @@ public void Method_New_String_ShouldRegisterCall() fileName); } - [SkippableFact] + [Fact] public void Method_Wrap_FileInfo_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -32,7 +32,7 @@ public void Method_Wrap_FileInfo_ShouldRegisterCall() fileInfo); } - [SkippableFact] + [Fact] public void ToString_ShouldBeFileInfo() { IPathStatistics sut diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileInfoStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileInfoStatisticsTests.cs index b59b6b0ae..befd46ed6 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileInfoStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileInfoStatisticsTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public class FileInfoStatisticsTests { - [SkippableFact] + [Fact] public void Method_AppendText_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -18,7 +18,7 @@ public void Method_AppendText_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileInfo.AppendText)); } - [SkippableFact] + [Fact] public void Method_CopyTo_String_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -34,7 +34,7 @@ public void Method_CopyTo_String_Bool_ShouldRegisterCall() destFileName, overwrite); } - [SkippableFact] + [Fact] public void Method_CopyTo_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -49,7 +49,7 @@ public void Method_CopyTo_String_ShouldRegisterCall() destFileName); } - [SkippableFact] + [Fact] public void Method_Create_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -62,7 +62,7 @@ public void Method_Create_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Method_CreateAsSymbolicLink_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -77,7 +77,7 @@ public void Method_CreateAsSymbolicLink_String_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_CreateText_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -89,7 +89,7 @@ public void Method_CreateText_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileInfo.CreateText)); } - [SkippableFact] + [Fact] public void Method_Decrypt_ShouldRegisterCall() { Skip.If(!Test.RunsOnWindows); @@ -105,7 +105,7 @@ public void Method_Decrypt_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileInfo.Decrypt)); } - [SkippableFact] + [Fact] public void Method_Delete_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -118,7 +118,7 @@ public void Method_Delete_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileInfo.Delete)); } - [SkippableFact] + [Fact] public void Method_Encrypt_ShouldRegisterCall() { Skip.If(!Test.RunsOnWindows); @@ -135,7 +135,7 @@ public void Method_Encrypt_ShouldRegisterCall() } #if FEATURE_FILE_MOVETO_OVERWRITE - [SkippableFact] + [Fact] public void Method_MoveTo_String_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -152,7 +152,7 @@ public void Method_MoveTo_String_Bool_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_MoveTo_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -167,7 +167,7 @@ public void Method_MoveTo_String_ShouldRegisterCall() destFileName); } - [SkippableFact] + [Fact] public void Method_Open_FileMode_FileAccess_FileShare_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -183,7 +183,7 @@ public void Method_Open_FileMode_FileAccess_FileShare_ShouldRegisterCall() mode, access, share); } - [SkippableFact] + [Fact] public void Method_Open_FileMode_FileAccess_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -198,7 +198,7 @@ public void Method_Open_FileMode_FileAccess_ShouldRegisterCall() mode, access); } - [SkippableFact] + [Fact] public void Method_Open_FileMode_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -213,7 +213,7 @@ public void Method_Open_FileMode_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_STREAM_OPTIONS - [SkippableFact] + [Fact] public void Method_Open_FileStreamOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -229,7 +229,7 @@ public void Method_Open_FileStreamOptions_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_OpenRead_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -242,7 +242,7 @@ public void Method_OpenRead_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileInfo.OpenRead)); } - [SkippableFact] + [Fact] public void Method_OpenText_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -255,7 +255,7 @@ public void Method_OpenText_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileInfo.OpenText)); } - [SkippableFact] + [Fact] public void Method_OpenWrite_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -267,7 +267,7 @@ public void Method_OpenWrite_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileInfo.OpenWrite)); } - [SkippableFact] + [Fact] public void Method_Refresh_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -279,7 +279,7 @@ public void Method_Refresh_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileInfo.Refresh)); } - [SkippableFact] + [Fact] public void Method_Replace_String_String_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -297,7 +297,7 @@ public void Method_Replace_String_String_Bool_ShouldRegisterCall() destinationFileName, destinationBackupFileName, ignoreMetadataErrors); } - [SkippableFact] + [Fact] public void Method_Replace_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -314,7 +314,7 @@ public void Method_Replace_String_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Method_ResolveLinkTarget_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -330,7 +330,7 @@ public void Method_ResolveLinkTarget_Bool_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Property_Attributes_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -343,7 +343,7 @@ public void Property_Attributes_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.Attributes)); } - [SkippableFact] + [Fact] public void Property_Attributes_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -357,7 +357,7 @@ public void Property_Attributes_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileInfo.Attributes)); } - [SkippableFact] + [Fact] public void Property_CreationTime_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -370,7 +370,7 @@ public void Property_CreationTime_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.CreationTime)); } - [SkippableFact] + [Fact] public void Property_CreationTime_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -384,7 +384,7 @@ public void Property_CreationTime_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileInfo.CreationTime)); } - [SkippableFact] + [Fact] public void Property_CreationTimeUtc_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -397,7 +397,7 @@ public void Property_CreationTimeUtc_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.CreationTimeUtc)); } - [SkippableFact] + [Fact] public void Property_CreationTimeUtc_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -411,7 +411,7 @@ public void Property_CreationTimeUtc_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileInfo.CreationTimeUtc)); } - [SkippableFact] + [Fact] public void Property_Directory_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -424,7 +424,7 @@ public void Property_Directory_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.Directory)); } - [SkippableFact] + [Fact] public void Property_DirectoryName_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -437,7 +437,7 @@ public void Property_DirectoryName_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.DirectoryName)); } - [SkippableFact] + [Fact] public void Property_Exists_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -449,7 +449,7 @@ public void Property_Exists_Get_ShouldRegisterPropertyAccess() sut.Statistics.FileInfo["foo"].ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.Exists)); } - [SkippableFact] + [Fact] public void Property_Extension_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -462,7 +462,7 @@ public void Property_Extension_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.Extension)); } - [SkippableFact] + [Fact] public void Property_FullName_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -475,7 +475,7 @@ public void Property_FullName_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.FullName)); } - [SkippableFact] + [Fact] public void Property_IsReadOnly_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -488,7 +488,7 @@ public void Property_IsReadOnly_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.IsReadOnly)); } - [SkippableFact] + [Fact] public void Property_IsReadOnly_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -502,7 +502,7 @@ public void Property_IsReadOnly_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileInfo.IsReadOnly)); } - [SkippableFact] + [Fact] public void Property_LastAccessTime_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -515,7 +515,7 @@ public void Property_LastAccessTime_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.LastAccessTime)); } - [SkippableFact] + [Fact] public void Property_LastAccessTime_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -529,7 +529,7 @@ public void Property_LastAccessTime_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileInfo.LastAccessTime)); } - [SkippableFact] + [Fact] public void Property_LastAccessTimeUtc_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -542,7 +542,7 @@ public void Property_LastAccessTimeUtc_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.LastAccessTimeUtc)); } - [SkippableFact] + [Fact] public void Property_LastAccessTimeUtc_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -556,7 +556,7 @@ public void Property_LastAccessTimeUtc_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileInfo.LastAccessTimeUtc)); } - [SkippableFact] + [Fact] public void Property_LastWriteTime_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -569,7 +569,7 @@ public void Property_LastWriteTime_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.LastWriteTime)); } - [SkippableFact] + [Fact] public void Property_LastWriteTime_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -583,7 +583,7 @@ public void Property_LastWriteTime_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileInfo.LastWriteTime)); } - [SkippableFact] + [Fact] public void Property_LastWriteTimeUtc_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -596,7 +596,7 @@ public void Property_LastWriteTimeUtc_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileInfo.LastWriteTimeUtc)); } - [SkippableFact] + [Fact] public void Property_LastWriteTimeUtc_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -610,7 +610,7 @@ public void Property_LastWriteTimeUtc_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileInfo.LastWriteTimeUtc)); } - [SkippableFact] + [Fact] public void Property_Length_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -623,7 +623,7 @@ public void Property_Length_Get_ShouldRegisterPropertyAccess() } #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Property_LinkTarget_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -637,7 +637,7 @@ public void Property_LinkTarget_Get_ShouldRegisterPropertyAccess() } #endif - [SkippableFact] + [Fact] public void Property_Name_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -650,7 +650,7 @@ public void Property_Name_Get_ShouldRegisterPropertyAccess() } #if FEATURE_FILESYSTEM_UNIXFILEMODE - [SkippableFact] + [Fact] public void Property_UnixFileMode_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -665,7 +665,7 @@ public void Property_UnixFileMode_Get_ShouldRegisterPropertyAccess() #endif #if FEATURE_FILESYSTEM_UNIXFILEMODE - [SkippableFact] + [Fact] public void Property_UnixFileMode_Set_ShouldRegisterPropertyAccess() { Skip.If(Test.RunsOnWindows); @@ -684,7 +684,7 @@ public void Property_UnixFileMode_Set_ShouldRegisterPropertyAccess() } #endif - [SkippableFact] + [Fact] public void ToString_ShouldBeFileInfoWithPath() { IStatistics sut = new MockFileSystem().Statistics.FileInfo[@"\\some\path"]; diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStatisticsTests.cs index 3b7f19a98..11f14feb0 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStatisticsTests.cs @@ -17,7 +17,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public sealed class FileStatisticsTests { - [SkippableFact] + [Fact] public void Method_AppendAllLines_String_IEnumerableString_Encoding_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -32,7 +32,7 @@ public void Method_AppendAllLines_String_IEnumerableString_Encoding_ShouldRegist path, contents, encoding); } - [SkippableFact] + [Fact] public void Method_AppendAllLines_String_IEnumerableString_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -47,7 +47,7 @@ public void Method_AppendAllLines_String_IEnumerableString_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_AppendAllLinesAsync_String_IEnumerableString_CancellationToken_ShouldRegisterCall() { @@ -65,7 +65,7 @@ public async Task #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_AppendAllLinesAsync_String_IEnumerableString_Encoding_CancellationToken_ShouldRegisterCall() { @@ -83,7 +83,7 @@ public async Task } #endif - [SkippableFact] + [Fact] public void Method_AppendAllText_String_String_Encoding_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -98,7 +98,7 @@ public void Method_AppendAllText_String_String_Encoding_ShouldRegisterCall() path, contents, encoding); } - [SkippableFact] + [Fact] public void Method_AppendAllText_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -113,7 +113,7 @@ public void Method_AppendAllText_String_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_AppendAllTextAsync_String_String_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -130,7 +130,7 @@ public async Task Method_AppendAllTextAsync_String_String_CancellationToken_Shou #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_AppendAllTextAsync_String_String_Encoding_CancellationToken_ShouldRegisterCall() { @@ -148,7 +148,7 @@ public async Task } #endif - [SkippableFact] + [Fact] public void Method_AppendText_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -161,7 +161,7 @@ public void Method_AppendText_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_Copy_String_String_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -177,7 +177,7 @@ public void Method_Copy_String_String_Bool_ShouldRegisterCall() sourceFileName, destFileName, overwrite); } - [SkippableFact] + [Fact] public void Method_Copy_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -192,7 +192,7 @@ public void Method_Copy_String_String_ShouldRegisterCall() sourceFileName, destFileName); } - [SkippableFact] + [Fact] public void Method_Create_String_Int_FileOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -207,7 +207,7 @@ public void Method_Create_String_Int_FileOptions_ShouldRegisterCall() path, bufferSize, options); } - [SkippableFact] + [Fact] public void Method_Create_String_Int_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -221,7 +221,7 @@ public void Method_Create_String_Int_ShouldRegisterCall() path, bufferSize); } - [SkippableFact] + [Fact] public void Method_Create_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -235,7 +235,7 @@ public void Method_Create_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Method_CreateSymbolicLink_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -250,7 +250,7 @@ public void Method_CreateSymbolicLink_String_String_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_CreateText_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -263,7 +263,7 @@ public void Method_CreateText_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_Decrypt_String_ShouldRegisterCall() { Skip.If(!Test.RunsOnWindows); @@ -281,7 +281,7 @@ public void Method_Decrypt_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_Delete_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -295,7 +295,7 @@ public void Method_Delete_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_Encrypt_String_ShouldRegisterCall() { Skip.If(!Test.RunsOnWindows); @@ -313,7 +313,7 @@ public void Method_Encrypt_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_Exists_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -327,7 +327,7 @@ public void Method_Exists_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_GetAttributes_SafeFileHandle_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -344,7 +344,7 @@ public void Method_GetAttributes_SafeFileHandle_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetAttributes_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -359,7 +359,7 @@ public void Method_GetAttributes_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_GetCreationTime_SafeFileHandle_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -376,7 +376,7 @@ public void Method_GetCreationTime_SafeFileHandle_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetCreationTime_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -391,7 +391,7 @@ public void Method_GetCreationTime_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_GetCreationTimeUtc_SafeFileHandle_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -408,7 +408,7 @@ public void Method_GetCreationTimeUtc_SafeFileHandle_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetCreationTimeUtc_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -423,7 +423,7 @@ public void Method_GetCreationTimeUtc_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_GetLastAccessTime_SafeFileHandle_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -440,7 +440,7 @@ public void Method_GetLastAccessTime_SafeFileHandle_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetLastAccessTime_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -455,7 +455,7 @@ public void Method_GetLastAccessTime_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_GetLastAccessTimeUtc_SafeFileHandle_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -472,7 +472,7 @@ public void Method_GetLastAccessTimeUtc_SafeFileHandle_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetLastAccessTimeUtc_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -487,7 +487,7 @@ public void Method_GetLastAccessTimeUtc_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_GetLastWriteTime_SafeFileHandle_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -504,7 +504,7 @@ public void Method_GetLastWriteTime_SafeFileHandle_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetLastWriteTime_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -519,7 +519,7 @@ public void Method_GetLastWriteTime_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_GetLastWriteTimeUtc_SafeFileHandle_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -536,7 +536,7 @@ public void Method_GetLastWriteTimeUtc_SafeFileHandle_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetLastWriteTimeUtc_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -551,7 +551,7 @@ public void Method_GetLastWriteTimeUtc_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_GetUnixFileMode_SafeFileHandle_ShouldRegisterCall() { Skip.If(!Test.RunsOnLinux); @@ -573,7 +573,7 @@ public void Method_GetUnixFileMode_SafeFileHandle_ShouldRegisterCall() #endif #if FEATURE_FILESYSTEM_UNIXFILEMODE - [SkippableFact] + [Fact] public void Method_GetUnixFileMode_String_ShouldRegisterCall() { Skip.If(!Test.RunsOnLinux); @@ -593,7 +593,7 @@ public void Method_GetUnixFileMode_String_ShouldRegisterCall() #endif #if FEATURE_FILE_MOVETO_OVERWRITE - [SkippableFact] + [Fact] public void Method_Move_String_String_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -610,7 +610,7 @@ public void Method_Move_String_String_Bool_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_Move_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -625,7 +625,7 @@ public void Method_Move_String_String_ShouldRegisterCall() sourceFileName, destFileName); } - [SkippableFact] + [Fact] public void Method_Open_String_FileMode_FileAccess_FileShare_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -641,7 +641,7 @@ public void Method_Open_String_FileMode_FileAccess_FileShare_ShouldRegisterCall( path, mode, access, share); } - [SkippableFact] + [Fact] public void Method_Open_String_FileMode_FileAccess_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -656,7 +656,7 @@ public void Method_Open_String_FileMode_FileAccess_ShouldRegisterCall() path, mode, access); } - [SkippableFact] + [Fact] public void Method_Open_String_FileMode_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -671,7 +671,7 @@ public void Method_Open_String_FileMode_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_STREAM_OPTIONS - [SkippableFact] + [Fact] public void Method_Open_String_FileStreamOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -687,7 +687,7 @@ public void Method_Open_String_FileStreamOptions_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_OpenRead_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -701,7 +701,7 @@ public void Method_OpenRead_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_OpenText_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -715,7 +715,7 @@ public void Method_OpenText_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_OpenWrite_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -728,7 +728,7 @@ public void Method_OpenWrite_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_ReadAllBytes_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -743,7 +743,7 @@ public void Method_ReadAllBytes_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_ReadAllBytesAsync_String_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -759,7 +759,7 @@ public async Task Method_ReadAllBytesAsync_String_CancellationToken_ShouldRegist } #endif - [SkippableFact] + [Fact] public void Method_ReadAllLines_String_Encoding_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -774,7 +774,7 @@ public void Method_ReadAllLines_String_Encoding_ShouldRegisterCall() path, encoding); } - [SkippableFact] + [Fact] public void Method_ReadAllLines_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -789,7 +789,7 @@ public void Method_ReadAllLines_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_ReadAllLinesAsync_String_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -806,7 +806,7 @@ public async Task Method_ReadAllLinesAsync_String_CancellationToken_ShouldRegist #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_ReadAllLinesAsync_String_Encoding_CancellationToken_ShouldRegisterCall() { @@ -824,7 +824,7 @@ public async Task } #endif - [SkippableFact] + [Fact] public void Method_ReadAllText_String_Encoding_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -839,7 +839,7 @@ public void Method_ReadAllText_String_Encoding_ShouldRegisterCall() path, encoding); } - [SkippableFact] + [Fact] public void Method_ReadAllText_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -854,7 +854,7 @@ public void Method_ReadAllText_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_ReadAllTextAsync_String_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -871,7 +871,7 @@ public async Task Method_ReadAllTextAsync_String_CancellationToken_ShouldRegiste #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_ReadAllTextAsync_String_Encoding_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -888,7 +888,7 @@ public async Task Method_ReadAllTextAsync_String_Encoding_CancellationToken_Shou } #endif - [SkippableFact] + [Fact] public void Method_ReadLines_String_Encoding_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -903,7 +903,7 @@ public void Method_ReadLines_String_Encoding_ShouldRegisterCall() path, encoding); } - [SkippableFact] + [Fact] public void Method_ReadLines_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -918,7 +918,7 @@ public void Method_ReadLines_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_NET7 - [SkippableFact] + [Fact] public void Method_ReadLinesAsync_String_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -935,7 +935,7 @@ public void Method_ReadLinesAsync_String_CancellationToken_ShouldRegisterCall() #endif #if FEATURE_FILESYSTEM_NET7 - [SkippableFact] + [Fact] public void Method_ReadLinesAsync_String_Encoding_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -952,7 +952,7 @@ public void Method_ReadLinesAsync_String_Encoding_CancellationToken_ShouldRegist } #endif - [SkippableFact] + [Fact] public void Method_Replace_String_String_String_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -970,7 +970,7 @@ public void Method_Replace_String_String_String_Bool_ShouldRegisterCall() sourceFileName, destinationFileName, destinationBackupFileName, ignoreMetadataErrors); } - [SkippableFact] + [Fact] public void Method_Replace_String_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -987,7 +987,7 @@ public void Method_Replace_String_String_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_LINK - [SkippableFact] + [Fact] public void Method_ResolveLinkTarget_String_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1004,7 +1004,7 @@ public void Method_ResolveLinkTarget_String_Bool_ShouldRegisterCall() #endif #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_SetAttributes_SafeFileHandle_FileAttributes_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1022,7 +1022,7 @@ public void Method_SetAttributes_SafeFileHandle_FileAttributes_ShouldRegisterCal } #endif - [SkippableFact] + [Fact] public void Method_SetAttributes_String_FileAttributes_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1038,7 +1038,7 @@ public void Method_SetAttributes_String_FileAttributes_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_SetCreationTime_SafeFileHandle_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1056,7 +1056,7 @@ public void Method_SetCreationTime_SafeFileHandle_DateTime_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_SetCreationTime_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1072,7 +1072,7 @@ public void Method_SetCreationTime_String_DateTime_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_SetCreationTimeUtc_SafeFileHandle_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1090,7 +1090,7 @@ public void Method_SetCreationTimeUtc_SafeFileHandle_DateTime_ShouldRegisterCall } #endif - [SkippableFact] + [Fact] public void Method_SetCreationTimeUtc_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1106,7 +1106,7 @@ public void Method_SetCreationTimeUtc_String_DateTime_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_SetLastAccessTime_SafeFileHandle_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1124,7 +1124,7 @@ public void Method_SetLastAccessTime_SafeFileHandle_DateTime_ShouldRegisterCall( } #endif - [SkippableFact] + [Fact] public void Method_SetLastAccessTime_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1140,7 +1140,7 @@ public void Method_SetLastAccessTime_String_DateTime_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_SetLastAccessTimeUtc_SafeFileHandle_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1158,7 +1158,7 @@ public void Method_SetLastAccessTimeUtc_SafeFileHandle_DateTime_ShouldRegisterCa } #endif - [SkippableFact] + [Fact] public void Method_SetLastAccessTimeUtc_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1174,7 +1174,7 @@ public void Method_SetLastAccessTimeUtc_String_DateTime_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_SetLastWriteTime_SafeFileHandle_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1192,7 +1192,7 @@ public void Method_SetLastWriteTime_SafeFileHandle_DateTime_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_SetLastWriteTime_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1208,7 +1208,7 @@ public void Method_SetLastWriteTime_String_DateTime_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_SetLastWriteTimeUtc_SafeFileHandle_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1226,7 +1226,7 @@ public void Method_SetLastWriteTimeUtc_SafeFileHandle_DateTime_ShouldRegisterCal } #endif - [SkippableFact] + [Fact] public void Method_SetLastWriteTimeUtc_String_DateTime_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1242,7 +1242,7 @@ public void Method_SetLastWriteTimeUtc_String_DateTime_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_SAFEFILEHANDLE - [SkippableFact] + [Fact] public void Method_SetUnixFileMode_SafeFileHandle_UnixFileMode_ShouldRegisterCall() { Skip.If(!Test.RunsOnLinux); @@ -1265,7 +1265,7 @@ public void Method_SetUnixFileMode_SafeFileHandle_UnixFileMode_ShouldRegisterCal #endif #if FEATURE_FILESYSTEM_UNIXFILEMODE - [SkippableFact] + [Fact] public void Method_SetUnixFileMode_String_UnixFileMode_ShouldRegisterCall() { Skip.If(!Test.RunsOnLinux); @@ -1285,7 +1285,7 @@ public void Method_SetUnixFileMode_String_UnixFileMode_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_WriteAllBytes_String_ByteArray_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1300,7 +1300,7 @@ public void Method_WriteAllBytes_String_ByteArray_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_WriteAllBytesAsync_String_ByteArray_CancellationToken_ShouldRegisterCall() { @@ -1317,7 +1317,7 @@ public async Task } #endif - [SkippableFact] + [Fact] public void Method_WriteAllLines_String_IEnumerableString_Encoding_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1332,7 +1332,7 @@ public void Method_WriteAllLines_String_IEnumerableString_Encoding_ShouldRegiste path, contents, encoding); } - [SkippableFact] + [Fact] public void Method_WriteAllLines_String_IEnumerableString_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1346,7 +1346,7 @@ public void Method_WriteAllLines_String_IEnumerableString_ShouldRegisterCall() path, contents); } - [SkippableFact] + [Fact] public void Method_WriteAllLines_String_StringArray_Encoding_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1361,7 +1361,7 @@ public void Method_WriteAllLines_String_StringArray_Encoding_ShouldRegisterCall( path, contents, encoding); } - [SkippableFact] + [Fact] public void Method_WriteAllLines_String_StringArray_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1376,7 +1376,7 @@ public void Method_WriteAllLines_String_StringArray_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_WriteAllLinesAsync_String_IEnumerableString_CancellationToken_ShouldRegisterCall() { @@ -1394,7 +1394,7 @@ public async Task #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_WriteAllLinesAsync_String_IEnumerableString_Encoding_CancellationToken_ShouldRegisterCall() { @@ -1412,7 +1412,7 @@ public async Task } #endif - [SkippableFact] + [Fact] public void Method_WriteAllText_String_String_Encoding_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1427,7 +1427,7 @@ public void Method_WriteAllText_String_String_Encoding_ShouldRegisterCall() path, contents, encoding); } - [SkippableFact] + [Fact] public void Method_WriteAllText_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1442,7 +1442,7 @@ public void Method_WriteAllText_String_String_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_WriteAllTextAsync_String_String_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -1459,7 +1459,7 @@ public async Task Method_WriteAllTextAsync_String_String_CancellationToken_Shoul #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableFact] + [Fact] public async Task Method_WriteAllTextAsync_String_String_Encoding_CancellationToken_ShouldRegisterCall() { @@ -1477,7 +1477,7 @@ public async Task } #endif - [SkippableFact] + [Fact] public void ToString_ShouldBeFile() { IStatistics sut = new MockFileSystem().Statistics.File; diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStreamFactoryStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStreamFactoryStatisticsTests.cs index 9b53bb02e..3538231d1 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStreamFactoryStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStreamFactoryStatisticsTests.cs @@ -11,7 +11,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public class FileStreamFactoryStatisticsTests { #if NET6_0_OR_GREATER - [SkippableFact] + [Fact] public void Method_New_SafeFileHandle_FileAccess_Int_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -32,7 +32,7 @@ public void Method_New_SafeFileHandle_FileAccess_Int_Bool_ShouldRegisterCall() #endif #if NET6_0_OR_GREATER - [SkippableFact] + [Fact] public void Method_New_SafeFileHandle_FileAccess_Int_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -51,7 +51,7 @@ public void Method_New_SafeFileHandle_FileAccess_Int_ShouldRegisterCall() } #endif #if NET6_0_OR_GREATER - [SkippableFact] + [Fact] public void Method_New_SafeFileHandle_FileAccess_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -69,7 +69,7 @@ public void Method_New_SafeFileHandle_FileAccess_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_New_String_FileMode_FileAccess_FileShare_Int_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -88,7 +88,7 @@ public void Method_New_String_FileMode_FileAccess_FileShare_Int_Bool_ShouldRegis path, mode, access, share, bufferSize, useAsync); } - [SkippableFact] + [Fact] public void Method_New_String_FileMode_FileAccess_FileShare_Int_FileOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -107,7 +107,7 @@ public void Method_New_String_FileMode_FileAccess_FileShare_Int_FileOptions_Shou path, mode, access, share, bufferSize, options); } - [SkippableFact] + [Fact] public void Method_New_String_FileMode_FileAccess_FileShare_Int_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -124,7 +124,7 @@ public void Method_New_String_FileMode_FileAccess_FileShare_Int_ShouldRegisterCa path, mode, access, share, bufferSize); } - [SkippableFact] + [Fact] public void Method_New_String_FileMode_FileAccess_FileShare_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -140,7 +140,7 @@ public void Method_New_String_FileMode_FileAccess_FileShare_ShouldRegisterCall() path, mode, access, share); } - [SkippableFact] + [Fact] public void Method_New_String_FileMode_FileAccess_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -155,7 +155,7 @@ public void Method_New_String_FileMode_FileAccess_ShouldRegisterCall() path, mode, access); } - [SkippableFact] + [Fact] public void Method_New_String_FileMode_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -170,7 +170,7 @@ public void Method_New_String_FileMode_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_STREAM_OPTIONS - [SkippableFact] + [Fact] public void Method_New_String_FileStreamOptions_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -186,7 +186,7 @@ public void Method_New_String_FileStreamOptions_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_Wrap_FileStream_ShouldRegisterCall() { string path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); @@ -214,7 +214,7 @@ public void Method_Wrap_FileStream_ShouldRegisterCall() } } - [SkippableFact] + [Fact] public void ToString_ShouldBeFileStream() { IPathStatistics sut diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStreamStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStreamStatisticsTests.cs index 123775f03..01c766160 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStreamStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileStreamStatisticsTests.cs @@ -9,7 +9,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public class FileStreamStatisticsTests { - [SkippableFact] + [Fact] public void Method_BeginRead_ByteArray_Int_Int_AsyncCallback_Object_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -28,7 +28,7 @@ public void Method_BeginRead_ByteArray_Int_Int_AsyncCallback_Object_ShouldRegist buffer, offset, count, callback, state); } - [SkippableFact] + [Fact] public void Method_BeginWrite_ByteArray_Int_Int_AsyncCallback_Object_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -47,7 +47,7 @@ public void Method_BeginWrite_ByteArray_Int_Int_AsyncCallback_Object_ShouldRegis buffer, offset, count, callback, state); } - [SkippableFact] + [Fact] public void Method_Close_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -59,7 +59,7 @@ public void Method_Close_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(FileSystemStream.Close)); } - [SkippableFact] + [Fact] public void Method_CopyTo_Stream_Int_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -75,7 +75,7 @@ public void Method_CopyTo_Stream_Int_ShouldRegisterCall() destination, bufferSize); } - [SkippableFact] + [Fact] public async Task Method_CopyToAsync_Stream_Int_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -92,7 +92,7 @@ public async Task Method_CopyToAsync_Stream_Int_CancellationToken_ShouldRegister destination, bufferSize, cancellationToken); } - [SkippableFact] + [Fact] public void Method_EndRead_IAsyncResult_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -110,7 +110,7 @@ public void Method_EndRead_IAsyncResult_ShouldRegisterCall() c.Parameters[0].Is(asyncResult)); } - [SkippableFact] + [Fact] public void Method_EndWrite_IAsyncResult_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -128,7 +128,7 @@ public void Method_EndWrite_IAsyncResult_ShouldRegisterCall() c.Parameters[0].Is(asyncResult)); } - [SkippableFact] + [Fact] public void Method_Flush_Bool_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -143,7 +143,7 @@ public void Method_Flush_Bool_ShouldRegisterCall() flushToDisk); } - [SkippableFact] + [Fact] public void Method_Flush_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -156,7 +156,7 @@ public void Method_Flush_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(FileSystemStream.Flush)); } - [SkippableFact] + [Fact] public async Task Method_FlushAsync_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -171,7 +171,7 @@ public async Task Method_FlushAsync_CancellationToken_ShouldRegisterCall() cancellationToken); } - [SkippableFact] + [Fact] public void Method_Read_ByteArray_Int_Int_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -189,7 +189,7 @@ public void Method_Read_ByteArray_Int_Int_ShouldRegisterCall() } #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_Read_SpanByte_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -205,7 +205,7 @@ public void Method_Read_SpanByte_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public async Task Method_ReadAsync_ByteArray_Int_Int_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -226,7 +226,7 @@ public async Task Method_ReadAsync_ByteArray_Int_Int_CancellationToken_ShouldReg } #if FEATURE_SPAN - [SkippableFact] + [Fact] public async Task Method_ReadAsync_MemoryByte_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -243,7 +243,7 @@ public async Task Method_ReadAsync_MemoryByte_CancellationToken_ShouldRegisterCa } #endif - [SkippableFact] + [Fact] public void Method_ReadByte_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -256,7 +256,7 @@ public void Method_ReadByte_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(FileSystemStream.ReadByte)); } - [SkippableFact] + [Fact] public void Method_Seek_Int64_SeekOrigin_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -272,7 +272,7 @@ public void Method_Seek_Int64_SeekOrigin_ShouldRegisterCall() offset, origin); } - [SkippableFact] + [Fact] public void Method_SetLength_Int64_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -287,7 +287,7 @@ public void Method_SetLength_Int64_ShouldRegisterCall() value); } - [SkippableFact] + [Fact] public void Method_ToString_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -300,7 +300,7 @@ public void Method_ToString_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(FileSystemStream.ToString)); } - [SkippableFact] + [Fact] public void Method_Write_ByteArray_Int_Int_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -318,7 +318,7 @@ public void Method_Write_ByteArray_Int_Int_ShouldRegisterCall() } #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_Write_ReadOnlySpanByte_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -334,7 +334,7 @@ public void Method_Write_ReadOnlySpanByte_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public async Task Method_WriteAsync_ByteArray_Int_Int_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -355,7 +355,7 @@ public async Task Method_WriteAsync_ByteArray_Int_Int_CancellationToken_ShouldRe } #if FEATURE_SPAN - [SkippableFact] + [Fact] public async Task Method_WriteAsync_ReadOnlyMemoryByte_CancellationToken_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -372,7 +372,7 @@ public async Task Method_WriteAsync_ReadOnlyMemoryByte_CancellationToken_ShouldR } #endif - [SkippableFact] + [Fact] public void Method_WriteByte_Byte_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -387,7 +387,7 @@ public void Method_WriteByte_Byte_ShouldRegisterCall() value); } - [SkippableFact] + [Fact] public void Property_CanRead_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -400,7 +400,7 @@ public void Property_CanRead_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.CanRead)); } - [SkippableFact] + [Fact] public void Property_CanSeek_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -413,7 +413,7 @@ public void Property_CanSeek_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.CanSeek)); } - [SkippableFact] + [Fact] public void Property_CanTimeout_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -426,7 +426,7 @@ public void Property_CanTimeout_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.CanTimeout)); } - [SkippableFact] + [Fact] public void Property_CanWrite_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -439,7 +439,7 @@ public void Property_CanWrite_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.CanWrite)); } - [SkippableFact] + [Fact] public void Property_IsAsync_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -452,7 +452,7 @@ public void Property_IsAsync_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.IsAsync)); } - [SkippableFact] + [Fact] public void Property_Length_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -465,7 +465,7 @@ public void Property_Length_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.Length)); } - [SkippableFact] + [Fact] public void Property_Name_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -478,7 +478,7 @@ public void Property_Name_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.Name)); } - [SkippableFact] + [Fact] public void Property_Position_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -491,7 +491,7 @@ public void Property_Position_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.Position)); } - [SkippableFact] + [Fact] public void Property_Position_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -505,7 +505,7 @@ public void Property_Position_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(FileSystemStream.Position)); } - [SkippableFact] + [Fact] public void Property_ReadTimeout_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -525,7 +525,7 @@ public void Property_ReadTimeout_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.ReadTimeout)); } - [SkippableFact] + [Fact] public void Property_ReadTimeout_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -546,7 +546,7 @@ public void Property_ReadTimeout_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(FileSystemStream.ReadTimeout)); } - [SkippableFact] + [Fact] public void Property_WriteTimeout_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -566,7 +566,7 @@ public void Property_WriteTimeout_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(FileSystemStream.WriteTimeout)); } - [SkippableFact] + [Fact] public void Property_WriteTimeout_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -587,7 +587,7 @@ public void Property_WriteTimeout_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(FileSystemStream.WriteTimeout)); } - [SkippableFact] + [Fact] public void ToString_ShouldBeFileStreamWithPath() { IStatistics sut = new MockFileSystem().Statistics.FileStream[@"\\some\path"]; diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherFactoryStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherFactoryStatisticsTests.cs index 6db8a8475..6371e3731 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherFactoryStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherFactoryStatisticsTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public class FileSystemWatcherFactoryStatisticsTests { - [SkippableFact] + [Fact] public void Method_New_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -18,7 +18,7 @@ public void Method_New_ShouldRegisterCall() nameof(IFileSystemWatcherFactory.New)); } - [SkippableFact] + [Fact] public void Method_New_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -33,7 +33,7 @@ public void Method_New_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_New_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -49,7 +49,7 @@ public void Method_New_String_String_ShouldRegisterCall() path, filter); } - [SkippableFact] + [Fact] public void Method_Wrap_FileSystemWatcher_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -64,7 +64,7 @@ public void Method_Wrap_FileSystemWatcher_ShouldRegisterCall() fileSystemWatcher); } - [SkippableFact] + [Fact] public void ToString_ShouldBeFileSystemWatcher() { IPathStatistics sut diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherStatisticsTests.cs index 8730e857f..9d94a3781 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileSystemWatcherStatisticsTests.cs @@ -10,7 +10,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public class FileSystemWatcherStatisticsTests { - [SkippableFact] + [Fact] public void Method_BeginInit_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -24,7 +24,7 @@ public void Method_BeginInit_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileSystemWatcher.BeginInit)); } - [SkippableFact] + [Fact] public void Method_EndInit_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -38,7 +38,7 @@ public void Method_EndInit_ShouldRegisterCall() .ShouldOnlyContainMethodCall(nameof(IFileSystemWatcher.EndInit)); } - [SkippableFact] + [Fact] public void Method_WaitForChanged_WatcherChangeTypes_Int_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -68,7 +68,7 @@ public void Method_WaitForChanged_WatcherChangeTypes_Int_ShouldRegisterCall() timeout); } - [SkippableFact] + [Fact] public void Method_WaitForChanged_WatcherChangeTypes_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -97,7 +97,7 @@ public void Method_WaitForChanged_WatcherChangeTypes_ShouldRegisterCall() } #if FEATURE_FILESYSTEM_NET7 - [SkippableFact] + [Fact] public void Method_WaitForChanged_WatcherChangeTypes_TimeSpan_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -128,7 +128,7 @@ public void Method_WaitForChanged_WatcherChangeTypes_TimeSpan_ShouldRegisterCall } #endif - [SkippableFact] + [Fact] public void Property_EnableRaisingEvents_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -141,7 +141,7 @@ public void Property_EnableRaisingEvents_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileSystemWatcher.EnableRaisingEvents)); } - [SkippableFact] + [Fact] public void Property_EnableRaisingEvents_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -155,7 +155,7 @@ public void Property_EnableRaisingEvents_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileSystemWatcher.EnableRaisingEvents)); } - [SkippableFact] + [Fact] public void Property_Filter_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -168,7 +168,7 @@ public void Property_Filter_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileSystemWatcher.Filter)); } - [SkippableFact] + [Fact] public void Property_Filter_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -183,7 +183,7 @@ public void Property_Filter_Set_ShouldRegisterPropertyAccess() } #if FEATURE_FILESYSTEMWATCHER_ADVANCED - [SkippableFact] + [Fact] public void Property_Filters_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -197,7 +197,7 @@ public void Property_Filters_Get_ShouldRegisterPropertyAccess() } #endif - [SkippableFact] + [Fact] public void Property_IncludeSubdirectories_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -210,7 +210,7 @@ public void Property_IncludeSubdirectories_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileSystemWatcher.IncludeSubdirectories)); } - [SkippableFact] + [Fact] public void Property_IncludeSubdirectories_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -224,7 +224,7 @@ public void Property_IncludeSubdirectories_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileSystemWatcher.IncludeSubdirectories)); } - [SkippableFact] + [Fact] public void Property_InternalBufferSize_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -237,7 +237,7 @@ public void Property_InternalBufferSize_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileSystemWatcher.InternalBufferSize)); } - [SkippableFact] + [Fact] public void Property_InternalBufferSize_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -251,7 +251,7 @@ public void Property_InternalBufferSize_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileSystemWatcher.InternalBufferSize)); } - [SkippableFact] + [Fact] public void Property_NotifyFilter_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -264,7 +264,7 @@ public void Property_NotifyFilter_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileSystemWatcher.NotifyFilter)); } - [SkippableFact] + [Fact] public void Property_NotifyFilter_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -278,7 +278,7 @@ public void Property_NotifyFilter_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileSystemWatcher.NotifyFilter)); } - [SkippableFact] + [Fact] public void Property_Path_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -291,7 +291,7 @@ public void Property_Path_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileSystemWatcher.Path)); } - [SkippableFact] + [Fact] public void Property_Path_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -305,7 +305,7 @@ public void Property_Path_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileSystemWatcher.Path)); } - [SkippableFact] + [Fact] public void Property_Site_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -318,7 +318,7 @@ public void Property_Site_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileSystemWatcher.Site)); } - [SkippableFact] + [Fact] public void Property_Site_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -332,7 +332,7 @@ public void Property_Site_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileSystemWatcher.Site)); } - [SkippableFact] + [Fact] public void Property_SynchronizingObject_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -345,7 +345,7 @@ public void Property_SynchronizingObject_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileSystemWatcher.SynchronizingObject)); } - [SkippableFact] + [Fact] public void Property_SynchronizingObject_Set_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -359,7 +359,7 @@ public void Property_SynchronizingObject_Set_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertySetAccess(nameof(IFileSystemWatcher.SynchronizingObject)); } - [SkippableFact] + [Fact] public void ToString_ShouldBeFileSystemWatcherWithPath() { IStatistics sut = new MockFileSystem().Statistics.FileSystemWatcher[@"\\some\path"]; diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileVersionInfoFactoryStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileVersionInfoFactoryStatisticsTests.cs index 73c5faba1..3baf83a93 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileVersionInfoFactoryStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileVersionInfoFactoryStatisticsTests.cs @@ -4,7 +4,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public class FileVersionInfoFactoryStatisticsTests { - [SkippableFact] + [Fact] public void Method_GetVersionInfo_String_ShouldRegisterCall() { MockFileSystem sut = new(); diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileVersionInfoStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileVersionInfoStatisticsTests.cs index 093775ac1..90bb993e9 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileVersionInfoStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/FileVersionInfoStatisticsTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public class FileVersionInfoStatisticsTests { - [SkippableFact] + [Fact] public void Property_Comments_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -17,7 +17,7 @@ public void Property_Comments_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.Comments)); } - [SkippableFact] + [Fact] public void Property_CompanyName_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -29,7 +29,7 @@ public void Property_CompanyName_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.CompanyName)); } - [SkippableFact] + [Fact] public void Property_FileBuildPart_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -41,7 +41,7 @@ public void Property_FileBuildPart_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.FileBuildPart)); } - [SkippableFact] + [Fact] public void Property_FileDescription_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -53,7 +53,7 @@ public void Property_FileDescription_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.FileDescription)); } - [SkippableFact] + [Fact] public void Property_FileMajorPart_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -65,7 +65,7 @@ public void Property_FileMajorPart_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.FileMajorPart)); } - [SkippableFact] + [Fact] public void Property_FileMinorPart_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -77,7 +77,7 @@ public void Property_FileMinorPart_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.FileMinorPart)); } - [SkippableFact] + [Fact] public void Property_FileName_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -89,7 +89,7 @@ public void Property_FileName_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.FileName)); } - [SkippableFact] + [Fact] public void Property_FilePrivatePart_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -101,7 +101,7 @@ public void Property_FilePrivatePart_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.FilePrivatePart)); } - [SkippableFact] + [Fact] public void Property_FileVersion_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -113,7 +113,7 @@ public void Property_FileVersion_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.FileVersion)); } - [SkippableFact] + [Fact] public void Property_InternalName_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -125,7 +125,7 @@ public void Property_InternalName_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.InternalName)); } - [SkippableFact] + [Fact] public void Property_IsDebug_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -137,7 +137,7 @@ public void Property_IsDebug_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.IsDebug)); } - [SkippableFact] + [Fact] public void Property_IsPatched_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -149,7 +149,7 @@ public void Property_IsPatched_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.IsPatched)); } - [SkippableFact] + [Fact] public void Property_IsPreRelease_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -161,7 +161,7 @@ public void Property_IsPreRelease_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.IsPreRelease)); } - [SkippableFact] + [Fact] public void Property_IsPrivateBuild_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -173,7 +173,7 @@ public void Property_IsPrivateBuild_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.IsPrivateBuild)); } - [SkippableFact] + [Fact] public void Property_IsSpecialBuild_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -185,7 +185,7 @@ public void Property_IsSpecialBuild_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.IsSpecialBuild)); } - [SkippableFact] + [Fact] public void Property_Language_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -197,7 +197,7 @@ public void Property_Language_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.Language)); } - [SkippableFact] + [Fact] public void Property_LegalCopyright_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -209,7 +209,7 @@ public void Property_LegalCopyright_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.LegalCopyright)); } - [SkippableFact] + [Fact] public void Property_LegalTrademarks_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -221,7 +221,7 @@ public void Property_LegalTrademarks_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.LegalTrademarks)); } - [SkippableFact] + [Fact] public void Property_OriginalFilename_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -233,7 +233,7 @@ public void Property_OriginalFilename_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.OriginalFilename)); } - [SkippableFact] + [Fact] public void Property_PrivateBuild_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -245,7 +245,7 @@ public void Property_PrivateBuild_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.PrivateBuild)); } - [SkippableFact] + [Fact] public void Property_ProductBuildPart_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -257,7 +257,7 @@ public void Property_ProductBuildPart_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.ProductBuildPart)); } - [SkippableFact] + [Fact] public void Property_ProductMajorPart_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -269,7 +269,7 @@ public void Property_ProductMajorPart_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.ProductMajorPart)); } - [SkippableFact] + [Fact] public void Property_ProductMinorPart_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -281,7 +281,7 @@ public void Property_ProductMinorPart_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.ProductMinorPart)); } - [SkippableFact] + [Fact] public void Property_ProductName_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -293,7 +293,7 @@ public void Property_ProductName_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.ProductName)); } - [SkippableFact] + [Fact] public void Property_ProductPrivatePart_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -305,7 +305,7 @@ public void Property_ProductPrivatePart_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.ProductPrivatePart)); } - [SkippableFact] + [Fact] public void Property_ProductVersion_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -317,7 +317,7 @@ public void Property_ProductVersion_Get_ShouldRegisterPropertyAccess() .ShouldOnlyContainPropertyGetAccess(nameof(IFileVersionInfo.ProductVersion)); } - [SkippableFact] + [Fact] public void Property_SpecialBuild_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/PathStatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/PathStatisticsTests.cs index 64e40de43..59ab7114d 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/PathStatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/FileSystem/PathStatisticsTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Testing.Tests.Statistics.FileSystem; public class PathStatisticsTests { - [SkippableFact] + [Fact] public void Method_ChangeExtension_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -22,7 +22,7 @@ public void Method_ChangeExtension_String_String_ShouldRegisterCall() path, extension); } - [SkippableFact] + [Fact] public void Method_Combine_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -36,7 +36,7 @@ public void Method_Combine_String_String_ShouldRegisterCall() path1, path2); } - [SkippableFact] + [Fact] public void Method_Combine_String_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -51,7 +51,7 @@ public void Method_Combine_String_String_String_ShouldRegisterCall() path1, path2, path3); } - [SkippableFact] + [Fact] public void Method_Combine_String_String_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -67,7 +67,7 @@ public void Method_Combine_String_String_String_String_ShouldRegisterCall() path1, path2, path3, path4); } - [SkippableFact] + [Fact] public void Method_Combine_StringArray_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -81,7 +81,7 @@ public void Method_Combine_StringArray_ShouldRegisterCall() } #if FEATURE_PATH_ADVANCED - [SkippableFact] + [Fact] public void Method_EndsInDirectorySeparator_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -96,7 +96,7 @@ public void Method_EndsInDirectorySeparator_ReadOnlySpanChar_ShouldRegisterCall( #endif #if FEATURE_PATH_ADVANCED - [SkippableFact] + [Fact] public void Method_EndsInDirectorySeparator_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -111,7 +111,7 @@ public void Method_EndsInDirectorySeparator_String_ShouldRegisterCall() #endif #if FEATURE_FILESYSTEM_NET7 - [SkippableFact] + [Fact] public void Method_Exists_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -126,7 +126,7 @@ public void Method_Exists_String_ShouldRegisterCall() #endif #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_GetDirectoryName_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -140,7 +140,7 @@ public void Method_GetDirectoryName_ReadOnlySpanChar_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetDirectoryName_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -154,7 +154,7 @@ public void Method_GetDirectoryName_String_ShouldRegisterCall() } #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_GetExtension_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -168,7 +168,7 @@ public void Method_GetExtension_ReadOnlySpanChar_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetExtension_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -182,7 +182,7 @@ public void Method_GetExtension_String_ShouldRegisterCall() } #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_GetFileName_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -196,7 +196,7 @@ public void Method_GetFileName_ReadOnlySpanChar_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetFileName_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -210,7 +210,7 @@ public void Method_GetFileName_String_ShouldRegisterCall() } #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_GetFileNameWithoutExtension_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -224,7 +224,7 @@ public void Method_GetFileNameWithoutExtension_ReadOnlySpanChar_ShouldRegisterCa } #endif - [SkippableFact] + [Fact] public void Method_GetFileNameWithoutExtension_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -237,7 +237,7 @@ public void Method_GetFileNameWithoutExtension_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetFullPath_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -251,7 +251,7 @@ public void Method_GetFullPath_String_ShouldRegisterCall() } #if FEATURE_PATH_RELATIVE - [SkippableFact] + [Fact] public void Method_GetFullPath_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -266,7 +266,7 @@ public void Method_GetFullPath_String_String_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetInvalidFileNameChars_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -277,7 +277,7 @@ public void Method_GetInvalidFileNameChars_ShouldRegisterCall() sut.Statistics.Path.ShouldOnlyContainMethodCall(nameof(IPath.GetInvalidFileNameChars)); } - [SkippableFact] + [Fact] public void Method_GetInvalidPathChars_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -289,7 +289,7 @@ public void Method_GetInvalidPathChars_ShouldRegisterCall() } #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_GetPathRoot_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -303,7 +303,7 @@ public void Method_GetPathRoot_ReadOnlySpanChar_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetPathRoot_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -316,7 +316,7 @@ public void Method_GetPathRoot_String_ShouldRegisterCall() path); } - [SkippableFact] + [Fact] public void Method_GetRandomFileName_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -328,7 +328,7 @@ public void Method_GetRandomFileName_ShouldRegisterCall() } #if FEATURE_PATH_RELATIVE - [SkippableFact] + [Fact] public void Method_GetRelativePath_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -343,7 +343,7 @@ public void Method_GetRelativePath_String_String_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_GetTempFileName_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -354,7 +354,7 @@ public void Method_GetTempFileName_ShouldRegisterCall() sut.Statistics.Path.ShouldOnlyContainMethodCall(nameof(IPath.GetTempFileName)); } - [SkippableFact] + [Fact] public void Method_GetTempPath_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -366,7 +366,7 @@ public void Method_GetTempPath_ShouldRegisterCall() } #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_HasExtension_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -380,7 +380,7 @@ public void Method_HasExtension_ReadOnlySpanChar_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_HasExtension_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -394,7 +394,7 @@ public void Method_HasExtension_String_ShouldRegisterCall() } #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_IsPathFullyQualified_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -409,7 +409,7 @@ public void Method_IsPathFullyQualified_ReadOnlySpanChar_ShouldRegisterCall() #endif #if FEATURE_PATH_RELATIVE - [SkippableFact] + [Fact] public void Method_IsPathFullyQualified_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -424,7 +424,7 @@ public void Method_IsPathFullyQualified_String_ShouldRegisterCall() #endif #if FEATURE_SPAN - [SkippableFact] + [Fact] public void Method_IsPathRooted_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -438,7 +438,7 @@ public void Method_IsPathRooted_ReadOnlySpanChar_ShouldRegisterCall() } #endif - [SkippableFact] + [Fact] public void Method_IsPathRooted_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -452,7 +452,7 @@ public void Method_IsPathRooted_String_ShouldRegisterCall() } #if FEATURE_PATH_JOIN - [SkippableFact] + [Fact] public void Method_Join_ReadOnlySpanChar_ReadOnlySpanChar_ReadOnlySpanChar_ReadOnlySpanChar_ShouldRegisterCall() { @@ -471,7 +471,7 @@ public void #endif #if FEATURE_PATH_JOIN - [SkippableFact] + [Fact] public void Method_Join_ReadOnlySpanChar_ReadOnlySpanChar_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -488,7 +488,7 @@ public void Method_Join_ReadOnlySpanChar_ReadOnlySpanChar_ReadOnlySpanChar_Shoul #endif #if FEATURE_PATH_JOIN - [SkippableFact] + [Fact] public void Method_Join_ReadOnlySpanChar_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -504,7 +504,7 @@ public void Method_Join_ReadOnlySpanChar_ReadOnlySpanChar_ShouldRegisterCall() #endif #if FEATURE_PATH_JOIN - [SkippableFact] + [Fact] public void Method_Join_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -520,7 +520,7 @@ public void Method_Join_String_String_ShouldRegisterCall() #endif #if FEATURE_PATH_JOIN - [SkippableFact] + [Fact] public void Method_Join_String_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -537,7 +537,7 @@ public void Method_Join_String_String_String_ShouldRegisterCall() #endif #if FEATURE_PATH_JOIN - [SkippableFact] + [Fact] public void Method_Join_String_String_String_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -555,7 +555,7 @@ public void Method_Join_String_String_String_String_ShouldRegisterCall() #endif #if FEATURE_PATH_JOIN - [SkippableFact] + [Fact] public void Method_Join_StringArray_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -570,7 +570,7 @@ public void Method_Join_StringArray_ShouldRegisterCall() #endif #if FEATURE_PATH_ADVANCED - [SkippableFact] + [Fact] public void Method_TrimEndingDirectorySeparator_ReadOnlySpanChar_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -585,7 +585,7 @@ public void Method_TrimEndingDirectorySeparator_ReadOnlySpanChar_ShouldRegisterC #endif #if FEATURE_PATH_ADVANCED - [SkippableFact] + [Fact] public void Method_TrimEndingDirectorySeparator_String_ShouldRegisterCall() { MockFileSystem sut = new(); @@ -600,7 +600,7 @@ public void Method_TrimEndingDirectorySeparator_String_ShouldRegisterCall() #endif #if FEATURE_PATH_JOIN - [SkippableFact] + [Fact] public void Method_TryJoin_ReadOnlySpanChar_ReadOnlySpanChar_ReadOnlySpanChar_SpanChar_OutInt_ShouldRegisterCall() { @@ -619,7 +619,7 @@ public void #endif #if FEATURE_PATH_JOIN - [SkippableFact] + [Fact] public void Method_TryJoin_ReadOnlySpanChar_ReadOnlySpanChar_SpanChar_OutInt_ShouldRegisterCall() { @@ -636,7 +636,7 @@ public void } #endif - [SkippableFact] + [Fact] public void Property_AltDirectorySeparatorChar_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -648,7 +648,7 @@ public void Property_AltDirectorySeparatorChar_Get_ShouldRegisterPropertyAccess( nameof(IPath.AltDirectorySeparatorChar)); } - [SkippableFact] + [Fact] public void Property_DirectorySeparatorChar_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -660,7 +660,7 @@ public void Property_DirectorySeparatorChar_Get_ShouldRegisterPropertyAccess() nameof(IPath.DirectorySeparatorChar)); } - [SkippableFact] + [Fact] public void Property_PathSeparator_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -671,7 +671,7 @@ public void Property_PathSeparator_Get_ShouldRegisterPropertyAccess() sut.Statistics.Path.ShouldOnlyContainPropertyGetAccess(nameof(IPath.PathSeparator)); } - [SkippableFact] + [Fact] public void Property_VolumeSeparatorChar_Get_ShouldRegisterPropertyAccess() { MockFileSystem sut = new(); @@ -682,7 +682,7 @@ public void Property_VolumeSeparatorChar_Get_ShouldRegisterPropertyAccess() sut.Statistics.Path.ShouldOnlyContainPropertyGetAccess(nameof(IPath.VolumeSeparatorChar)); } - [SkippableFact] + [Fact] public void ToString_ShouldBePath() { IStatistics sut = new MockFileSystem().Statistics.Path; diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/StatisticsTests.Helpers.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/StatisticsTests.Helpers.cs index 623a12908..e8288e225 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/StatisticsTests.Helpers.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/StatisticsTests.Helpers.cs @@ -53,7 +53,7 @@ private static void CheckMethodCall(StringBuilder builder, bool isAsync = typeof(Task).IsAssignableFrom(methodInfo.ReturnType); #pragma warning disable MA0011 // IFormatProvider is missing - builder.AppendLine("\t[SkippableFact]"); + builder.AppendLine("\t[Fact]"); builder.Append(isAsync ? "\tpublic async Task " : "\tpublic void "); builder.Append(expectedName); builder.AppendLine("()"); @@ -166,7 +166,7 @@ private static void CheckPropertyGetAccess(StringBuilder builder, } #pragma warning disable MA0011 // IFormatProvider is missing - builder.AppendLine("\t[SkippableFact]"); + builder.AppendLine("\t[Fact]"); builder.Append("\tpublic void "); builder.Append(expectedName); builder.AppendLine("()"); @@ -195,7 +195,7 @@ private static void CheckPropertySetAccess(StringBuilder builder, } #pragma warning disable MA0011 // IFormatProvider is missing - builder.AppendLine("\t[SkippableFact]"); + builder.AppendLine("\t[Fact]"); builder.Append("\tpublic void "); builder.Append(expectedName); builder.AppendLine("()"); diff --git a/Tests/Testably.Abstractions.Testing.Tests/Storage/LocationExtensionsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Storage/LocationExtensionsTests.cs index f396bff81..d114a380c 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Storage/LocationExtensionsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Storage/LocationExtensionsTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Testing.Tests.Storage; public sealed class LocationExtensionsTests { - [SkippableFact] + [Fact] public void ThrowExceptionIfNotFound_MissingDirectory_ShouldThrowDirectoryNotFoundException() { MockFileSystem fileSystem = new(); @@ -19,7 +19,7 @@ public void ThrowExceptionIfNotFound_MissingDirectory_ShouldThrowDirectoryNotFou exception.Should().BeOfType(); } - [SkippableTheory] + [Theory] [AutoData] public void ThrowExceptionIfNotFound_MissingDirectory_WithCustomCallback_ShouldThrowExceptionFromCallback( @@ -37,7 +37,7 @@ public void exception.Should().BeSameAs(expectedException); } - [SkippableFact] + [Fact] public void ThrowExceptionIfNotFound_MissingFile_ShouldThrowFileNotFoundException() { MockFileSystem fileSystem = new(); @@ -51,7 +51,7 @@ public void ThrowExceptionIfNotFound_MissingFile_ShouldThrowFileNotFoundExceptio exception.Should().BeOfType(); } - [SkippableTheory] + [Theory] [AutoData] public void ThrowExceptionIfNotFound_MissingFile_WithCustomCallback_ShouldThrowExceptionFromCallback( @@ -68,7 +68,7 @@ public void exception.Should().BeSameAs(expectedException); } - [SkippableTheory] + [Theory] [AutoData] public void ThrowIfNotFound_MissingDirectory_ShouldExecuteFileNotFoundAction( Exception expectedException) @@ -85,7 +85,7 @@ public void ThrowIfNotFound_MissingDirectory_ShouldExecuteFileNotFoundAction( exception.Should().BeSameAs(expectedException); } - [SkippableTheory] + [Theory] [AutoData] public void ThrowIfNotFound_MissingFile_ShouldExecuteFileNotFoundAction( Exception expectedException) @@ -101,7 +101,7 @@ public void ThrowIfNotFound_MissingFile_ShouldExecuteFileNotFoundAction( exception.Should().BeSameAs(expectedException); } - [SkippableTheory] + [Theory] [AutoData] public void ThrowIfNotFound_Null_ShouldExecuteFileNotFoundAction(Exception expectedException) { diff --git a/Tests/Testably.Abstractions.Testing.Tests/TestHelpers/Test.cs b/Tests/Testably.Abstractions.Testing.Tests/TestHelpers/Test.cs index 1783f02d5..63d0ab096 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/TestHelpers/Test.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/TestHelpers/Test.cs @@ -4,24 +4,17 @@ namespace Testably.Abstractions.Testing.Tests.TestHelpers; public static class Test { - private static bool? _isNetFramework; + private static Testably.Abstractions.TestHelpers.Test _test = new(); public static bool IsNetFramework - { - get - { - _isNetFramework ??= RuntimeInformation.FrameworkDescription - .StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase); - return _isNetFramework.Value; - } - } + => _test.IsNetFramework; public static bool RunsOnLinux - => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + => _test.RunsOnLinux; public static bool RunsOnMac - => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); + => _test.RunsOnMac; public static bool RunsOnWindows - => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + => _test.RunsOnWindows; } diff --git a/Tests/Testably.Abstractions.Testing.Tests/TestHelpers/Usings.cs b/Tests/Testably.Abstractions.Testing.Tests/TestHelpers/Usings.cs index 6f9647828..334b4c91b 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/TestHelpers/Usings.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/TestHelpers/Usings.cs @@ -1,9 +1,11 @@ #if NET48 global using Testably.Abstractions.Polyfills; # endif -global using AutoFixture.Xunit2; +global using AutoFixture.Xunit3; global using FluentAssertions; global using System; global using System.IO.Abstractions; global using Testably.Abstractions.FluentAssertions; +global using Testably.Abstractions.TestHelpers; +global using Test = Testably.Abstractions.Testing.Tests.TestHelpers.Test; global using Xunit; diff --git a/Tests/Testably.Abstractions.Testing.Tests/Testably.Abstractions.Testing.Tests.csproj b/Tests/Testably.Abstractions.Testing.Tests/Testably.Abstractions.Testing.Tests.csproj index d8ec3c937..619c8a005 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Testably.Abstractions.Testing.Tests.csproj +++ b/Tests/Testably.Abstractions.Testing.Tests/Testably.Abstractions.Testing.Tests.csproj @@ -19,6 +19,8 @@ + + diff --git a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimeSystemExtensibilityTests.cs b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimeSystemExtensibilityTests.cs index 9dbf9c366..4270b70b7 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimeSystemExtensibilityTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimeSystemExtensibilityTests.cs @@ -9,13 +9,13 @@ public class TimeSystemExtensibilityTests public static TheoryData GetTimeSystems => new() { - new RealTimeSystem(), - new MockTimeSystem(), + (ITimeSystem)new RealTimeSystem(), + (ITimeSystem)new MockTimeSystem(), }; #endregion - [SkippableTheory] + [Theory] [MemberData(nameof(GetTimeSystems))] public void DateTime_ShouldSetExtensionPoint(ITimeSystem timeSystem) { @@ -26,7 +26,7 @@ public void DateTime_ShouldSetExtensionPoint(ITimeSystem timeSystem) result.Should().Be(timeSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetTimeSystems))] public void Task_ShouldSetExtensionPoint(ITimeSystem timeSystem) { @@ -37,7 +37,7 @@ public void Task_ShouldSetExtensionPoint(ITimeSystem timeSystem) result.Should().Be(timeSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetTimeSystems))] public void Thread_ShouldSetExtensionPoint(ITimeSystem timeSystem) { @@ -48,7 +48,7 @@ public void Thread_ShouldSetExtensionPoint(ITimeSystem timeSystem) result.Should().Be(timeSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetTimeSystems))] public void Timer_ShouldSetExtensionPoint(ITimeSystem timeSystem) { @@ -59,7 +59,7 @@ public void Timer_ShouldSetExtensionPoint(ITimeSystem timeSystem) result.Should().Be(timeSystem); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetTimeSystems))] public void TimerFactory_ShouldSetExtensionPoint(ITimeSystem timeSystem) { diff --git a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs index e7de92378..27e74ee32 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs @@ -1,7 +1,7 @@ -using System.Threading; +using FluentAssertions.Common; +using System.Threading; using System.Threading.Tasks; using Testably.Abstractions.Testing.TimeSystem; -using Xunit.Abstractions; using ITimer = Testably.Abstractions.TimeSystem.ITimer; namespace Testably.Abstractions.Testing.Tests.TimeSystem; @@ -9,7 +9,7 @@ namespace Testably.Abstractions.Testing.Tests.TimeSystem; // ReSharper disable UseAwaitUsing public class TimerMockTests(ITestOutputHelper testOutputHelper) { - [SkippableTheory] + [Theory] [InlineData(-1)] [InlineData(0)] [InlineData(2000)] @@ -29,7 +29,7 @@ public void Change_ValidDueTimeValue_ShouldNotThrowException(int dueTime) exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineData(-1)] [InlineData(0)] [InlineData(2000)] @@ -219,7 +219,7 @@ public async Task New_WithStartOnMockWaitMode_ShouldOnlyStartWhenCallingWait() count.Should().BeGreaterThan(0); } - [SkippableFact] + [Fact] public void Wait_Infinite_ShouldBeValidTimeout() { MockTimeSystem timeSystem = new MockTimeSystem() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateDirectoryTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateDirectoryTests.cs index 37f954cbb..532c5345b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateDirectoryTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateDirectoryTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class CreateDirectoryTests { - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_AlreadyExisting_ShouldDoNothing(string path) { @@ -20,7 +20,7 @@ public void CreateDirectory_AlreadyExisting_ShouldDoNothing(string path) FileSystem.Should().HaveDirectory(path); } - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_ReadOnlyParent_ShouldStillCreateDirectoryUnderWindows(string parent, string subdirectory) @@ -48,7 +48,7 @@ public void CreateDirectory_ReadOnlyParent_ShouldStillCreateDirectoryUnderWindow } } - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_FileWithSameNameAlreadyExists_ShouldThrowIOException(string name) { @@ -64,7 +64,7 @@ public void CreateDirectory_FileWithSameNameAlreadyExists_ShouldThrowIOException FileSystem.Should().NotHaveDirectory(name); } - [SkippableFact] + [Fact] public void CreateDirectory_Root_ShouldNotThrowException() { string path = FileTestHelper.RootDrive(Test); @@ -79,7 +79,7 @@ public void CreateDirectory_Root_ShouldNotThrowException() FileSystem.Should().HaveDirectory(path); } - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_ShouldTrimTrailingSpaces_OnWindows(string path) { @@ -97,7 +97,7 @@ public void CreateDirectory_ShouldTrimTrailingSpaces_OnWindows(string path) } } - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_ShouldAdjustTimes(string path, string subdirectoryName) { @@ -133,7 +133,7 @@ public void CreateDirectory_ShouldAdjustTimes(string path, string subdirectoryNa .BeOnOrAfter(updateTime.ApplySystemClockTolerance()); } - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_ShouldAdjustTimesOnlyForDirectParentDirectory( string rootPath) @@ -170,7 +170,7 @@ public void CreateDirectory_ShouldAdjustTimesOnlyForDirectParentDirectory( } } - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_ShouldSetCreationTime(string path) { @@ -184,7 +184,7 @@ public void CreateDirectory_ShouldSetCreationTime(string path) result.Kind.Should().Be(DateTimeKind.Local); } - [SkippableTheory] + [Theory] [AutoData] public void CreateDirectory_ShouldSetCreationTimeUtc(string path) { @@ -198,7 +198,7 @@ public void CreateDirectory_ShouldSetCreationTimeUtc(string path) result.Kind.Should().Be(DateTimeKind.Utc); } - [SkippableFact] + [Fact] public void CreateDirectory_NullCharacter_ShouldThrowArgumentException() { string path = "foo\0bar"; @@ -208,7 +208,7 @@ public void CreateDirectory_NullCharacter_ShouldThrowArgumentException() exception.Should().BeException(hResult: -2147024809); } - [SkippableFact] + [Fact] public void CreateDirectory_ShouldCreateDirectoryInBasePath() { IDirectoryInfo result = FileSystem.Directory.CreateDirectory("foo"); @@ -217,7 +217,7 @@ public void CreateDirectory_ShouldCreateDirectoryInBasePath() result.FullName.Should().StartWith(BasePath); } - [SkippableFact] + [Fact] public void CreateDirectory_ShouldCreateParentDirectories() { string directoryLevel1 = "lvl1"; @@ -237,7 +237,7 @@ public void CreateDirectory_ShouldCreateParentDirectories() } #if NETFRAMEWORK - [SkippableTheory] + [Theory] [InlineData("/")] [InlineData("\\")] public void CreateDirectory_TrailingDirectorySeparator_ShouldNotBeTrimmed( @@ -261,7 +261,7 @@ public void CreateDirectory_TrailingDirectorySeparator_ShouldNotBeTrimmed( #endif #if NETFRAMEWORK - [SkippableTheory] + [Theory] [InlineData("")] [InlineData(" ")] public void CreateDirectory_EmptyOrWhitespace_ShouldReturnEmptyString( @@ -283,7 +283,7 @@ public void CreateDirectory_EmptyOrWhitespace_ShouldReturnEmptyString( FileSystem.Should().HaveDirectory(nameWithSuffix); } #else - [SkippableTheory] + [Theory] [InlineData("")] [InlineData(" ")] [InlineData("/")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateSymbolicLinkTests.cs index ea3704eb0..78a4cfa18 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateSymbolicLinkTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class CreateSymbolicLinkTests { - [SkippableTheory] + [Theory] [AutoData] public void CreateSymbolicLink_ShouldCreateSymbolicLink( string path, string pathToTarget) @@ -20,7 +20,7 @@ public void CreateSymbolicLink_ShouldCreateSymbolicLink( .Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateSymbolicLink_SourceDirectoryAlreadyExists_ShouldThrowIOException( string path, string pathToTarget) @@ -43,7 +43,7 @@ public void CreateSymbolicLink_SourceDirectoryAlreadyExists_ShouldThrowIOExcepti } } - [SkippableTheory] + [Theory] [AutoData] public void CreateSymbolicLink_TargetDirectoryMissing_ShouldNotThrowException( string path, string pathToTarget) @@ -56,7 +56,7 @@ public void CreateSymbolicLink_TargetDirectoryMissing_ShouldNotThrowException( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateSymbolicLink_WithIllegalCharactersInTarget_ShouldThrowIOException( string path) @@ -73,7 +73,7 @@ public void CreateSymbolicLink_WithIllegalCharactersInTarget_ShouldThrowIOExcept exception.Should().BeException(hResult: -2147024713); } - [SkippableTheory] + [Theory] [AutoData] public void CreateSymbolicLink_WithIllegalPath_ShouldThrowArgumentException_OnWindows( string pathToTarget) @@ -95,7 +95,7 @@ public void CreateSymbolicLink_WithIllegalPath_ShouldThrowArgumentException_OnWi } } - [SkippableTheory] + [Theory] [AutoData] public void CreateSymbolicLink_WithIllegalTarget_ShouldNotThrowException(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs index 4f25f7695..9a77a31b1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class DeleteTests { - [SkippableTheory] + [Theory] [AutoData] public void Delete_CaseDifferentPath_ShouldThrowDirectoryNotFoundException_OnLinux( @@ -31,7 +31,7 @@ public void } } - [SkippableTheory] + [Theory] [AutoData] public void Delete_FullPath_ShouldDeleteDirectory(string directoryName) { @@ -44,7 +44,7 @@ public void Delete_FullPath_ShouldDeleteDirectory(string directoryName) result.Should().NotExist(); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_MissingDirectory_ShouldThrowDirectoryNotFoundException( string directoryName) @@ -59,7 +59,7 @@ public void Delete_MissingDirectory_ShouldThrowDirectoryNotFoundException( hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_Recursive_MissingDirectory_ShouldThrowDirectoryNotFoundException( string directoryName) @@ -74,7 +74,7 @@ public void Delete_Recursive_MissingDirectory_ShouldThrowDirectoryNotFoundExcept hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_Recursive_WithFileInSubdirectory_ShouldDeleteDirectoryWithContent( string path, string subdirectory, string fileName, string fileContent) @@ -98,7 +98,7 @@ public void Delete_Recursive_WithFileInSubdirectory_ShouldDeleteDirectoryWithCon FileSystem.Should().NotHaveFile(subdirectoryFilePath); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_Recursive_WithOpenFile_ShouldThrowIOException_OnWindows( string path, string filename) @@ -129,7 +129,7 @@ public void Delete_Recursive_WithOpenFile_ShouldThrowIOException_OnWindows( } } - [SkippableTheory] + [Theory] [AutoData] public void Delete_Recursive_WithSimilarNamedFile_ShouldOnlyDeleteDirectoryAndItsContents( @@ -148,7 +148,7 @@ public void FileSystem.Should().HaveFile(fileName); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_Recursive_WithSubdirectory_ShouldDeleteDirectoryWithContent( string path, string subdirectory) @@ -163,7 +163,7 @@ public void Delete_Recursive_WithSubdirectory_ShouldDeleteDirectoryWithContent( FileSystem.Should().NotHaveDirectory(subdirectoryPath); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_ShouldAdjustTimes(string path, string subdirectoryName) { @@ -199,7 +199,7 @@ public void Delete_ShouldAdjustTimes(string path, string subdirectoryName) .BeOnOrAfter(updateTime.ApplySystemClockTolerance()); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_ShouldDeleteDirectory(string directoryName) { @@ -212,7 +212,7 @@ public void Delete_ShouldDeleteDirectory(string directoryName) result.Should().NotExist(); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_WithSimilarNamedFile_ShouldOnlyDeleteDirectory( string subdirectory) @@ -228,7 +228,7 @@ public void Delete_WithSimilarNamedFile_ShouldOnlyDeleteDirectory( FileSystem.Should().HaveFile(fileName); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_WithSubdirectory_ShouldThrowIOException_AndNotDeleteDirectory( string path, string subdirectory) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs index 335de9e63..099b88a0c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class EnumerateDirectoriesTests { - [SkippableFact] + [Fact] public void EnumerateDirectories_AbsolutePath_ShouldNotIncludeTrailingSlash() { FileSystem.Directory.CreateDirectory("foo"); @@ -22,7 +22,7 @@ public void EnumerateDirectories_AbsolutePath_ShouldNotIncludeTrailingSlash() result.Should().Contain(FileSystem.Path.Combine(BasePath, "bar")); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_MissingDirectory_ShouldThrowDirectoryNotFoundException( @@ -39,7 +39,7 @@ public void FileSystem.Should().NotHaveDirectory(path); } - [SkippableFact] + [Fact] public void EnumerateDirectories_RelativePath_ShouldNotIncludeTrailingSlash() { string path = "."; @@ -54,7 +54,7 @@ public void EnumerateDirectories_RelativePath_ShouldNotIncludeTrailingSlash() result.Should().Contain(FileSystem.Path.Combine(path, "bar")); } - [SkippableFact] + [Fact] public void EnumerateDirectories_RelativePathToParentDirectory_ShouldNotIncludeTrailingSlash() { @@ -70,7 +70,7 @@ public void result.Should().Contain(FileSystem.Path.Combine(path, "bar")); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_SearchOptionAllDirectories_FullPath_ShouldReturnAllSubdirectoriesWithFullPath( @@ -92,7 +92,7 @@ public void result.Should().Contain(FileSystem.Path.Combine(baseDirectory.FullName, "bar")); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_SearchOptionAllDirectories_ShouldReturnAllSubdirectories( @@ -112,7 +112,7 @@ public void result.Should().Contain(FileSystem.Path.Combine(path, "bar")); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -149,7 +149,7 @@ public void EnumerateDirectories_SearchPattern_ShouldReturnExpectedValue( } } - [SkippableTheory] + [Theory] [InlineAutoData(true, "*.xls", ".xls")] [InlineAutoData(false, "*.x", ".xls")] #if NETFRAMEWORK @@ -183,7 +183,7 @@ public void EnumerateDirectories_SearchPattern_WithFileExtension_ShouldReturnExp } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithEnumerationOptions_ShouldConsiderAttributesToSkip( @@ -208,7 +208,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineData(true)] [InlineData(false)] public void @@ -254,7 +254,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(MatchCasing.CaseInsensitive)] [InlineAutoData(MatchCasing.CaseSensitive)] public void @@ -285,7 +285,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(MatchType.Simple)] [InlineAutoData(MatchType.Win32)] public void @@ -315,7 +315,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(true, 0)] [InlineAutoData(true, 1)] [InlineAutoData(true, 2)] @@ -368,7 +368,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(true)] [InlineAutoData(false)] public void @@ -400,7 +400,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(true)] [InlineAutoData(false)] public void @@ -432,7 +432,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void EnumerateDirectories_WithEnumerationOptions_ShouldConsiderReturnSpecialDirectoriesCorrectlyForPathRoots() { @@ -458,7 +458,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithNewline_ShouldThrowArgumentException( string path) @@ -474,7 +474,7 @@ public void EnumerateDirectories_WithNewline_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithoutSearchString_ShouldReturnAllDirectSubdirectories( @@ -493,7 +493,7 @@ public void result.Should().Contain(FileSystem.Path.Combine(path, "bar")); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithSearchPattern_ShouldReturnMatchingSubdirectory( string path) @@ -509,7 +509,7 @@ public void EnumerateDirectories_WithSearchPattern_ShouldReturnMatchingSubdirect result.Should().Contain(FileSystem.Path.Combine(path, "foo")); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithSearchPatternInSubdirectory_ShouldReturnMatchingSubdirectory( @@ -526,7 +526,7 @@ public void result.Count().Should().Be(2); } - [SkippableFact] + [Fact] public void EnumerateDirectories_WithTrailingSlash_ShouldEnumerateSubdirectories() { string queryPath = "foo" + FileSystem.Path.DirectorySeparatorChar; diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFileSystemInfosTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFileSystemInfosTests.cs index d58e39da9..69b0b8360 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFileSystemInfosTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFileSystemInfosTests.cs @@ -11,7 +11,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class EnumerateFileSystemInfosTests { - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemEntries_MissingDirectory_ShouldThrowDirectoryNotFoundException( @@ -28,7 +28,7 @@ public void FileSystem.Should().NotHaveDirectory(path); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemEntries_SearchOptionAllDirectories_FullPath_ShouldReturnAllFileSystemEntriesWithFullPath( @@ -53,7 +53,7 @@ public void result.Should().Contain(initialized[2].FullName); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemEntries_SearchOptionAllDirectories_ShouldReturnAllFileSystemEntries( @@ -75,7 +75,7 @@ public void result.Should().Contain(initialized[2].ToString()); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -111,7 +111,7 @@ public void EnumerateFileSystemEntries_SearchPattern_ShouldReturnExpectedValue( } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemEntries_WithEnumerationOptions_ShouldConsiderSetOptions( @@ -140,7 +140,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemEntries_WithFileNameStartingWithDirectoryName_ShouldNotBeIncluded( @@ -157,7 +157,7 @@ public void result.Should().BeEmpty(); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemEntries_WithNewline_ShouldThrowArgumentException( string path) @@ -175,7 +175,7 @@ public void EnumerateFileSystemEntries_WithNewline_ShouldThrowArgumentException( messageContains: Test.IsNetFramework ? null : $"'{searchPattern}'"); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemEntries_WithoutSearchString_ShouldReturnAllFileSystemEntriesInDirectSubdirectories( @@ -200,7 +200,7 @@ public void result.Should().NotContain(initialized[3].ToString()); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemEntries_WithSearchPattern_ShouldReturnMatchingFileSystemEntries( @@ -223,7 +223,7 @@ public void result.Should().NotContain(initialized[3].ToString()); } - [SkippableFact] + [Fact] public void EnumerateFileSystemEntries_WithSearchPatternInSubdirectory_ShouldReturnMatchingFileSystemEntriesInSubdirectories() { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFilesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFilesTests.cs index 3c819783d..53237d8ac 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFilesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFilesTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class EnumerateFilesTests { - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFiles_MissingDirectory_ShouldThrowDirectoryNotFoundException( @@ -25,7 +25,7 @@ public void FileSystem.Should().NotHaveDirectory(path); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFiles_SearchOptionAllDirectories_FullPath_ShouldReturnAllFilesWithFullPath( @@ -47,7 +47,7 @@ public void result.Should().Contain(initialized[2].FullName); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFiles_SearchOptionAllDirectories_ShouldReturnAllFiles( string path) @@ -67,7 +67,7 @@ public void EnumerateFiles_SearchOptionAllDirectories_ShouldReturnAllFiles( result.Should().Contain(initialized[2].ToString()); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -102,7 +102,7 @@ public void EnumerateFiles_SearchPattern_ShouldReturnExpectedValue( } } - [SkippableTheory] + [Theory] [InlineAutoData(true, "*.xls", ".xls")] [InlineAutoData(false, "*.x", ".xls")] #if NETFRAMEWORK @@ -136,7 +136,7 @@ public void EnumerateFiles_SearchPattern_WithFileExtension_ShouldReturnExpectedV } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFiles_WithEnumerationOptions_ShouldConsiderAttributesToSkip( @@ -162,7 +162,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(MatchCasing.CaseInsensitive)] [InlineAutoData(MatchCasing.CaseSensitive)] public void @@ -192,7 +192,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(MatchType.Simple)] [InlineAutoData(MatchType.Win32)] public void @@ -221,7 +221,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(true, 0)] [InlineAutoData(true, 1)] [InlineAutoData(true, 2)] @@ -279,7 +279,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(true)] [InlineAutoData(false)] public void @@ -310,7 +310,7 @@ public void #endif #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(true)] [InlineAutoData(false)] public void @@ -335,7 +335,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFiles_WithNewline_ShouldThrowArgumentException( string path) @@ -353,7 +353,7 @@ public void EnumerateFiles_WithNewline_ShouldThrowArgumentException( messageContains: Test.IsNetFramework ? null : $"'{searchPattern}'"); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFiles_WithoutSearchString_ShouldReturnAllFilesInDirectSubdirectories( @@ -376,7 +376,7 @@ public void result.Should().NotContain(initialized[3].ToString()); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFiles_WithSearchPattern_ShouldReturnMatchingFiles( string path) @@ -398,7 +398,7 @@ public void EnumerateFiles_WithSearchPattern_ShouldReturnMatchingFiles( result.Should().NotContain(initialized[3].ToString()); } - [SkippableFact] + [Fact] public void EnumerateFiles_WithSearchPatternInSubdirectory_ShouldReturnMatchingFilesInSubdirectories() { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExceptionTests.cs index c40a3536e..fe540e417 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExceptionTests.cs @@ -8,8 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] - [MemberData(nameof(GetDirectoryCallbacks), parameters: "Illegal\tCharacter?InPath")] + [Theory] + [MemberData(nameof(GetDirectoryCallbacks), "Illegal\tCharacter?InPath")] public void Operations_WhenValueContainsIllegalPathCharacters_ShouldThrowCorrectException_OnWindows( Expression> callback, string paramName, @@ -49,8 +49,8 @@ public void } } - [SkippableTheory] - [MemberData(nameof(GetDirectoryCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetDirectoryCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck, Func skipTest) @@ -69,8 +69,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetDirectoryCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetDirectoryCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck, Func skipTest) @@ -88,8 +88,8 @@ public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( $"\n{callback}\n has `null` parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetDirectoryCallbacks), parameters: " ")] + [Theory] + [MemberData(nameof(GetDirectoryCallbacks), " ")] public void Operations_WhenValueIsWhitespace_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck, Func skipTest) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExistsTests.cs index 3c4abddb3..a719d7f29 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExistsTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class ExistsTests { - [SkippableTheory] + [Theory] [InlineData("foo")] [InlineData("foo/")] public void Exists_ExistingDirectory_ShouldReturnTrue(string path) @@ -15,7 +15,7 @@ public void Exists_ExistingDirectory_ShouldReturnTrue(string path) result.Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_File_ShouldReturnFalse(string path) { @@ -26,7 +26,7 @@ public void Exists_File_ShouldReturnFalse(string path) result.Should().BeFalse(); } - [SkippableTheory] + [Theory] [InlineData(@"\\s")] [InlineData("<")] [InlineData("\t")] @@ -39,7 +39,7 @@ public void Exists_IllegalPath_ShouldReturnFalse(string path) result.Should().BeFalse(); } - [SkippableTheory] + [Theory] [InlineData("foo")] [InlineData("foo/")] public void Exists_MissingDirectory_ShouldReturnFalse(string path) @@ -49,7 +49,7 @@ public void Exists_MissingDirectory_ShouldReturnFalse(string path) result.Should().BeFalse(); } - [SkippableFact] + [Fact] public void Exists_Null_ShouldReturnFalse() { bool result = FileSystem.Directory.Exists(null); @@ -57,7 +57,7 @@ public void Exists_Null_ShouldReturnFalse() result.Should().BeFalse(); } - [SkippableFact] + [Fact] public void Exists_Whitespace_ShouldReturnFalse() { bool result = FileSystem.Directory.Exists(" "); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoriesTests.cs index 91be93b89..5fe2026e1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoriesTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class GetDirectoriesTests { - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_MissingDirectory_ShouldThrowDirectoryNotFoundException( @@ -23,7 +23,7 @@ public void FileSystem.Should().NotHaveDirectory(path); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_SearchOptionAllDirectories_FullPath_ShouldReturnAllSubdirectoriesWithFullPath( @@ -45,7 +45,7 @@ public void result.Should().Contain(FileSystem.Path.Combine(baseDirectory.FullName, "bar")); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_SearchOptionAllDirectories_ShouldReturnAllSubdirectories( @@ -65,7 +65,7 @@ public void result.Should().Contain(FileSystem.Path.Combine(path, "bar")); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -103,7 +103,7 @@ public void GetDirectories_SearchPattern_ShouldReturnExpectedValue( } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithEnumerationOptions_ShouldConsiderSetOptions( @@ -131,7 +131,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithNewline_ShouldThrowArgumentException( string path) @@ -147,7 +147,7 @@ public void GetDirectories_WithNewline_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithoutSearchString_ShouldReturnAllDirectSubdirectories( @@ -166,7 +166,7 @@ public void result.Should().Contain(FileSystem.Path.Combine(path, "bar")); } - [SkippableFact] + [Fact] public void GetDirectories_WithRelativePath_ShouldReturnRelativePaths() { string path = $"foo{FileSystem.Path.DirectorySeparatorChar}bar"; @@ -177,7 +177,7 @@ public void GetDirectories_WithRelativePath_ShouldReturnRelativePaths() result.Should().BeEquivalentTo(path); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithSearchPattern_ShouldReturnMatchingSubdirectory( string path) @@ -193,7 +193,7 @@ public void GetDirectories_WithSearchPattern_ShouldReturnMatchingSubdirectory( result.Should().Contain(FileSystem.Path.Combine(path, "foo")); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithSearchPatternInSubdirectory_ShouldReturnMatchingSubdirectory( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoryRootTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoryRootTests.cs index 104402571..72ae9a1cc 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoryRootTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoryRootTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class GetDirectoryRootTests { - [SkippableFact] + [Fact] public void GetDirectoryRoot_Empty_ShouldThrowArgumentException() { Exception? exception = Record.Exception(() => @@ -14,7 +14,7 @@ public void GetDirectoryRoot_Empty_ShouldThrowArgumentException() exception.Should().BeException(hResult: -2147024809); } - [SkippableFact] + [Fact] public void GetDirectoryRoot_ShouldReturnDefaultRoot() { string expectedRoot = FileTestHelper.RootDrive(Test); @@ -24,7 +24,7 @@ public void GetDirectoryRoot_ShouldReturnDefaultRoot() result.Should().Be(expectedRoot); } - [SkippableTheory] + [Theory] [InlineData('A')] [InlineData('C')] [InlineData('X')] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFileSystemInfosTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFileSystemInfosTests.cs index 161421572..59018f275 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFileSystemInfosTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFileSystemInfosTests.cs @@ -11,7 +11,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class GetFileSystemInfosTests { - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemEntries_MissingDirectory_ShouldThrowDirectoryNotFoundException( @@ -27,7 +27,7 @@ public void FileSystem.Should().NotHaveDirectory(path); } - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemEntries_SearchOptionAllDirectories_FullPath_ShouldReturnAllFileSystemEntriesWithFullPath( @@ -52,7 +52,7 @@ public void result.Should().Contain(initialized[2].FullName); } - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemEntries_SearchOptionAllDirectories_ShouldReturnAllFileSystemEntries( @@ -74,7 +74,7 @@ public void result.Should().Contain(initialized[2].ToString()); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -110,7 +110,7 @@ public void GetFileSystemEntries_SearchPattern_ShouldReturnExpectedValue( } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemEntries_WithEnumerationOptions_ShouldConsiderSetOptions( @@ -139,7 +139,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemEntries_WithNewline_ShouldThrowArgumentException( string path) @@ -157,7 +157,7 @@ public void GetFileSystemEntries_WithNewline_ShouldThrowArgumentException( messageContains: Test.IsNetFramework ? null : $"'{searchPattern}'"); } - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemEntries_WithoutSearchString_ShouldReturnAllFileSystemEntriesInDirectSubdirectories( @@ -182,7 +182,7 @@ public void result.Should().NotContain(initialized[3].ToString()); } - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemEntries_WithSearchPattern_ShouldReturnMatchingFileSystemEntries( @@ -205,7 +205,7 @@ public void result.Should().NotContain(initialized[3].ToString()); } - [SkippableFact] + [Fact] public void GetFileSystemEntries_WithSearchPatternInSubdirectory_ShouldReturnMatchingFileSystemEntriesInSubdirectories() { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFilesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFilesTests.cs index a8b273b00..25bbca771 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFilesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFilesTests.cs @@ -11,7 +11,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class GetFilesTests { - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_MissingDirectory_ShouldThrowDirectoryNotFoundException( @@ -27,7 +27,7 @@ public void FileSystem.Should().NotHaveDirectory(path); } - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_Path_NotOnLinux_ShouldBeCaseInsensitive(string path) { @@ -42,7 +42,7 @@ public void GetFiles_Path_NotOnLinux_ShouldBeCaseInsensitive(string path) result.Length.Should().Be(1); } - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_Path_OnLinux_ShouldBeCaseSensitive(string path) { @@ -62,7 +62,7 @@ public void GetFiles_Path_OnLinux_ShouldBeCaseSensitive(string path) result2.Length.Should().Be(1); } - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_SearchOptionAllDirectories_FullPath_ShouldReturnAllFilesWithFullPath( @@ -84,7 +84,7 @@ public void result.Should().Contain(initialized[2].FullName); } - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_SearchOptionAllDirectories_ShouldReturnAllFiles( string path) @@ -104,7 +104,7 @@ public void GetFiles_SearchOptionAllDirectories_ShouldReturnAllFiles( result.Should().Contain(initialized[2].ToString()); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -139,7 +139,7 @@ public void GetFiles_SearchPattern_ShouldReturnExpectedValue( } } - [SkippableFact] + [Fact] public void GetFiles_SearchPatternForFileWithoutExtension_ShouldWorkConsistently() { FileSystem.Initialize() @@ -151,7 +151,7 @@ public void GetFiles_SearchPatternForFileWithoutExtension_ShouldWorkConsistently result.Length.Should().Be(1); } - [SkippableFact] + [Fact] public void GetFiles_SearchPatternWithDirectorySeparator_ShouldReturnFilesInSubdirectoryOnWindows() { @@ -177,7 +177,7 @@ public void } } - [SkippableFact] + [Fact] public void GetFiles_SearchPatternWithTooManyAsterisk_ShouldWorkConsistently() { FileSystem.Initialize() @@ -189,7 +189,7 @@ public void GetFiles_SearchPatternWithTooManyAsterisk_ShouldWorkConsistently() } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_WithEnumerationOptions_ShouldConsiderSetOptions( @@ -218,7 +218,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_WithNewline_ShouldThrowArgumentException( string path) @@ -236,7 +236,7 @@ public void GetFiles_WithNewline_ShouldThrowArgumentException( messageContains: Test.IsNetFramework ? null : $"'{searchPattern}'"); } - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_WithoutSearchString_ShouldReturnAllFilesInDirectSubdirectories( @@ -259,7 +259,7 @@ public void result.Should().NotContain(initialized[3].ToString()); } - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_WithRelativePathAndSubfolders_ShouldReturnRelativeFilePath( string subfolder1, string subfolder2, string[] files) @@ -281,7 +281,7 @@ public void GetFiles_WithRelativePathAndSubfolders_ShouldReturnRelativeFilePath( result.Should().BeEquivalentTo(expectation); } - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_WithSearchPattern_ShouldReturnMatchingFiles( string path) @@ -303,7 +303,7 @@ public void GetFiles_WithSearchPattern_ShouldReturnMatchingFiles( result.Should().NotContain(initialized[3].ToString()); } - [SkippableFact] + [Fact] public void GetFiles_WithSearchPatternInSubdirectory_ShouldReturnMatchingFilesInSubdirectories() { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/MoveTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/MoveTests.cs index b03ad0af3..633287f2e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/MoveTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/MoveTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class MoveTests { - [SkippableTheory] + [Theory] [AutoData] public void Move_CaseOnlyChange_ShouldMoveDirectoryWithContent(string path) { @@ -40,7 +40,7 @@ public void Move_CaseOnlyChange_ShouldMoveDirectoryWithContent(string path) .Should().ContainSingle(); } - [SkippableTheory] + [Theory] [AutoData] public void Move_CaseOnlyChange_ShouldThrowIOException_OnNetFramework(string path) { @@ -59,7 +59,7 @@ public void Move_CaseOnlyChange_ShouldThrowIOException_OnNetFramework(string pat exception.Should().BeException(hResult: -2146232800); } - [SkippableTheory] + [Theory] [AutoData] public void Move_DestinationDoesNotExist_ShouldThrowDirectoryNotFoundException( string source) @@ -76,7 +76,7 @@ public void Move_DestinationDoesNotExist_ShouldThrowDirectoryNotFoundException( exception.Should().BeException(hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void Move_ShouldMoveAttributes(string source, string destination) { @@ -92,7 +92,7 @@ public void Move_ShouldMoveAttributes(string source, string destination) .Should().Be(expectedAttributes); } - [SkippableTheory] + [Theory] [AutoData] public void Move_ShouldMoveDirectoryWithContent(string source, string destination) { @@ -120,7 +120,7 @@ public void Move_ShouldMoveDirectoryWithContent(string source, string destinatio .Should().ContainSingle(); } - [SkippableTheory] + [Theory] [AutoData] public void Move_ShouldNotAdjustTimes(string source, string destination) { @@ -154,7 +154,7 @@ public void Move_ShouldNotAdjustTimes(string source, string destination) .BeBetween(creationTimeStart, creationTimeEnd); } - [SkippableTheory] + [Theory] [AutoData] public void Move_SourceAndDestinationIdentical_ShouldThrowIOException(string path) { @@ -169,7 +169,7 @@ public void Move_SourceAndDestinationIdentical_ShouldThrowIOException(string pat exception.Should().BeException(hResult: -2146232800); } - [SkippableTheory] + [Theory] [AutoData] public void Move_WithLockedFile_ShouldStillMoveDirectory_NotOnWindows( string source, string destination) @@ -210,7 +210,7 @@ public void Move_WithLockedFile_ShouldStillMoveDirectory_NotOnWindows( .Should().ContainSingle(); } - [SkippableTheory] + [Theory] [AutoData] public void Move_WithLockedFile_ShouldThrowIOException_AndNotMoveDirectoryAtAll_OnWindows( string source, string destination) @@ -250,7 +250,7 @@ public void Move_WithLockedFile_ShouldThrowIOException_AndNotMoveDirectoryAtAll_ .Should().ContainSingle(); } - [SkippableTheory] + [Theory] [AutoData] public void Move_WithReadOnlyFile_ShouldMoveDirectoryWithContent( string source, string destination) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ResolveLinkTargetTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ResolveLinkTargetTests.cs index a38cd6fb1..70b6a093c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ResolveLinkTargetTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ResolveLinkTargetTests.cs @@ -18,7 +18,7 @@ public partial class ResolveLinkTargetTests #endregion - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_AbsolutePath_ShouldFollowSymbolicLink( string path, string pathToTarget) @@ -34,7 +34,7 @@ public void ResolveLinkTarget_AbsolutePath_ShouldFollowSymbolicLink( target.Should().Exist(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FileWithDifferentCase_ShouldReturnPathToMissingDirectory( @@ -61,7 +61,7 @@ public void } } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FinalTarget_ShouldFollowSymbolicLinkToFinalTarget( string path, string pathToFinalTarget) @@ -86,7 +86,7 @@ public void ResolveLinkTarget_FinalTarget_ShouldFollowSymbolicLinkToFinalTarget( target!.FullName.Should().Be(FileSystem.Path.GetFullPath(pathToFinalTarget)); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FinalTargetWithTooManyLevels_ShouldThrowIOException( string path, string pathToFinalTarget) @@ -113,7 +113,7 @@ public void ResolveLinkTarget_FinalTargetWithTooManyLevels_ShouldThrowIOExceptio hResult: Test.RunsOnWindows ? -2147022975 : -2146232800); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_MissingDirectoryInLinkChain_ShouldReturnPathToMissingDirectory( @@ -134,7 +134,7 @@ public void target!.FullName.Should().Be(FileSystem.Path.GetFullPath(pathToMissingDirectory)); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_NormalDirectory_ShouldReturnNull( string path) @@ -147,7 +147,7 @@ public void ResolveLinkTarget_NormalDirectory_ShouldReturnNull( target.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_NormalFile_ShouldReturnNull( string path) @@ -160,7 +160,7 @@ public void ResolveLinkTarget_NormalFile_ShouldReturnNull( target.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_RelativePath_ShouldFollowSymbolicLinkUnderWindows( string path, string pathToTarget) @@ -176,7 +176,7 @@ public void ResolveLinkTarget_RelativePath_ShouldFollowSymbolicLinkUnderWindows( target.Should().Exist(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_TargetDeletedAfterLinkCreation_ShouldReturnNull( string path, string pathToTarget) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/SearchFilterTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/SearchFilterTests.cs index 66cfe2748..d24d42eca 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/SearchFilterTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/SearchFilterTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; [FileSystemTests] public partial class SearchFilterTests { - [SkippableTheory] + [Theory] [InlineAutoData("../", 4)] [InlineAutoData("../*", 4)] [InlineAutoData("../a*", 2)] @@ -30,7 +30,7 @@ public void result.Should().Contain(FileSystem.Path.Combine(".", "..", "xyz", "a.test")); } - [SkippableTheory] + [Theory] [InlineAutoData("../../", 5)] [InlineAutoData("../../*", 5)] [InlineAutoData("../../a*", 2)] @@ -60,7 +60,7 @@ public void .Contain(FileSystem.Path.Combine(".", "../..", "bar", "xyz", "a.test")); } - [SkippableTheory] + [Theory] [InlineAutoData("../../../", 6)] [InlineAutoData("../../../*", 6)] [InlineAutoData("../../../a*", 2)] @@ -94,7 +94,7 @@ public void FileSystem.Path.Combine(".", "../../..", "foo", "bar", "xyz", "a.test")); } - [SkippableFact] + [Fact] public void SearchPattern_ContainingAsterisk_ShouldReturnMatchingFiles() { FileSystem.Initialize() @@ -111,7 +111,7 @@ public void SearchPattern_ContainingAsterisk_ShouldReturnMatchingFiles() result.Should().Contain(FileSystem.Path.Combine(".", "another.test")); } - [SkippableFact] + [Fact] public void SearchPattern_ContainingQuestionMark_ShouldReturnMatchingFiles() { FileSystem.Initialize() @@ -127,7 +127,7 @@ public void SearchPattern_ContainingQuestionMark_ShouldReturnMatchingFiles() result[0].Should().Be(FileSystem.Path.Combine(".", "a-test")); } - [SkippableFact] + [Fact] public void SearchPattern_ContainingTooManyInstancesOfMultipleTwoDotsAndDirectorySeparator_ShouldThrowUnauthorizedAccessException() { @@ -160,7 +160,7 @@ public void exception.Should().BeException(hResult: -2147024891); } - [SkippableTheory] + [Theory] [InlineAutoData("../", 4)] [InlineAutoData("../*", 4)] [InlineAutoData("../a*", 2)] @@ -182,7 +182,7 @@ public void result.Should().Contain(FileSystem.Path.Combine(".", "..", path, "a.test")); } - [SkippableTheory] + [Theory] [InlineAutoData("../")] [InlineAutoData("../*")] [InlineAutoData("../a*")] @@ -204,7 +204,7 @@ public void exception.Should().BeException(hResult: -2147024809); } - [SkippableFact] + [Fact] public void SearchPattern_ContainingWithTwoDots_ShouldContainMatchingFiles() { FileSystem.Initialize() @@ -218,7 +218,7 @@ public void SearchPattern_ContainingWithTwoDots_ShouldContainMatchingFiles() result.Length.Should().Be(1); } - [SkippableFact] + [Fact] public void SearchPattern_EndingWithTwoDots_ShouldNotMatchAnyFile() { Skip.If(Test.IsNetFramework); @@ -242,7 +242,7 @@ public void SearchPattern_EndingWithTwoDots_ShouldNotMatchAnyFile() } } - [SkippableFact] + [Fact] public void SearchPattern_Extension_ShouldReturnAllFilesWithTheExtension() { FileSystem.Initialize() @@ -260,7 +260,7 @@ public void SearchPattern_Extension_ShouldReturnAllFilesWithTheExtension() result.Length.Should().Be(3); } - [SkippableFact] + [Fact] public void SearchPattern_Null_ShouldThrowArgumentNullException() { FileSystem.Initialize(); @@ -274,7 +274,7 @@ public void SearchPattern_Null_ShouldThrowArgumentNullException() exception.Should().BeException(paramName: "searchPattern"); } - [SkippableFact] + [Fact] public void SearchPattern_StarDot_ShouldReturnFilesWithoutExtension() { FileSystem.Initialize() @@ -297,7 +297,7 @@ public void SearchPattern_StarDot_ShouldReturnFilesWithoutExtension() } } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.AdjustTimes.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.AdjustTimes.cs index 471c5069d..2d841161f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.AdjustTimes.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.AdjustTimes.cs @@ -2,7 +2,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void AdjustTimes_WhenCreatingAFile_ShouldAdjustTimes( string path1, string path2, string fileName) @@ -55,7 +55,7 @@ public void AdjustTimes_WhenCreatingAFile_ShouldAdjustTimes( } #if FEATURE_FILESYSTEM_LINK - [SkippableTheory] + [Theory] [AutoData] public void AdjustTimes_WhenCreatingASymbolicLink_ShouldAdjustTimes( string path1, string path2, string fileName, string pathToTarget) @@ -110,7 +110,7 @@ public void AdjustTimes_WhenCreatingASymbolicLink_ShouldAdjustTimes( } #endif - [SkippableTheory] + [Theory] [AutoData] public void AdjustTimes_WhenDeletingAFile_ShouldAdjustTimes( string path1, string path2, string fileName) @@ -163,7 +163,7 @@ public void AdjustTimes_WhenDeletingAFile_ShouldAdjustTimes( .BeBetween(creationTimeStart, creationTimeEnd); } - [SkippableTheory] + [Theory] [AutoData] public void AdjustTimes_WhenUpdatingAFile_ShouldAdjustTimesOnlyOnWindows( string path1, string path2, string fileName) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs index ea4079145..7b997f6ec 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs @@ -4,7 +4,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void GetCreationTime_PathNotFound_ShouldReturnNullTime(string path) { @@ -15,7 +15,7 @@ public void GetCreationTime_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetCreationTimeUtc_PathNotFound_ShouldReturnNullTime(string path) { @@ -26,7 +26,7 @@ public void GetCreationTimeUtc_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetLastAccessTime_PathNotFound_ShouldReturnNullTime(string path) { @@ -37,7 +37,7 @@ public void GetLastAccessTime_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetLastAccessTimeUtc_PathNotFound_ShouldReturnNullTime(string path) { @@ -48,7 +48,7 @@ public void GetLastAccessTimeUtc_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetLastWriteTime_PathNotFound_ShouldReturnNullTime(string path) { @@ -59,7 +59,7 @@ public void GetLastWriteTime_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetLastWriteTimeUtc_PathNotFound_ShouldReturnNullTime(string path) { @@ -70,7 +70,7 @@ public void GetLastWriteTimeUtc_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void LastAccessTime_CreateSubDirectory_ShouldUpdateLastAccessAndLastWriteTime( string path, string subPath) @@ -99,7 +99,7 @@ public void LastAccessTime_CreateSubDirectory_ShouldUpdateLastAccessAndLastWrite .BeBetween(sleepTime, TimeSystem.DateTime.Now); } - [SkippableTheory] + [Theory] [AutoData] public void LastAccessTime_ShouldBeSet(string path) { @@ -112,7 +112,7 @@ public void LastAccessTime_ShouldBeSet(string path) result.Kind.Should().Be(DateTimeKind.Local); } - [SkippableTheory] + [Theory] [AutoData] public void LastAccessTimeUtc_ShouldBeSet(string path) { @@ -125,7 +125,7 @@ public void LastAccessTimeUtc_ShouldBeSet(string path) result.Kind.Should().Be(DateTimeKind.Utc); } - [SkippableTheory] + [Theory] [AutoData] public void LastWriteTime_ShouldBeSet(string path) { @@ -138,7 +138,7 @@ public void LastWriteTime_ShouldBeSet(string path) result.Kind.Should().Be(DateTimeKind.Local); } - [SkippableTheory] + [Theory] [AutoData] public void LastWriteTimeUtc_ShouldBeSet(string path) { @@ -151,7 +151,7 @@ public void LastWriteTimeUtc_ShouldBeSet(string path) result.Kind.Should().Be(DateTimeKind.Utc); } - [SkippableTheory] + [Theory] [AutoData] public void SetCreationTime_PathNotFound_ShouldThrowCorrectException( string path, DateTime creationTime) @@ -175,7 +175,7 @@ public void SetCreationTime_PathNotFound_ShouldThrowCorrectException( } } - [SkippableTheory] + [Theory] [AutoData] public void SetCreationTime_ShouldChangeCreationTime( string path, DateTime creationTime) @@ -193,7 +193,7 @@ public void SetCreationTime_ShouldChangeCreationTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetCreationTime_Unspecified_ShouldChangeCreationTime( string path, DateTime creationTime) @@ -214,7 +214,7 @@ public void SetCreationTime_Unspecified_ShouldChangeCreationTime( .Should().NotBe(DateTimeKind.Unspecified); } - [SkippableTheory] + [Theory] [AutoData] public void SetCreationTimeUtc_PathNotFound_ShouldThrowCorrectException( string path, DateTime creationTime) @@ -238,7 +238,7 @@ public void SetCreationTimeUtc_PathNotFound_ShouldThrowCorrectException( } } - [SkippableTheory] + [Theory] [AutoData] public void SetCreationTimeUtc_ShouldChangeCreationTime( string path, DateTime creationTime) @@ -256,7 +256,7 @@ public void SetCreationTimeUtc_ShouldChangeCreationTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetCreationTimeUtc_Unspecified_ShouldChangeCreationTime( string path, DateTime creationTime) @@ -277,7 +277,7 @@ public void SetCreationTimeUtc_Unspecified_ShouldChangeCreationTime( .Should().NotBe(DateTimeKind.Unspecified); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastAccessTime_PathNotFound_ShouldThrowCorrectException( string path, DateTime lastAccessTime) @@ -301,7 +301,7 @@ public void SetLastAccessTime_PathNotFound_ShouldThrowCorrectException( } } - [SkippableTheory] + [Theory] [AutoData] public void SetLastAccessTime_ShouldChangeLastAccessTime( string path, DateTime lastAccessTime) @@ -316,7 +316,7 @@ public void SetLastAccessTime_ShouldChangeLastAccessTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastAccessTime_Unspecified_ShouldChangeLastAccessTime( string path, DateTime lastAccessTime) @@ -334,7 +334,7 @@ public void SetLastAccessTime_Unspecified_ShouldChangeLastAccessTime( .Should().NotBe(DateTimeKind.Unspecified); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastAccessTimeUtc_PathNotFound_ShouldThrowCorrectException( string path, DateTime lastAccessTime) @@ -358,7 +358,7 @@ public void SetLastAccessTimeUtc_PathNotFound_ShouldThrowCorrectException( } } - [SkippableTheory] + [Theory] [AutoData] public void SetLastAccessTimeUtc_ShouldChangeLastAccessTime( string path, DateTime lastAccessTime) @@ -373,7 +373,7 @@ public void SetLastAccessTimeUtc_ShouldChangeLastAccessTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastAccessTimeUtc_Unspecified_ShouldChangeLastAccessTime( string path, DateTime lastAccessTime) @@ -391,7 +391,7 @@ public void SetLastAccessTimeUtc_Unspecified_ShouldChangeLastAccessTime( .Should().NotBe(DateTimeKind.Unspecified); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastWriteTime_PathNotFound_ShouldThrowCorrectException( string path, DateTime lastWriteTime) @@ -415,7 +415,7 @@ public void SetLastWriteTime_PathNotFound_ShouldThrowCorrectException( } } - [SkippableTheory] + [Theory] [AutoData] public void SetLastWriteTime_ShouldChangeLastWriteTime( string path, DateTime lastWriteTime) @@ -430,7 +430,7 @@ public void SetLastWriteTime_ShouldChangeLastWriteTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastWriteTime_Unspecified_ShouldChangeLastWriteTime( string path, DateTime lastWriteTime) @@ -448,7 +448,7 @@ public void SetLastWriteTime_Unspecified_ShouldChangeLastWriteTime( .Should().NotBe(DateTimeKind.Unspecified); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastWriteTimeUtc_PathNotFound_ShouldThrowCorrectException( string path, DateTime lastWriteTime) @@ -472,7 +472,7 @@ public void SetLastWriteTimeUtc_PathNotFound_ShouldThrowCorrectException( } } - [SkippableTheory] + [Theory] [AutoData] public void SetLastWriteTimeUtc_ShouldChangeLastWriteTime( string path, DateTime lastWriteTime) @@ -487,7 +487,7 @@ public void SetLastWriteTimeUtc_ShouldChangeLastWriteTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastWriteTimeUtc_Unspecified_ShouldChangeLastWriteTime( string path, DateTime lastWriteTime) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.cs index f6d57b3e3..1c2d8be8b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; public partial class Tests { #if FEATURE_FILESYSTEM_NET7 - [SkippableFact] + [Fact] public void CreateTempSubdirectory_ShouldCreateTheTemporaryDirectory() { IDirectoryInfo result = FileSystem.Directory.CreateTempSubdirectory(); @@ -16,7 +16,7 @@ public void CreateTempSubdirectory_ShouldCreateTheTemporaryDirectory() #endif #if FEATURE_FILESYSTEM_NET7 - [SkippableTheory] + [Theory] [AutoData] public void CreateTempSubdirectory_WithPrefix_ShouldStartWithPrefix(string prefix) { @@ -25,7 +25,7 @@ public void CreateTempSubdirectory_WithPrefix_ShouldStartWithPrefix(string prefi result.Name.Should().StartWith(prefix); } #endif - [SkippableFact] + [Fact] public void GetCurrentDirectory_ShouldNotBeRooted() { string result = FileSystem.Directory.GetCurrentDirectory(); @@ -33,7 +33,7 @@ public void GetCurrentDirectory_ShouldNotBeRooted() result.Should().NotBe(FileTestHelper.RootDrive(Test)); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectoryRoot_ShouldReturnRoot(string path) { @@ -45,7 +45,7 @@ public void GetDirectoryRoot_ShouldReturnRoot(string path) result.Should().Be(root); } - [SkippableFact] + [Fact] public void GetLogicalDrives_ShouldNotBeEmpty() { string[] result = FileSystem.Directory.GetLogicalDrives(); @@ -54,7 +54,7 @@ public void GetLogicalDrives_ShouldNotBeEmpty() result.Should().Contain(FileTestHelper.RootDrive(Test)); } - [SkippableTheory] + [Theory] [AutoData] public void GetParent_ArbitraryPaths_ShouldNotBeNull(string path1, string path2, @@ -70,7 +70,7 @@ public void GetParent_ArbitraryPaths_ShouldNotBeNull(string path1, result!.FullName.Should().Be(expectedParent.FullName); } - [SkippableFact] + [Fact] public void GetParent_Root_ShouldReturnNull() { string path = FileTestHelper.RootDrive(Test); @@ -80,7 +80,7 @@ public void GetParent_Root_ShouldReturnNull() result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void SetCurrentDirectory_MissingDirectory_ShouldThrowDirectoryNotFoundException( @@ -104,7 +104,7 @@ public void } } - [SkippableTheory] + [Theory] [AutoData] public void SetCurrentDirectory_RelativePath_ShouldBeFullyQualified(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/AttributesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/AttributesTests.cs index 8b26e81d5..bf69339a8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/AttributesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/AttributesTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class AttributesTests { - [SkippableTheory] + [Theory] [AutoData] public void Attributes_ClearAllAttributes_ShouldRemainDirectory(string path) { @@ -19,7 +19,7 @@ public void Attributes_ClearAllAttributes_ShouldRemainDirectory(string path) sut.Attributes.Should().HaveFlag(FileAttributes.Directory); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.ReadOnly)] [InlineAutoData(FileAttributes.Normal)] public void Attributes_WhenFileIsExisting_SetterShouldChangeAttributesOnFileSystem( @@ -35,7 +35,7 @@ public void Attributes_WhenFileIsExisting_SetterShouldChangeAttributesOnFileSyst sut2.Attributes.Should().Be(expectedAttributes); } - [SkippableFact] + [Fact] public void Attributes_WhenFileIsMissing_SetterShouldThrowFileNotFoundException() { IDirectoryInfo sut = FileSystem.DirectoryInfo.New("missing file"); @@ -48,7 +48,7 @@ public void Attributes_WhenFileIsMissing_SetterShouldThrowFileNotFoundException( exception.Should().BeException(hResult: -2147024894); } - [SkippableFact] + [Fact] public void Attributes_WhenFileIsMissing_ShouldReturnMinusOne() { IDirectoryInfo sut = FileSystem.DirectoryInfo.New("missing file"); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateAsSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateAsSymbolicLinkTests.cs index 6f9e1744d..18365399f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateAsSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateAsSymbolicLinkTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class CreateAsSymbolicLinkTests { - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_ShouldCreateAsSymbolicLink( string path, string pathToTarget) @@ -20,7 +20,7 @@ public void CreateAsSymbolicLink_ShouldCreateAsSymbolicLink( .Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_SourceDirectoryAlreadyExists_ShouldThrowIOException( string path, string pathToTarget) @@ -37,7 +37,7 @@ public void CreateAsSymbolicLink_SourceDirectoryAlreadyExists_ShouldThrowIOExcep hResult: Test.RunsOnWindows ? -2147024713 : 17); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_TargetDirectoryMissing_ShouldNotThrowException( string path, string pathToTarget) @@ -50,7 +50,7 @@ public void CreateAsSymbolicLink_TargetDirectoryMissing_ShouldNotThrowException( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithIllegalCharactersInTarget_ShouldThrowIOException( string path) @@ -67,7 +67,7 @@ public void CreateAsSymbolicLink_WithIllegalCharactersInTarget_ShouldThrowIOExce exception.Should().BeException(hResult: -2147024713); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithIllegalTarget_ShouldNotThrowException(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateSubdirectoryTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateSubdirectoryTests.cs index 9e92fc712..7637ae32b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateSubdirectoryTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateSubdirectoryTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class CreateSubdirectoryTests { - [SkippableTheory] + [Theory] [AutoData] public void CreateSubdirectory_FileWithSameNameAlreadyExists_ShouldThrowIOException( string name) @@ -23,7 +23,7 @@ public void CreateSubdirectory_FileWithSameNameAlreadyExists_ShouldThrowIOExcept FileSystem.Should().NotHaveDirectory(name); } - [SkippableTheory] + [Theory] [AutoData] public void CreateSubdirectory_MissingParent_ShouldCreateDirectory( string path, string subdirectory) @@ -38,7 +38,7 @@ public void CreateSubdirectory_MissingParent_ShouldCreateDirectory( FileSystem.Should().HaveDirectory(result.FullName); } - [SkippableTheory] + [Theory] [AutoData] public void CreateSubdirectory_ShouldCreateDirectory(string path, string subdirectory) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateTests.cs index 039a610dc..7f57f071c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class CreateTests { - [SkippableTheory] + [Theory] [AutoData] public void Create_FileWithSameNameAlreadyExists_ShouldThrowIOException(string name) { @@ -22,7 +22,7 @@ public void Create_FileWithSameNameAlreadyExists_ShouldThrowIOException(string n FileSystem.Should().NotHaveDirectory(name); } - [SkippableTheory] + [Theory] [AutoData] public void Create_ShouldCreateDirectory(string path) { @@ -40,7 +40,7 @@ public void Create_ShouldCreateDirectory(string path) FileSystem.Should().HaveDirectory(sut.FullName); } - [SkippableFact] + [Fact] public void Create_ShouldCreateInBasePath() { IDirectoryInfo result = FileSystem.DirectoryInfo.New("foo"); @@ -51,7 +51,7 @@ public void Create_ShouldCreateInBasePath() result.FullName.Should().StartWith(BasePath); } - [SkippableFact] + [Fact] public void Create_ShouldCreateParentDirectories() { string directoryLevel1 = "lvl1"; @@ -72,7 +72,7 @@ public void Create_ShouldCreateParentDirectories() result.ToString().Should().Be(path); } - [SkippableTheory] + [Theory] [AutoData] public void Create_ShouldRefreshExistsCacheForCurrentItem_ExceptOnNetFramework(string path) { @@ -101,7 +101,7 @@ public void Create_ShouldRefreshExistsCacheForCurrentItem_ExceptOnNetFramework(s FileSystem.Should().HaveDirectory(path); } - [SkippableTheory] + [Theory] [InlineData("")] [InlineData("/")] [InlineData("\\")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs index e9a45ad06..008d28448 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class DeleteTests { - [SkippableTheory] + [Theory] [AutoData] public void Delete_MissingDirectory_ShouldThrowDirectoryNotFoundException(string path) { @@ -21,7 +21,7 @@ public void Delete_MissingDirectory_ShouldThrowDirectoryNotFoundException(string hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_Recursive_WithOpenFile_ShouldThrowIOException_OnWindows( string path, string filename) @@ -53,7 +53,7 @@ public void Delete_Recursive_WithOpenFile_ShouldThrowIOException_OnWindows( } } - [SkippableTheory] + [Theory] [AutoData] public void Delete_Recursive_WithSubdirectory_ShouldDeleteDirectoryWithContent( string path, string subdirectory) @@ -75,7 +75,7 @@ public void Delete_Recursive_WithSubdirectory_ShouldDeleteDirectoryWithContent( FileSystem.Should().NotHaveDirectory(subdirectoryPath); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_ShouldDeleteDirectory(string path) { @@ -94,7 +94,7 @@ public void Delete_ShouldDeleteDirectory(string path) FileSystem.Should().NotHaveDirectory(sut.FullName); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_WithSubdirectory_ShouldThrowIOException_AndNotDeleteDirectory( string path, string subdirectory) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateDirectoriesTests.cs index 85976971c..4f8aa792f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateDirectoriesTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class EnumerateDirectoriesTests { - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_SearchOptionAllDirectories_ShouldReturnAllSubdirectories( @@ -31,7 +31,7 @@ public void result.Should().Contain(d => d.Name == "xyz"); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -68,7 +68,7 @@ public void EnumerateDirectories_SearchPattern_ShouldReturnExpectedValue( } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithEnumerationOptions_ShouldConsiderSetOptions( @@ -96,7 +96,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithNewline_ShouldThrowArgumentException( string path) @@ -113,7 +113,7 @@ public void EnumerateDirectories_WithNewline_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithoutSearchString_ShouldReturnAllDirectSubdirectories( @@ -133,7 +133,7 @@ public void result.Should().Contain(d => d.Name == "bar"); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithSearchPattern_ShouldReturnMatchingSubdirectory( string path) @@ -149,7 +149,7 @@ public void EnumerateDirectories_WithSearchPattern_ShouldReturnMatchingSubdirect result.Should().ContainSingle(d => d.Name == "foo"); } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateDirectories_WithSearchPatternInSubdirectory_ShouldReturnMatchingSubdirectory( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFileSystemInfosTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFileSystemInfosTests.cs index aaa4ff5c5..aaa0884d7 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFileSystemInfosTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFileSystemInfosTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class EnumerateFileSystemInfosTests { - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemInfos_SearchOptionAllFiles_ShouldReturnAllFiles( @@ -36,7 +36,7 @@ public void result.Should().Contain(d => d.Name == initialized[5].Name); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -73,7 +73,7 @@ public void EnumerateFileSystemInfos_SearchPattern_ShouldReturnExpectedValue( } } - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemInfos_ShouldMatchTypes(string path) @@ -97,7 +97,7 @@ public void } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void EnumerateFileSystemInfos_WithEnumerationOptions_ShouldConsiderSetOptions() { @@ -125,7 +125,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFileSystemInfos_WithNewline_ShouldThrowArgumentException( string path) @@ -142,7 +142,7 @@ public void EnumerateFileSystemInfos_WithNewline_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableFact] + [Fact] public void EnumerateFileSystemInfos_WithoutSearchString_ShouldReturnAllDirectFilesAndDirectories() { @@ -164,7 +164,7 @@ public void result.Should().Contain(d => d.Name == "bar"); } - [SkippableFact] + [Fact] public void EnumerateFileSystemInfos_WithSearchPattern_ShouldReturnMatchingFiles() { IDirectoryInfo baseDirectory = @@ -180,7 +180,7 @@ public void EnumerateFileSystemInfos_WithSearchPattern_ShouldReturnMatchingFiles result.Count().Should().Be(1); } - [SkippableFact] + [Fact] public void EnumerateFileSystemInfos_WithSearchPatternInSubdirectory_ShouldReturnMatchingFiles() { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFilesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFilesTests.cs index 9501978f2..e83392b9c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFilesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFilesTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class EnumerateFilesTests { - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFiles_SearchOptionAllFiles_ShouldReturnAllFiles( @@ -34,7 +34,7 @@ public void result.Should().Contain(d => d.Name == initialized[5].Name); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -72,7 +72,7 @@ public void EnumerateFiles_SearchPattern_ShouldReturnExpectedValue( } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void EnumerateFiles_WithEnumerationOptions_ShouldConsiderSetOptions() { @@ -100,7 +100,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void EnumerateFiles_WithNewline_ShouldThrowArgumentException( string path) @@ -117,7 +117,7 @@ public void EnumerateFiles_WithNewline_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableFact] + [Fact] public void EnumerateFiles_WithoutSearchString_ShouldReturnAllDirectFiles() { @@ -138,7 +138,7 @@ public void result.Should().Contain(d => d.Name == "bar"); } - [SkippableFact] + [Fact] public void EnumerateFiles_WithSearchPattern_ShouldReturnMatchingFiles() { IDirectoryInfo baseDirectory = @@ -154,7 +154,7 @@ public void EnumerateFiles_WithSearchPattern_ShouldReturnMatchingFiles() result.Count().Should().Be(1); } - [SkippableFact] + [Fact] public void EnumerateFiles_WithSearchPatternInSubdirectory_ShouldReturnMatchingFiles() { @@ -174,7 +174,7 @@ public void result.Count().Should().Be(2); } - [SkippableFact] + [Fact] public void EnumerateFiles_WithSearchPatternWithDirectorySeparator_ShouldReturnFilesInSubdirectoryOnWindows() { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExceptionTests.cs index 499fdb331..942c9b05c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExceptionTests.cs @@ -8,9 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] - [MemberData(nameof(GetDirectoryInfoCallbacks), - parameters: "Illegal\tCharacter?InPath")] + [Theory] + [MemberData(nameof(GetDirectoryInfoCallbacks), "Illegal\tCharacter?InPath")] public void Operations_WhenValueContainsIllegalPathCharacters_ShouldThrowCorrectException_OnWindows( Expression> callback, string paramName, @@ -48,8 +47,8 @@ public void } } - [SkippableTheory] - [MemberData(nameof(GetDirectoryInfoCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetDirectoryInfoCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -66,8 +65,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetDirectoryInfoCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetDirectoryInfoCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -83,8 +82,8 @@ public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( $"\n{callback}\n has `null` parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetDirectoryInfoCallbacks), parameters: " ")] + [Theory] + [MemberData(nameof(GetDirectoryInfoCallbacks), " ")] public void Operations_WhenValueIsWhitespace_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExistsTests.cs index 9b45becd3..40b9759e2 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExistsTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class ExistsTests { - [SkippableTheory] + [Theory] [AutoData] public void Exists_ArbitraryPath_ShouldBeFalse(string path) { @@ -13,7 +13,7 @@ public void Exists_ArbitraryPath_ShouldBeFalse(string path) FileSystem.Should().NotHaveDirectory(sut.FullName); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ExistedPreviously_ShouldOnlyUpdateOnInitialization(string path) { @@ -26,7 +26,7 @@ public void Exists_ExistedPreviously_ShouldOnlyUpdateOnInitialization(string pat FileSystem.Should().NotHaveDirectory(sut.FullName); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_File_ShouldReturnFalse(string path) { @@ -36,7 +36,7 @@ public void Exists_File_ShouldReturnFalse(string path) sut.Should().NotExist(); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_NotExistedPreviously_ShouldOnlyUpdateOnInitialization(string path) { @@ -48,7 +48,7 @@ public void Exists_NotExistedPreviously_ShouldOnlyUpdateOnInitialization(string FileSystem.Should().HaveDirectory(sut.FullName); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ShouldNotChangeOnMoveTo(string path, string destination) { @@ -61,7 +61,7 @@ public void Exists_ShouldNotChangeOnMoveTo(string path, string destination) sut.Should().Exist(); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ShouldUpdateOnCreateWhenNotNetFramework(string path) { @@ -73,7 +73,7 @@ public void Exists_ShouldUpdateOnCreateWhenNotNetFramework(string path) sut.Exists.Should().Be(!Test.IsNetFramework); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ShouldUpdateOnDeleteWhenNotNetFramework(string path) { @@ -86,7 +86,7 @@ public void Exists_ShouldUpdateOnDeleteWhenNotNetFramework(string path) sut.Exists.Should().Be(Test.IsNetFramework); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ShouldUpdateOnRecursiveDeleteWhenNotNetFramework(string path) { @@ -99,7 +99,7 @@ public void Exists_ShouldUpdateOnRecursiveDeleteWhenNotNetFramework(string path) sut.Exists.Should().Be(Test.IsNetFramework); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ShouldUpdateOnRefresh(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetDirectoriesTests.cs index e939b450f..06813cac6 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetDirectoriesTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class GetDirectoriesTests { - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_SearchOptionAllDirectories_ShouldReturnAllSubdirectories( @@ -31,7 +31,7 @@ public void result.Should().Contain(d => d.Name == "xyz"); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -68,7 +68,7 @@ public void GetDirectories_SearchPattern_ShouldReturnExpectedValue( } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithEnumerationOptions_ShouldConsiderSetOptions( @@ -96,7 +96,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithNewline_ShouldThrowArgumentException( string path) @@ -113,7 +113,7 @@ public void GetDirectories_WithNewline_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithoutSearchString_ShouldReturnAllDirectSubdirectories( @@ -133,7 +133,7 @@ public void result.Should().Contain(d => d.Name == "bar"); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithSearchPattern_ShouldReturnMatchingSubdirectory( string path) @@ -149,7 +149,7 @@ public void GetDirectories_WithSearchPattern_ShouldReturnMatchingSubdirectory( result.Should().ContainSingle(d => d.Name == "foo"); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectories_WithSearchPatternInSubdirectory_ShouldReturnMatchingSubdirectory( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFileSystemInfosTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFileSystemInfosTests.cs index 6f09211a5..2df769edc 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFileSystemInfosTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFileSystemInfosTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class GetFileSystemInfosTests { - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemInfos_SearchOptionAllFiles_ShouldReturnAllFiles( @@ -36,7 +36,7 @@ public void result.Should().Contain(d => d.Name == initialized[5].Name); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -73,7 +73,7 @@ public void GetFileSystemInfos_SearchPattern_ShouldReturnExpectedValue( } } - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemInfos_ShouldMatchTypes(string path) @@ -97,7 +97,7 @@ public void } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void GetFileSystemInfos_WithEnumerationOptions_ShouldConsiderSetOptions() { @@ -125,7 +125,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void GetFileSystemInfos_WithNewline_ShouldThrowArgumentException( string path) @@ -142,7 +142,7 @@ public void GetFileSystemInfos_WithNewline_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableFact] + [Fact] public void GetFileSystemInfos_WithoutSearchString_ShouldReturnAllDirectFilesAndDirectories() { @@ -164,7 +164,7 @@ public void result.Should().Contain(d => d.Name == "bar"); } - [SkippableFact] + [Fact] public void GetFileSystemInfos_WithSearchPattern_ShouldReturnMatchingFiles() { IDirectoryInfo baseDirectory = @@ -180,7 +180,7 @@ public void GetFileSystemInfos_WithSearchPattern_ShouldReturnMatchingFiles() result.Count().Should().Be(1); } - [SkippableFact] + [Fact] public void GetFileSystemInfos_WithSearchPatternInSubdirectory_ShouldReturnMatchingFiles() { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFilesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFilesTests.cs index d7cea7846..03fb31c3a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFilesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFilesTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class GetFilesTests { - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_SearchOptionAllFiles_ShouldReturnAllFiles( @@ -34,7 +34,7 @@ public void result.Should().Contain(d => d.Name == initialized[5].Name); } - [SkippableTheory] + [Theory] #if NETFRAMEWORK [InlineAutoData(false, "")] #else @@ -72,7 +72,7 @@ public void GetFiles_SearchPattern_ShouldReturnExpectedValue( } #if FEATURE_FILESYSTEM_ENUMERATION_OPTIONS - [SkippableFact] + [Fact] public void GetFiles_WithEnumerationOptions_ShouldConsiderSetOptions() { @@ -100,7 +100,7 @@ public void } #endif - [SkippableTheory] + [Theory] [AutoData] public void GetFiles_WithNewline_ShouldThrowArgumentException( string path) @@ -117,7 +117,7 @@ public void GetFiles_WithNewline_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableFact] + [Fact] public void GetFiles_WithoutSearchString_ShouldReturnAllDirectFiles() { @@ -138,7 +138,7 @@ public void result.Should().Contain(d => d.Name == "bar"); } - [SkippableFact] + [Fact] public void GetFiles_WithSearchPattern_ShouldReturnMatchingFiles() { IDirectoryInfo baseDirectory = @@ -154,7 +154,7 @@ public void GetFiles_WithSearchPattern_ShouldReturnMatchingFiles() result.Count().Should().Be(1); } - [SkippableFact] + [Fact] public void GetFiles_WithSearchPatternInSubdirectory_ShouldReturnMatchingFiles() { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/MoveToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/MoveToTests.cs index 38b138af1..f00e480d1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/MoveToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/MoveToTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class MoveToTests { - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_ShouldMoveDirectoryWithContent(string source, string destination) { @@ -35,7 +35,7 @@ public void MoveTo_ShouldMoveDirectoryWithContent(string source, string destinat .Should().ContainSingle(); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_ShouldUpdatePropertiesOfDirectoryInfo( string source, string destination) @@ -54,7 +54,7 @@ public void MoveTo_ShouldUpdatePropertiesOfDirectoryInfo( .Should().Be(FileSystem.Path.GetFullPath(destination)); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_WithLockedFile_ShouldMoveDirectory_NotOnWindows( string source, string destination) @@ -96,7 +96,7 @@ public void MoveTo_WithLockedFile_ShouldMoveDirectory_NotOnWindows( .Should().ContainSingle(); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_WithLockedFile_ShouldThrowIOException_AndNotMoveDirectory_OnWindows( string source, string destination) @@ -147,7 +147,7 @@ public void MoveTo_WithLockedFile_ShouldThrowIOException_AndNotMoveDirectory_OnW .Should().ContainSingle(); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_WithReadOnlyFile_ShouldMoveDirectoryWithContent( string source, string destination) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs index 340a927e1..77bf7fdf6 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [InlineData("foo")] [InlineData("foo/")] public void Extension_ShouldReturnEmptyString(string path) @@ -17,7 +17,7 @@ public void Extension_ShouldReturnEmptyString(string path) result.Should().BeEmpty(); } - [SkippableTheory] + [Theory] [InlineData(@"/temp\\folder")] [InlineData("/temp/folder")] [InlineData(@"/temp/\\/folder")] @@ -30,7 +30,7 @@ public void FullName_ShouldNotNormalizePathOnLinux(string path) sut.FullName.Should().Be(path); } - [SkippableTheory] + [Theory] [InlineData("foo")] [InlineData("foo/")] public void FullName_ShouldReturnFullPath(string path) @@ -41,7 +41,7 @@ public void FullName_ShouldReturnFullPath(string path) sut.FullName.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [InlineData(@"\\unc\folder", @"\\unc\folder")] [InlineData(@"\\unc/folder\\foo", @"\\unc\folder\foo")] [InlineData(@"c:\temp\\folder", @"c:\temp\folder")] @@ -57,7 +57,7 @@ public void FullName_ShouldReturnNormalizedPath_OnWindows( sut.FullName.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [AutoData] public void FullName_ShouldTrimTrailingSpaces_OnWindows(string path) { @@ -76,7 +76,7 @@ public void FullName_ShouldTrimTrailingSpaces_OnWindows(string path) } } - [SkippableTheory] + [Theory] [AutoData] public void MissingFile_Attributes_ShouldAlwaysBeNegativeOne_AndSetterShouldThrowFileNotFoundException( @@ -92,7 +92,7 @@ public void sut.Attributes.Should().Be((FileAttributes)(-1)); } - [SkippableTheory] + [Theory] [AutoData] public void MissingFile_CreationTime_ShouldAlwaysBeNullTime_AndSetterShouldThrowCorrectException( @@ -117,7 +117,7 @@ public void sut.CreationTime.Should().Be(FileTestHelper.NullTime.ToLocalTime()); } - [SkippableTheory] + [Theory] [AutoData] public void MissingFile_CreationTimeUtc_ShouldAlwaysBeNullTime_AndSetterShouldThrowCorrectException( @@ -142,7 +142,7 @@ public void sut.CreationTimeUtc.Should().Be(FileTestHelper.NullTime.ToUniversalTime()); } - [SkippableTheory] + [Theory] [AutoData] public void MissingFile_LastAccessTime_ShouldAlwaysBeNullTime_AndSetterShouldThrowCorrectException( @@ -167,7 +167,7 @@ public void sut.LastAccessTime.Should().Be(FileTestHelper.NullTime.ToLocalTime()); } - [SkippableTheory] + [Theory] [AutoData] public void MissingFile_LastAccessTimeUtc_ShouldAlwaysBeNullTime_AndSetterShouldThrowCorrectException( @@ -192,7 +192,7 @@ public void sut.LastAccessTimeUtc.Should().Be(FileTestHelper.NullTime.ToUniversalTime()); } - [SkippableTheory] + [Theory] [AutoData] public void MissingFile_LastWriteTime_ShouldAlwaysBeNullTime_AndSetterShouldThrowCorrectException( @@ -217,7 +217,7 @@ public void sut.LastWriteTime.Should().Be(FileTestHelper.NullTime.ToLocalTime()); } - [SkippableTheory] + [Theory] [AutoData] public void MissingFile_LastWriteTimeUtc_ShouldAlwaysBeNullTime_AndSetterShouldThrowCorrectException( @@ -242,7 +242,7 @@ public void sut.LastWriteTimeUtc.Should().Be(FileTestHelper.NullTime.ToUniversalTime()); } - [SkippableTheory] + [Theory] [AutoData] public void Name_ShouldTrimTrailingSpaces_OnWindows(string path) { @@ -260,7 +260,7 @@ public void Name_ShouldTrimTrailingSpaces_OnWindows(string path) } } - [SkippableTheory] + [Theory] [AutoData] public void Parent_ArbitraryPaths_ShouldNotBeNull(string path1, string path2, @@ -276,8 +276,7 @@ public void Parent_ArbitraryPaths_ShouldNotBeNull(string path1, sut.Parent?.Parent.Should().NotExist(); } - [SkippableFact] - [AutoData] + [Fact] public void Parent_Root_ShouldBeNull() { IDirectoryInfo sut = @@ -286,7 +285,7 @@ public void Parent_Root_ShouldBeNull() sut.Parent.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineAutoData("./foo/bar", "foo")] [InlineAutoData("./foo", ".")] public void Parent_ToString_ShouldBeAbsolutePathOnNetCore( @@ -311,7 +310,7 @@ public void Parent_ToString_ShouldBeAbsolutePathOnNetCore( } } - [SkippableTheory] + [Theory] [InlineAutoData("./foo/bar", "foo")] [InlineAutoData("./foo", "bar", "bar")] public void Parent_ToString_ShouldBeDirectoryNameOnNetFramework( @@ -336,8 +335,7 @@ public void Parent_ToString_ShouldBeDirectoryNameOnNetFramework( } } - [SkippableFact] - [AutoData] + [Fact] public void Root_Name_ShouldBeCorrect() { string rootName = FileTestHelper.RootDrive(Test); @@ -348,7 +346,7 @@ public void Root_Name_ShouldBeCorrect() sut.Name.Should().Be(rootName); } - [SkippableTheory] + [Theory] [AutoData] public void Root_ShouldExist(string path) { @@ -359,7 +357,7 @@ public void Root_ShouldExist(string path) result.Root.FullName.Should().Be(expectedRoot); } - [SkippableTheory] + [Theory] [InlineData("/foo")] [InlineData("./foo")] [InlineData("foo")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/ExceptionTests.cs index c9bbb7745..d909226fd 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/ExceptionTests.cs @@ -7,9 +7,9 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfoFactory; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] + [Theory] [MemberData(nameof(GetDirectoryInfoFactoryCallbacks), - parameters: "Illegal\tCharacter?InPath")] + "Illegal\tCharacter?InPath")] public void Operations_WhenValueContainsIllegalPathCharacters_ShouldThrowArgumentException_OnNetFramework( Expression> callback, string paramName, @@ -35,8 +35,8 @@ public void } } - [SkippableTheory] - [MemberData(nameof(GetDirectoryInfoFactoryCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetDirectoryInfoFactoryCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -53,8 +53,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetDirectoryInfoFactoryCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetDirectoryInfoFactoryCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -70,8 +70,8 @@ public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( $"\n{callback}\n has `null` parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetDirectoryInfoFactoryCallbacks), parameters: " ")] + [Theory] + [MemberData(nameof(GetDirectoryInfoFactoryCallbacks), " ")] public void Operations_WhenValueIsWhitespace_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/Tests.cs index 297d0130d..5aa543687 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/Tests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfoFactory; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [InlineData("\0foo")] [InlineData("foo\0bar")] public void New_NullCharacter_ShouldThrowArgumentException(string path) @@ -25,7 +25,7 @@ public void New_NullCharacter_ShouldThrowArgumentException(string path) hResult: -2147024809); } - [SkippableTheory] + [Theory] [AutoData] public void New_ShouldCreateNewDirectoryInfoFromPath(string path) { @@ -35,7 +35,7 @@ public void New_ShouldCreateNewDirectoryInfoFromPath(string path) result.Should().NotExist(); } - [SkippableTheory] + [Theory] [AutoData] public void New_WithTrailingDirectorySeparatorChar_ShouldHavePathAsName(string path) { @@ -45,7 +45,7 @@ public void New_WithTrailingDirectorySeparatorChar_ShouldHavePathAsName(string p result.Name.Should().Be(path); } - [SkippableFact] + [Fact] public void Wrap_Null_ShouldReturnNull() { Skip.If(FileSystem is MockFileSystem mockFileSystem && @@ -56,7 +56,7 @@ public void Wrap_Null_ShouldReturnNull() result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Wrap_ShouldWrapFromDirectoryInfo(string path) { @@ -71,7 +71,7 @@ public void Wrap_ShouldWrapFromDirectoryInfo(string path) result.Exists.Should().Be(directoryInfo.Exists); } - [SkippableTheory] + [Theory] [AutoData] public void Wrap_WithSimulatedMockFileSystem_ShouldThrowNotSupportedException(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfo/Tests.cs index e2a3bbec6..6bb5788c3 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfo/Tests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DriveInfo; [FileSystemTests] public partial class Tests { - [SkippableFact] + [Fact] public void ToString_ShouldReturnDriveName() { Skip.IfNot(Test.RunsOnWindows); @@ -14,7 +14,7 @@ public void ToString_ShouldReturnDriveName() result.ToString().Should().Be("C:\\"); } - [SkippableFact] + [Fact] public void VolumeLabel_ShouldBeWritable_OnWindows() { SkipIfLongRunningTestsShouldBeSkipped(); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/ExceptionTests.cs index c8b5d7c64..816a7a18d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/ExceptionTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DriveInfoFactory; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] + [Theory] [InlineData("?invalid-drive-name")] [InlineData("invalid")] [InlineData(" ")] @@ -24,8 +24,8 @@ public void New_WhenDriveNameIsInvalid_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableTheory] - [MemberData(nameof(GetDriveInfoFactoryCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetDriveInfoFactoryCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -42,8 +42,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetDriveInfoFactoryCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetDriveInfoFactoryCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs index 8bd75e29d..7efb74c65 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DriveInfoFactory; [FileSystemTests] public partial class Tests { - [SkippableFact] + [Fact] public void GetDrives_ShouldNotBeEmpty() { IDriveInfo[] result = FileSystem.DriveInfo.GetDrives(); @@ -14,7 +14,7 @@ public void GetDrives_ShouldNotBeEmpty() result.Should().NotBeEmpty(); } - [SkippableTheory] + [Theory] [AutoData] public void MissingDrive_CreateDirectoryInfo_ShouldOnlyThrowWhenAccessingData( string path, string subPath) @@ -37,7 +37,7 @@ public void MissingDrive_CreateDirectoryInfo_ShouldOnlyThrowWhenAccessingData( hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void MissingDrive_WriteAllBytes_ShouldThrowDirectoryNotFoundException( string path, byte[] bytes) @@ -57,7 +57,7 @@ public void MissingDrive_WriteAllBytes_ShouldThrowDirectoryNotFoundException( hResult: -2147024893); } - [SkippableFact] + [Fact] public void New_DefaultDrive_ShouldBeFixed() { IDriveInfo result = @@ -73,7 +73,7 @@ public void New_DefaultDrive_ShouldBeFixed() result.VolumeLabel.Should().NotBeEmpty(); } - [SkippableTheory] + [Theory] [AutoData] public void New_InvalidDriveName_ShouldThrowArgumentException( string invalidDriveName) @@ -88,7 +88,7 @@ public void New_InvalidDriveName_ShouldThrowArgumentException( exception.Should().BeException(hResult: -2147024809); } - [SkippableTheory] + [Theory] [InlineData('A')] [InlineData('C')] [InlineData('X')] @@ -101,7 +101,7 @@ public void New_WithDriveLetter_ShouldReturnDriveInfo(char driveLetter) result.Name.Should().Be($"{driveLetter}:\\"); } - [SkippableTheory] + [Theory] [InlineAutoData('A')] [InlineAutoData('C')] [InlineAutoData('Y')] @@ -116,7 +116,7 @@ public void New_WithRootedPath_ShouldReturnDriveInfo(char driveLetter, string pa result.Name.Should().Be($"{driveLetter}:\\"); } - [SkippableFact] + [Fact] public void Wrap_Null_ShouldReturnNull() { Skip.If(FileSystem is MockFileSystem mockFileSystem && @@ -127,7 +127,7 @@ public void Wrap_Null_ShouldReturnNull() result.Should().BeNull(); } - [SkippableFact] + [Fact] public void Wrap_ShouldReturnDriveInfoWithSameName() { Skip.If(FileSystem is MockFileSystem mockFileSystem && @@ -140,7 +140,7 @@ public void Wrap_ShouldReturnDriveInfoWithSameName() result.Name.Should().Be(driveInfo.Name); } - [SkippableFact] + [Fact] public void Wrap_WithSimulatedMockFileSystem_ShouldThrowNotSupportedException() { Skip.IfNot(FileSystem is MockFileSystem mockFileSystem && diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs index 88a8f60b8..1e9767a40 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs @@ -13,7 +13,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class AppendAllLinesAsyncTests { - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllLinesAsync_Cancelled_ShouldThrowTaskCanceledException( string path, List contents) @@ -27,7 +27,7 @@ public async Task AppendAllLinesAsync_Cancelled_ShouldThrowTaskCanceledException exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllLinesAsync_Cancelled_WithEncoding_ShouldThrowTaskCanceledException( @@ -43,7 +43,7 @@ public async Task exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllLinesAsync_ExistingFile_ShouldAppendLinesToFile( string path, List previousContents, List contents) @@ -58,21 +58,24 @@ public async Task AppendAllLinesAsync_ExistingFile_ShouldAppendLinesToFile( .Which.HasContent(expectedContent); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllLinesAsync_MissingDirectory_ShouldThrowDirectoryNotFoundException( string missingPath, string fileName, List contents) { string filePath = FileSystem.Path.Combine(missingPath, fileName); - Exception? exception = await Record.ExceptionAsync(async () => + + async Task Act() { await FileSystem.File.AppendAllLinesAsync(filePath, contents); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllLinesAsync_MissingFile_ShouldCreateFile( string path, List contents) @@ -86,37 +89,41 @@ public async Task AppendAllLinesAsync_MissingFile_ShouldCreateFile( .Which.HasContent(expectedContent); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllLinesAsync_NullContent_ShouldThrowArgumentNullException( string path) { - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.AppendAllLinesAsync(path, null!); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException( hResult: -2147467261, paramName: "contents"); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllLinesAsync_NullEncoding_ShouldThrowArgumentNullException( string path) { - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.AppendAllLinesAsync(path, new List(), null!); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException( hResult: -2147467261, paramName: "encoding"); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllLinesAsync_ShouldEndWithNewline(string path) { @@ -129,7 +136,7 @@ public async Task AppendAllLinesAsync_ShouldEndWithNewline(string path) .Which.HasContent(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllLinesAsync_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( @@ -137,10 +144,12 @@ public async Task { FileSystem.Directory.CreateDirectory(path); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.AppendAllLinesAsync(path, contents); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException( hResult: -2147024891); @@ -148,7 +157,7 @@ public async Task FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public async Task AppendAllLinesAsync_WithDifferentEncoding_ShouldNotReturnWrittenText( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesTests.cs index 6f4667072..87b9d73aa 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class AppendAllLinesTests { - [SkippableTheory] + [Theory] [AutoData] public void AppendAllLines_ExistingFile_ShouldAppendLinesToFile( string path, List previousContents, List contents) @@ -23,7 +23,7 @@ public void AppendAllLines_ExistingFile_ShouldAppendLinesToFile( .Which.HasContent(expectedContent); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllLines_MissingFile_ShouldCreateFile( string path, List contents) @@ -36,7 +36,7 @@ public void AppendAllLines_MissingFile_ShouldCreateFile( .Which.HasContent(expectedContent); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllLines_NullContent_ShouldThrowArgumentNullException( string path) @@ -51,7 +51,7 @@ public void AppendAllLines_NullContent_ShouldThrowArgumentNullException( paramName: "contents"); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllLines_NullEncoding_ShouldThrowArgumentNullException( string path) @@ -66,7 +66,7 @@ public void AppendAllLines_NullEncoding_ShouldThrowArgumentNullException( paramName: "encoding"); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllLines_ShouldEndWithNewline(string path) { @@ -79,7 +79,7 @@ public void AppendAllLines_ShouldEndWithNewline(string path) .Which.HasContent(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllLines_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( @@ -98,7 +98,7 @@ public void FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public void AppendAllLines_WithDifferentEncoding_ShouldNotReturnWrittenText( string specialLine, Encoding writeEncoding, Encoding readEncoding) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs index 4c7d9437a..41db3b1a4 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs @@ -11,7 +11,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class AppendAllTextAsyncTests { - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllTextAsync_Cancelled_ShouldThrowTaskCanceledException( string path, string contents) @@ -25,7 +25,7 @@ public async Task AppendAllTextAsync_Cancelled_ShouldThrowTaskCanceledException( exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllTextAsync_Cancelled_WithEncoding_ShouldThrowTaskCanceledException( @@ -40,7 +40,7 @@ public async Task exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllTextAsync_ExistingFile_ShouldAppendLinesToFile( string path, string previousContents, string contents) @@ -53,21 +53,24 @@ public async Task AppendAllTextAsync_ExistingFile_ShouldAppendLinesToFile( .Which.HasContent(previousContents + contents); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllTextAsync_MissingDirectory_ShouldThrowDirectoryNotFoundException( string missingPath, string fileName, string contents) { string filePath = FileSystem.Path.Combine(missingPath, fileName); - Exception? exception = await Record.ExceptionAsync(async () => + + async Task Act() { await FileSystem.File.AppendAllTextAsync(filePath, contents); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllTextAsync_MissingFile_ShouldCreateFile( string path, string contents) @@ -78,7 +81,7 @@ public async Task AppendAllTextAsync_MissingFile_ShouldCreateFile( .Which.HasContent(contents); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllTextAsync_ShouldNotEndWithNewline(string path) { @@ -90,7 +93,7 @@ public async Task AppendAllTextAsync_ShouldNotEndWithNewline(string path) .Which.HasContent(contents); } - [SkippableTheory] + [Theory] [AutoData] public async Task AppendAllTextAsync_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( @@ -98,10 +101,12 @@ public async Task { FileSystem.Directory.CreateDirectory(path); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.AppendAllTextAsync(path, contents); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException( hResult: -2147024891); @@ -109,7 +114,7 @@ public async Task FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public async Task AppendAllTextAsync_WithDifferentEncoding_ShouldNotReturnWrittenText( string contents, Encoding writeEncoding, Encoding readEncoding) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextTests.cs index 90b65351e..9ceb472c6 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class AppendAllTextTests { - [SkippableTheory] + [Theory] [AutoData] public void AppendAllText_ExistingFile_ShouldAppendLinesToFile( string path, string previousContents, string contents) @@ -20,7 +20,7 @@ public void AppendAllText_ExistingFile_ShouldAppendLinesToFile( .Which.HasContent(previousContents + contents); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllText_MissingDirectory_ShouldThrowDirectoryNotFoundException( string missingPath, string fileName, string contents) @@ -34,7 +34,7 @@ public void AppendAllText_MissingDirectory_ShouldThrowDirectoryNotFoundException exception.Should().BeException(hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllText_MissingFile_ShouldCreateFile( string path, string contents) @@ -45,7 +45,7 @@ public void AppendAllText_MissingFile_ShouldCreateFile( .Which.HasContent(contents); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllText_MissingFile_ShouldCreateFileWithByteOrderMark( string path) @@ -58,7 +58,7 @@ public void AppendAllText_MissingFile_ShouldCreateFileWithByteOrderMark( .Which.HasContent(expectedBytes); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllText_ShouldAdjustTimes(string path, string contents) { @@ -93,7 +93,7 @@ public void AppendAllText_ShouldAdjustTimes(string path, string contents) .BeOnOrAfter(updateTime.ApplySystemClockTolerance()); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllText_ShouldNotEndWithNewline(string path) { @@ -105,7 +105,7 @@ public void AppendAllText_ShouldNotEndWithNewline(string path) .Which.HasContent(contents); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllText_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( @@ -124,7 +124,7 @@ public void FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void AppendAllText_WhenFileIsHidden_ShouldNotThrowException( string path, string contents) @@ -140,7 +140,7 @@ public void AppendAllText_WhenFileIsHidden_ShouldNotThrowException( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public void AppendAllText_WithDifferentEncoding_ShouldNotReturnWrittenText( string contents, Encoding writeEncoding, Encoding readEncoding) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendTextTests.cs index 66138d948..99708ff9c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendTextTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class AppendTextTests { - [SkippableTheory] + [Theory] [AutoData] public void AppendText_MissingFile_ShouldCreateFile( string path, string appendText) @@ -19,7 +19,7 @@ public void AppendText_MissingFile_ShouldCreateFile( .Which.HasContent(appendText); } - [SkippableTheory] + [Theory] [AutoData] public void AppendText_ShouldAddTextToExistingFile( string path, string contents, string appendText) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/CopyTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/CopyTests.cs index 68d8d9d93..9dd828a2a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/CopyTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/CopyTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class CopyTests { - [SkippableTheory] + [Theory] [AutoData] public void Copy_CaseOnlyChange_ShouldThrowIOException_ExceptOnLinux( string name, string contents) @@ -32,7 +32,7 @@ public void Copy_CaseOnlyChange_ShouldThrowIOException_ExceptOnLinux( } } - [SkippableTheory] + [Theory] [AutoData] public void Copy_DestinationDirectoryDoesNotExist_ShouldThrowDirectoryNotFoundException( @@ -50,7 +50,7 @@ public void exception.Should().BeException(hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void Copy_DestinationExists_ShouldThrowIOException_AndNotCopyFile( string sourceName, @@ -75,7 +75,7 @@ public void Copy_DestinationExists_ShouldThrowIOException_AndNotCopyFile( } #if FEATURE_FILE_MOVETO_OVERWRITE - [SkippableTheory] + [Theory] [AutoData] public void Copy_DestinationExists_WithOverwrite_ShouldOverwriteDestination( string sourceName, @@ -95,7 +95,7 @@ public void Copy_DestinationExists_WithOverwrite_ShouldOverwriteDestination( } #endif - [SkippableTheory] + [Theory] [InlineData(@"0:\something\demo.txt", @"C:\elsewhere\demo.txt")] [InlineData(@"C:\something\demo.txt", @"^:\elsewhere\demo.txt")] [InlineData(@"C:\something\demo.txt", @"C:\elsewhere:\demo.txt")] @@ -113,7 +113,7 @@ public void exception.Should().BeException(hResult: -2146233067); } - [SkippableTheory] + [Theory] [InlineData(@"C::\something\demo.txt", @"C:\elsewhere\demo.txt")] public void Copy_InvalidPath_ShouldThrowCorrectException( @@ -139,7 +139,7 @@ public void } } - [SkippableTheory] + [Theory] [AutoData] public void Copy_ReadOnly_ShouldCopyFile( string sourceName, string destinationName, string contents) @@ -156,7 +156,7 @@ public void Copy_ReadOnly_ShouldCopyFile( .And.HasAttribute(FileAttributes.ReadOnly); } - [SkippableTheory] + [Theory] [AutoData] public void Copy_ShouldAdjustTimes( string source, string destination) @@ -227,7 +227,7 @@ public void Copy_ShouldAdjustTimes( .BeBetween(creationTimeStart, creationTimeEnd); } - [SkippableTheory] + [Theory] [AutoData] public void Copy_ShouldCloneBinaryContent( string source, string destination, byte[] original) @@ -251,7 +251,7 @@ public void Copy_ShouldCloneBinaryContent( .NotBeEquivalentTo(FileSystem.File.ReadAllBytes(source)); } - [SkippableTheory] + [Theory] [AutoData] public void Copy_ShouldCloneTextContent( string source, string destination, string contents) @@ -273,7 +273,7 @@ public void Copy_ShouldCloneTextContent( .NotBe(FileSystem.File.ReadAllText(destination)); } - [SkippableTheory] + [Theory] [AutoData] public void Copy_ShouldCopyFileWithContent( string sourceName, string destinationName, string contents) @@ -291,7 +291,7 @@ public void Copy_ShouldCopyFileWithContent( .Which.HasContent(contents); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.Read)] [InlineAutoData(FileAccess.Read, FileShare.ReadWrite)] [InlineAutoData(FileAccess.ReadWrite, FileShare.Read)] @@ -317,7 +317,7 @@ public void Copy_SourceAccessedWithReadShare_ShouldNotThrow( FileSystem.File.ReadAllText(destinationPath).Should().Be(sourceContents); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read)] [InlineAutoData(FileAccess.ReadWrite)] [InlineAutoData(FileAccess.Write)] @@ -341,7 +341,7 @@ public void Copy_SourceAccessedWithWriteShare_ShouldNotThrowOnLinuxOrMac( FileSystem.File.ReadAllText(destinationPath).Should().Be(sourceContents); } - [SkippableTheory] + [Theory] [AutoData] public void Copy_SourceDirectoryMissing_ShouldThrowDirectoryNotFoundException( string missingDirectory, @@ -362,7 +362,7 @@ public void Copy_SourceDirectoryMissing_ShouldThrowDirectoryNotFoundException( FileSystem.Should().NotHaveFile(destinationName); } - [SkippableTheory] + [Theory] [AutoData] public void Copy_SourceIsDirectory_ShouldThrowUnauthorizedAccessException_AndNotCopyFile( string sourceName, @@ -384,7 +384,7 @@ public void Copy_SourceIsDirectory_ShouldThrowUnauthorizedAccessException_AndNot FileSystem.Should().NotHaveFile(destinationName); } - [SkippableTheory] + [Theory] [InlineAutoData(FileShare.None)] [InlineAutoData(FileShare.Write)] public void Copy_SourceLocked_ShouldThrowIOException( @@ -416,7 +416,7 @@ public void Copy_SourceLocked_ShouldThrowIOException( } } - [SkippableTheory] + [Theory] [AutoData] public void Copy_SourceMissing_ShouldThrowFileNotFoundException( string sourceName, diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateSymbolicLinkTests.cs index cacca201f..1621cfa77 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateSymbolicLinkTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class CreateSymbolicLinkTests { - [SkippableTheory] + [Theory] [AutoData] public void CreateSymbolicLink_ShouldCreateSymbolicLink( string path, string pathToTarget) @@ -20,7 +20,7 @@ public void CreateSymbolicLink_ShouldCreateSymbolicLink( .Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateSymbolicLink_SourceFileAlreadyExists_ShouldThrowIOException( string path, string pathToTarget) @@ -37,7 +37,7 @@ public void CreateSymbolicLink_SourceFileAlreadyExists_ShouldThrowIOException( hResult: Test.RunsOnWindows ? -2147024713 : 17); } - [SkippableTheory] + [Theory] [AutoData] public void CreateSymbolicLink_TargetFileMissing_ShouldNotThrowException( string path, string pathToTarget) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTests.cs index 6f5b1ab8b..1a67ce04e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class CreateTests { - [SkippableTheory] + [Theory] [AutoData] public void Create_ExistingFile_ShouldBeOverwritten( string path, string originalContent, string newContent) @@ -22,7 +22,7 @@ public void Create_ExistingFile_ShouldBeOverwritten( .Which.HasContent(newContent); } - [SkippableTheory] + [Theory] [AutoData] public void Create_MissingDirectory_ShouldThrowDirectoryNotFoundException( string missingDirectory, string fileName) @@ -37,7 +37,7 @@ public void Create_MissingDirectory_ShouldThrowDirectoryNotFoundException( exception.Should().BeException(hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void Create_MissingFile_ShouldCreateFile(string path) { @@ -46,7 +46,7 @@ public void Create_MissingFile_ShouldCreateFile(string path) FileSystem.Should().HaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void Create_ReadOnlyFile_ShouldThrowUnauthorizedAccessException( string path, string content) @@ -62,7 +62,7 @@ public void Create_ReadOnlyFile_ShouldThrowUnauthorizedAccessException( exception.Should().BeException(hResult: -2147024891); } - [SkippableTheory] + [Theory] [AutoData] public void Create_ShouldUseReadWriteAccessAndNoneShare(string path) { @@ -76,7 +76,7 @@ public void Create_ShouldUseReadWriteAccessAndNoneShare(string path) stream.CanTimeout.Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void Create_WithBufferSize_ShouldUseReadWriteAccessAndNoneShare( string path, int bufferSize) @@ -90,7 +90,7 @@ public void Create_WithBufferSize_ShouldUseReadWriteAccessAndNoneShare( FileTestHelper.CheckFileShare(FileSystem, path).Should().Be(FileShare.None); } - [SkippableTheory] + [Theory] [AutoData] public void Create_WithBufferSizeAndFileOptions_ShouldUseReadWriteAccessAndNoneShare( string path, int bufferSize) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTextTests.cs index 622fc8c37..416576b2b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTextTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class CreateTextTests { - [SkippableTheory] + [Theory] [AutoData] public void CreateText_MissingFile_ShouldCreateFile( string path, string appendText) @@ -19,7 +19,7 @@ public void CreateText_MissingFile_ShouldCreateFile( .Which.HasContent(appendText); } - [SkippableTheory] + [Theory] [AutoData] public void CreateText_ShouldReplaceTextInExistingFile( string path, string contents, string appendText) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/DeleteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/DeleteTests.cs index 2c1b2a933..4154c717d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/DeleteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/DeleteTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class DeleteTests { - [SkippableTheory] + [Theory] [AutoData] public void Delete_MissingDirectory_ShouldThrowDirectoryNotFoundException( string missingDirectory, string fileName) @@ -20,7 +20,7 @@ public void Delete_MissingDirectory_ShouldThrowDirectoryNotFoundException( exception.Should().BeException(hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_MissingFile_ShouldDoNothing( string fileName) @@ -33,7 +33,7 @@ public void Delete_MissingFile_ShouldDoNothing( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_WithOpenFile_ShouldThrowIOException_OnWindows(string filename) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/EncryptDecryptTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/EncryptDecryptTests.cs index 0baf5189f..58436bd0c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/EncryptDecryptTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/EncryptDecryptTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class EncryptDecryptTests { - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Decrypt_EncryptedData_ShouldReturnOriginalText( @@ -23,7 +23,7 @@ public void Decrypt_EncryptedData_ShouldReturnOriginalText( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Decrypt_UnencryptedData_ShouldReturnOriginalText( @@ -39,7 +39,7 @@ public void Decrypt_UnencryptedData_ShouldReturnOriginalText( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Encrypt_Decrypt_ShouldChangeEncryptedFileAttribute( @@ -58,7 +58,7 @@ public void Encrypt_Decrypt_ShouldChangeEncryptedFileAttribute( .Which.DoesNotHaveAttribute(FileAttributes.Encrypted); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Encrypt_ShouldChangeData( @@ -75,7 +75,7 @@ public void Encrypt_ShouldChangeData( result.Should().NotBeEquivalentTo(bytes); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Encrypt_Twice_ShouldIgnoreTheSecondTime( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionMissingFileTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionMissingFileTests.cs index d97a3ad92..35e17e547 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionMissingFileTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionMissingFileTests.cs @@ -12,8 +12,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ExceptionMissingFileTests { - [SkippableTheory] - [MemberData(nameof(GetFileCallbacks), parameters: (int)MissingFileTestCases.DirectoryMissing)] + [Theory] + [MemberData(nameof(GetFileCallbacks), (int)MissingFileTestCases.DirectoryMissing)] public void Operations_WhenDirectoryIsMissing_ShouldThrowDirectoryNotFoundException( Expression> callback, Func skipTest) { @@ -40,8 +40,8 @@ public void Operations_WhenDirectoryIsMissing_ShouldThrowDirectoryNotFoundExcept } } - [SkippableTheory] - [MemberData(nameof(GetFileCallbacks), parameters: (int)MissingFileTestCases.FileMissing)] + [Theory] + [MemberData(nameof(GetFileCallbacks), (int)MissingFileTestCases.FileMissing)] public void Operations_WhenFileIsMissing_ShouldThrowFileNotFoundException( Expression> callback, Func skipTest) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionTests.cs index ab2298489..ae0c9fae7 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionTests.cs @@ -12,8 +12,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] - [MemberData(nameof(GetFileCallbacks), parameters: "Illegal\tCharacter?InPath")] + [Theory] + [MemberData(nameof(GetFileCallbacks), "Illegal\tCharacter?InPath")] public void Operations_WhenValueContainsIllegalPathCharacters_ShouldThrowCorrectException_OnWindows( Expression> callback, string paramName, bool ignoreParamCheck, @@ -53,8 +53,8 @@ public void } } - [SkippableTheory] - [MemberData(nameof(GetFileCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetFileCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck, Func skipTest) @@ -73,8 +73,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetFileCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck, Func skipTest) @@ -92,8 +92,8 @@ public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( $"\n{callback}\n has `null` parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileCallbacks), parameters: " ")] + [Theory] + [MemberData(nameof(GetFileCallbacks), " ")] public void Operations_WhenValueIsWhitespace_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck, Func skipTest) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExistsTests.cs index 6ceaaf530..bd417511f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExistsTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ExistsTests { - [SkippableTheory] + [Theory] [AutoData] public void Exists_Directory_ShouldReturnFalse(string path) { @@ -14,7 +14,7 @@ public void Exists_Directory_ShouldReturnFalse(string path) result.Should().BeFalse(); } - [SkippableFact] + [Fact] public void Exists_Empty_ShouldReturnFalse() { bool result = FileSystem.File.Exists(string.Empty); @@ -22,7 +22,7 @@ public void Exists_Empty_ShouldReturnFalse() result.Should().BeFalse(); } - [SkippableFact] + [Fact] public void Exists_Null_ShouldReturnFalse() { bool result = FileSystem.File.Exists(null); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/GetAttributesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/GetAttributesTests.cs index a1ab630eb..81a94e78c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/GetAttributesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/GetAttributesTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class GetAttributesTests { - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.ReadOnly)] [InlineAutoData(FileAttributes.Normal)] public void GetAttributes_ShouldReturnAttributes( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/MoveTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/MoveTests.cs index 7ccacdbda..bd5886f85 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/MoveTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/MoveTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class MoveTests { - [SkippableTheory] + [Theory] [AutoData] public void Move_CaseOnlyChange_ShouldMoveFileWithContent( string name, string contents) @@ -28,7 +28,7 @@ public void Move_CaseOnlyChange_ShouldMoveFileWithContent( .ContainSingle(d => d.Contains(destinationName, StringComparison.Ordinal)); } - [SkippableTheory] + [Theory] [AutoData] public void Move_DestinationDirectoryDoesNotExist_ShouldThrowDirectoryNotFoundException( @@ -46,7 +46,7 @@ public void exception.Should().BeException(hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void Move_DestinationExists_ShouldThrowIOException_AndNotMoveFile( string sourceName, @@ -72,7 +72,7 @@ public void Move_DestinationExists_ShouldThrowIOException_AndNotMoveFile( } #if FEATURE_FILE_MOVETO_OVERWRITE - [SkippableTheory] + [Theory] [AutoData] public void Move_DestinationExists_WithOverwrite_ShouldOverwriteDestination( string sourceName, @@ -91,7 +91,7 @@ public void Move_DestinationExists_WithOverwrite_ShouldOverwriteDestination( } #endif - [SkippableTheory] + [Theory] [AutoData] public void Move_ReadOnly_ShouldMoveFile( string sourceName, string destinationName, string contents) @@ -107,7 +107,7 @@ public void Move_ReadOnly_ShouldMoveFile( .And.HasAttribute(FileAttributes.ReadOnly); } - [SkippableTheory] + [Theory] [AutoData] public void Move_ShouldMoveFileWithContent( string sourceName, string destinationName, string contents) @@ -121,7 +121,7 @@ public void Move_ShouldMoveFileWithContent( .Which.HasContent(contents); } - [SkippableTheory] + [Theory] [AutoData] public void Move_ShouldNotAdjustTimes(string source, string destination) { @@ -146,7 +146,7 @@ public void Move_ShouldNotAdjustTimes(string source, string destination) .BeBetween(creationTimeStart, creationTimeEnd); } - [SkippableTheory] + [Theory] [AutoData] public void Move_SourceAndDestinationIdentical_ShouldNotThrowException(string path) { @@ -161,7 +161,7 @@ public void Move_SourceAndDestinationIdentical_ShouldNotThrowException(string pa exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Move_SourceDirectoryMissing_ShouldThrowFileNotFoundException( string missingDirectory, @@ -180,7 +180,7 @@ public void Move_SourceDirectoryMissing_ShouldThrowFileNotFoundException( FileSystem.Should().NotHaveFile(destinationName); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.None)] [InlineAutoData(FileAccess.Read, FileShare.Read)] [InlineAutoData(FileAccess.Read, FileShare.ReadWrite)] @@ -222,7 +222,7 @@ public void Move_SourceLocked_ShouldThrowIOException_OnWindows( } } - [SkippableTheory] + [Theory] [AutoData] public void Move_SourceMissing_CopyToItself_ShouldThrowFileNotFoundException( string sourceName) @@ -237,7 +237,7 @@ public void Move_SourceMissing_CopyToItself_ShouldThrowFileNotFoundException( hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void Move_SourceMissing_ShouldThrowFileNotFoundException( string sourceName, diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs index 4ccd0f93d..e6538ce8a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class OpenReadTests { - [SkippableTheory] + [Theory] [AutoData] public void OpenRead_MissingFile_ShouldThrowFileNotFoundException(string path) { @@ -20,7 +20,7 @@ public void OpenRead_MissingFile_ShouldThrowFileNotFoundException(string path) hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void OpenRead_SetLength_ShouldThrowNotSupportedException(string path) { @@ -35,7 +35,7 @@ public void OpenRead_SetLength_ShouldThrowNotSupportedException(string path) exception.Should().BeException(hResult: -2146233067); } - [SkippableTheory] + [Theory] [AutoData] public void OpenRead_ShouldUseReadAccessAndReadShare(string path) { @@ -52,7 +52,7 @@ public void OpenRead_ShouldUseReadAccessAndReadShare(string path) stream.CanTimeout.Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void OpenRead_Write_ShouldThrowNotSupportedException(string path, byte[] bytes) { @@ -67,7 +67,7 @@ public void OpenRead_Write_ShouldThrowNotSupportedException(string path, byte[] exception.Should().BeException(hResult: -2146233067); } - [SkippableTheory] + [Theory] [AutoData] public async Task OpenRead_WriteAsync_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -75,37 +75,40 @@ public async Task OpenRead_WriteAsync_ShouldThrowNotSupportedException( // ReSharper disable once MethodHasAsyncOverload FileSystem.File.WriteAllText(path, null); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { // ReSharper disable once UseAwaitUsing using FileSystemStream stream = FileSystem.File.OpenRead(path); #pragma warning disable CA1835 await stream.WriteAsync(bytes, 0, bytes.Length); #pragma warning restore CA1835 - }); - + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2146233067); } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public async Task OpenRead_WriteAsyncWithMemory_ShouldThrowNotSupportedException( string path, byte[] bytes) { await FileSystem.File.WriteAllTextAsync(path, null); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { using FileSystemStream stream = FileSystem.File.OpenRead(path); await stream.WriteAsync(bytes.AsMemory()); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2146233067); } #endif - [SkippableTheory] + [Theory] [AutoData] public void OpenRead_WriteByte_ShouldThrowNotSupportedException(string path) { @@ -121,7 +124,7 @@ public void OpenRead_WriteByte_ShouldThrowNotSupportedException(string path) } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void OpenRead_WriteWithSpan_ShouldThrowNotSupportedException(string path, byte[] bytes) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTests.cs index 2b31e0269..86f366cc0 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class OpenTests { - [SkippableTheory] + [Theory] [AutoData] public void Open_ExistingFileWithCreateNewMode_ShouldThrowIOException( string path) @@ -22,7 +22,7 @@ public void Open_ExistingFileWithCreateNewMode_ShouldThrowIOException( hResult: Test.RunsOnWindows ? -2147024816 : 17); } - [SkippableTheory] + [Theory] [AutoData] public void Open_MissingFileAndIncorrectMode_ShouldThrowFileNotFoundException( string path) @@ -37,7 +37,7 @@ public void Open_MissingFileAndIncorrectMode_ShouldThrowFileNotFoundException( hResult: -2147024894); } - [SkippableTheory] + [Theory] [InlineAutoData(FileMode.Open, FileAccess.Read)] [InlineAutoData(FileMode.OpenOrCreate, FileAccess.ReadWrite)] public void Open_ShouldNotAdjustTimes(FileMode mode, FileAccess access, string path) @@ -64,7 +64,7 @@ public void Open_ShouldNotAdjustTimes(FileMode mode, FileAccess access, string p .BeBetween(creationTimeStart, creationTimeEnd); } - [SkippableTheory] + [Theory] [InlineAutoData(FileMode.Append, FileAccess.Write)] [InlineAutoData(FileMode.Open, FileAccess.ReadWrite)] [InlineAutoData(FileMode.Create, FileAccess.ReadWrite)] @@ -81,7 +81,7 @@ public void Open_ShouldUseExpectedAccessDependingOnMode( FileTestHelper.CheckFileShare(FileSystem, path).Should().Be(FileShare.None); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.Write)] [InlineAutoData(FileAccess.Write, FileShare.Read)] public void Open_ShouldUseGivenAccessAndShare(string path, @@ -97,7 +97,7 @@ public void Open_ShouldUseGivenAccessAndShare(string path, FileTestHelper.CheckFileShare(FileSystem, path).Should().Be(share); } - [SkippableTheory] + [Theory] [AutoData] public void Open_ShouldUseNoneShareAsDefault(string path, FileAccess access) @@ -111,7 +111,7 @@ public void Open_ShouldUseNoneShareAsDefault(string path, } #if FEATURE_FILESYSTEM_STREAM_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.Write)] [InlineAutoData(FileAccess.Write, FileShare.Read)] public void Open_WithFileStreamOptions_ShouldUseGivenAccessAndShare( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTextTests.cs index 53452ab83..8af2b13d5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTextTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class OpenTextTests { - [SkippableTheory] + [Theory] [AutoData] public void OpenText_MissingFile_ShouldThrowFileNotFoundException( string path) @@ -20,7 +20,7 @@ public void OpenText_MissingFile_ShouldThrowFileNotFoundException( hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void OpenText_ShouldReturnFileContent( string path, string contents) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenWriteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenWriteTests.cs index 42150914c..49b956b56 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenWriteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenWriteTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class OpenWriteTests { - [SkippableTheory] + [Theory] [AutoData] public void OpenWrite_MissingFile_ShouldCreateFile(string path) { @@ -14,7 +14,7 @@ public void OpenWrite_MissingFile_ShouldCreateFile(string path) FileSystem.Should().HaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void OpenWrite_ShouldOverwriteExistingFile(string path, string previousContent) { @@ -32,7 +32,7 @@ public void OpenWrite_ShouldOverwriteExistingFile(string path, string previousCo result.Length.Should().Be(previousContent.Length); } - [SkippableTheory] + [Theory] [AutoData] public void OpenWrite_ShouldUseWriteAccessAndNoneShare(string path) { @@ -48,7 +48,7 @@ public void OpenWrite_ShouldUseWriteAccessAndNoneShare(string path) stream.CanTimeout.Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void OpenWrite_StreamShouldNotThrowExceptionWhenReading(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs index 6a1767c5c..991a1fcc3 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ReadAllBytesAsyncTests { - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllBytesAsync_Cancelled_ShouldThrowTaskCanceledException( string path) @@ -22,7 +22,7 @@ public async Task ReadAllBytesAsync_Cancelled_ShouldThrowTaskCanceledException( exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllBytesAsync_MissingFile_ShouldThrowFileNotFoundException( string path) @@ -35,7 +35,7 @@ public async Task ReadAllBytesAsync_MissingFile_ShouldThrowFileNotFoundException hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllBytesAsync_ShouldReturnWrittenBytes( byte[] bytes, string path) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesTests.cs index 6eb4ca1ce..3cf09b5a8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ReadAllBytesTests { - [SkippableTheory] + [Theory] [AutoData] public void ReadAllBytes_MissingFile_ShouldThrowFileNotFoundException(string path) { @@ -25,7 +25,7 @@ public void ReadAllBytes_MissingFile_ShouldThrowFileNotFoundException(string pat .Contain($"'{FileSystem.Path.GetFullPath(path)}'"); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllBytes_ShouldAdjustTimes(string path, byte[] bytes) { @@ -62,7 +62,7 @@ public void ReadAllBytes_ShouldAdjustTimes(string path, byte[] bytes) .BeBetween(creationTimeStart, creationTimeEnd); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllBytes_ShouldNotGetAReferenceToFileContent( string path, byte[] bytes) @@ -77,7 +77,7 @@ public void ReadAllBytes_ShouldNotGetAReferenceToFileContent( result.Should().BeEquivalentTo(bytes); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllBytes_ShouldReturnWrittenBytes( byte[] bytes, string path) @@ -89,7 +89,7 @@ public void ReadAllBytes_ShouldReturnWrittenBytes( result.Should().BeEquivalentTo(bytes); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllBytes_ShouldTolerateAltDirectorySeparatorChar( byte[] bytes, string directory, string fileName) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs index 3697679aa..49d34878a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs @@ -10,7 +10,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ReadAllLinesAsyncTests { - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllLinesAsync_Cancelled_ShouldThrowTaskCanceledException( string path) @@ -24,7 +24,7 @@ public async Task ReadAllLinesAsync_Cancelled_ShouldThrowTaskCanceledException( exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllLinesAsync_Cancelled_WithEncoding_ShouldThrowTaskCanceledException( @@ -39,7 +39,7 @@ public async Task exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllLinesAsync_MissingFile_ShouldThrowFileNotFoundException( string path) @@ -52,7 +52,7 @@ public async Task ReadAllLinesAsync_MissingFile_ShouldThrowFileNotFoundException hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllLinesAsync_ShouldEnumerateLines(string path, string[] lines) { @@ -64,7 +64,7 @@ public async Task ReadAllLinesAsync_ShouldEnumerateLines(string path, string[] l results.Should().BeEquivalentTo(lines, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public async Task ReadAllLinesAsync_WithDifferentEncoding_ShouldNotReturnWrittenText( string specialLine, Encoding writeEncoding, Encoding readEncoding) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesTests.cs index c1eea8d87..d702c2abc 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ReadAllLinesTests { - [SkippableTheory] + [Theory] [AutoData] public void ReadAllLines_Empty_ShouldReturnEmptyArray(string path) { @@ -18,7 +18,7 @@ public void ReadAllLines_Empty_ShouldReturnEmptyArray(string path) results.Should().BeEmpty(); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllLines_MissingFile_ShouldThrowFileNotFoundException(string path) { @@ -32,7 +32,7 @@ public void ReadAllLines_MissingFile_ShouldThrowFileNotFoundException(string pat hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllLines_ShouldEnumerateLines(string path, string[] lines) { @@ -44,7 +44,7 @@ public void ReadAllLines_ShouldEnumerateLines(string path, string[] lines) results.Should().BeEquivalentTo(lines, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllLines_ShouldNotReturnByteOrderMark(string path, string content) { @@ -59,7 +59,7 @@ public void ReadAllLines_ShouldNotReturnByteOrderMark(string path, string conten result[0].Should().Be(content); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public void ReadAllLines_WithDifferentEncoding_ShouldNotReturnWrittenText( string specialLine, Encoding writeEncoding, Encoding readEncoding) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs index 9a7d7deb6..a29cdc094 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs @@ -10,7 +10,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ReadAllTextAsyncTests { - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllTextAsync_Cancelled_ShouldThrowTaskCanceledException( string path) @@ -24,7 +24,7 @@ public async Task ReadAllTextAsync_Cancelled_ShouldThrowTaskCanceledException( exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllTextAsync_Cancelled_WithEncoding_ShouldThrowTaskCanceledException( @@ -39,7 +39,7 @@ public async Task exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAllTextAsync_MissingFile_ShouldThrowFileNotFoundException( string path) @@ -52,7 +52,7 @@ public async Task ReadAllTextAsync_MissingFile_ShouldThrowFileNotFoundException( hResult: -2147024894); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public async Task ReadAllTextAsync_WithDifferentEncoding_ShouldNotReturnWrittenText( string contents, Encoding writeEncoding, Encoding readEncoding) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextTests.cs index 51237f2be..14f9e7940 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ReadAllTextTests { - [SkippableTheory] + [Theory] [AutoData] public void ReadAllText_FilenameNotOnWindows_ShouldBeCaseSensitive( string path, string contents1, string contents2) @@ -23,7 +23,7 @@ public void ReadAllText_FilenameNotOnWindows_ShouldBeCaseSensitive( result.Should().Be(contents2); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllText_FilenameOnWindows_ShouldBeCaseInsensitive( string path, string contents) @@ -38,7 +38,7 @@ public void ReadAllText_FilenameOnWindows_ShouldBeCaseInsensitive( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllText_MissingFile_ShouldThrowFileNotFoundException(string path) { @@ -57,7 +57,7 @@ public void ReadAllText_MissingFile_ShouldThrowFileNotFoundException(string path .Contain($"'{FileSystem.Path.GetFullPath(path)}'"); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllText_ShouldAdjustTimes(string path, string contents) { @@ -94,7 +94,7 @@ public void ReadAllText_ShouldAdjustTimes(string path, string contents) .BeBetween(creationTimeStart, creationTimeEnd); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllText_ShouldTolerateAltDirectorySeparatorChar( string contents, string directory, string fileName) @@ -109,7 +109,7 @@ public void ReadAllText_ShouldTolerateAltDirectorySeparatorChar( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public void ReadAllText_WithDifferentEncoding_ShouldNotReturnWrittenText( string contents, Encoding writeEncoding, Encoding readEncoding) @@ -124,7 +124,7 @@ public void ReadAllText_WithDifferentEncoding_ShouldNotReturnWrittenText( $"{contents} should be different when encoding from {writeEncoding} to {readEncoding}."); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetEncodingsForReadAllText))] public void ReadAllText_WithoutReadEncoding_ShouldReturnWrittenText( Encoding writeEncoding) @@ -139,7 +139,7 @@ public void ReadAllText_WithoutReadEncoding_ShouldReturnWrittenText( $"{contents} should not be different when no read encoding is used for write encoding: {writeEncoding}."); } - [SkippableTheory] + [Theory] [AutoData] public void ReadAllText_WithStarCharacter_ShouldThrowFileNotFoundException( string path, string contents) @@ -160,11 +160,11 @@ public void ReadAllText_WithStarCharacter_ShouldThrowFileNotFoundException( public static TheoryData GetEncodingsForReadAllText() => new() { - new UTF32Encoding(false, true, true), + (Encoding)new UTF32Encoding(false, true, true), // big endian - new UTF32Encoding(true, true, true), - new UTF8Encoding(true, true), - new ASCIIEncoding(), + (Encoding)new UTF32Encoding(true, true, true), + (Encoding)new UTF8Encoding(true, true), + (Encoding)new ASCIIEncoding(), }; #pragma warning restore MA0018 diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs index b40563168..f1bc0fc85 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs @@ -11,7 +11,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ReadLinesAsyncTests { - [SkippableTheory] + [Theory] [AutoData] public async Task ReadLinesAsync_Cancelled_ShouldThrowTaskCanceledException( string path) @@ -20,18 +20,20 @@ public async Task ReadLinesAsync_Cancelled_ShouldThrowTaskCanceledException( using CancellationTokenSource cts = new(); await cts.CancelAsync(); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await foreach (string _ in FileSystem.File.ReadLinesAsync(path, cts.Token)) { // do nothing } - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadLinesAsync_Cancelled_WithEncoding_ShouldThrowTaskCanceledException( @@ -41,37 +43,41 @@ public async Task using CancellationTokenSource cts = new(); await cts.CancelAsync(); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await foreach (string _ in FileSystem.File.ReadLinesAsync(path, Encoding.UTF8, cts.Token)) { // do nothing } - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadLinesAsync_MissingFile_ShouldThrowFileNotFoundException( string path) { - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await foreach (string _ in FileSystem.File.ReadLinesAsync(path)) { // do nothing } - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException( $"'{FileSystem.Path.GetFullPath(path)}'", hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public async Task ReadLinesAsync_ShouldEnumerateLines(string path, string[] lines) { @@ -87,7 +93,7 @@ public async Task ReadLinesAsync_ShouldEnumerateLines(string path, string[] line results.Should().BeEquivalentTo(lines, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public async Task ReadLinesAsync_WithDifferentEncoding_ShouldNotReturnWrittenText( string specialLine, Encoding writeEncoding, Encoding readEncoding) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesTests.cs index 307965584..2bc7158b9 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ReadLinesTests { - [SkippableTheory] + [Theory] [AutoData] public void ReadLines_EmptyFile_ShouldEnumerateLines(string path) { @@ -19,7 +19,7 @@ public void ReadLines_EmptyFile_ShouldEnumerateLines(string path) results.Should().BeEmpty(); } - [SkippableTheory] + [Theory] [AutoData] public void ReadLines_MissingFile_ShouldThrowFileNotFoundException(string path) { @@ -33,7 +33,7 @@ public void ReadLines_MissingFile_ShouldThrowFileNotFoundException(string path) hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void ReadLines_ShouldEnumerateLines(string path, string[] lines) { @@ -45,7 +45,7 @@ public void ReadLines_ShouldEnumerateLines(string path, string[] lines) results.Should().BeEquivalentTo(lines); } - [SkippableTheory] + [Theory] [ClassData(typeof(TestDataGetEncodingDifference))] public void ReadLines_WithDifferentEncoding_ShouldNotReturnWrittenText( string specialLine, Encoding writeEncoding, Encoding readEncoding) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReplaceTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReplaceTests.cs index 7004dc329..4702ff84e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReplaceTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReplaceTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class ReplaceTests { - [SkippableTheory] + [Theory] [AutoData] public void Replace_CaseOnlyChange_ShouldThrowIOException( string name, string contents) @@ -41,7 +41,7 @@ public void Replace_CaseOnlyChange_ShouldThrowIOException( } } - [SkippableTheory] + [Theory] [AutoData] public void Replace_DestinationDirectoryDoesNotExist_ShouldThrowCorrectException( @@ -66,7 +66,7 @@ public void } } - [SkippableTheory] + [Theory] [AutoData] public void Replace_DestinationIsDirectory_ShouldThrowUnauthorizedAccessException( string sourceName, @@ -84,7 +84,7 @@ public void Replace_DestinationIsDirectory_ShouldThrowUnauthorizedAccessExceptio exception.Should().BeException(hResult: -2147024891); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_DestinationMissing_ShouldThrowFileNotFoundException( string sourceName, @@ -102,7 +102,7 @@ public void Replace_DestinationMissing_ShouldThrowFileNotFoundException( FileSystem.Should().NotHaveFile(backupName); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_ReadOnly_WithIgnoreMetadataError_ShouldReplaceFile( string sourceName, @@ -125,7 +125,7 @@ public void Replace_ReadOnly_WithIgnoreMetadataError_ShouldReplaceFile( .Which.HasContent(destinationContents); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_ReadOnly_WithoutIgnoreMetadataError_ShouldThrowUnauthorizedAccessException_OnWindows( @@ -166,7 +166,7 @@ public void } } - [SkippableTheory] + [Theory] [AutoData] public void Replace_ShouldReplaceFile( string sourceName, @@ -187,7 +187,7 @@ public void Replace_ShouldReplaceFile( .Which.HasContent(destinationContents); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_SourceIsDirectory_ShouldThrowUnauthorizedAccessException( string sourceName, @@ -207,7 +207,7 @@ public void Replace_SourceIsDirectory_ShouldThrowUnauthorizedAccessException( exception.Should().BeException(hResult: -2147024891); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.None)] [InlineAutoData(FileAccess.Read, FileShare.Read)] [InlineAutoData(FileAccess.Read, FileShare.ReadWrite)] @@ -264,7 +264,7 @@ public void Replace_SourceLocked_ShouldThrowIOException_OnWindows( } } - [SkippableTheory] + [Theory] [AutoData] public void Replace_SourceMissing_ShouldThrowFileNotFoundException( string sourceName, @@ -286,7 +286,7 @@ public void Replace_SourceMissing_ShouldThrowFileNotFoundException( } } - [SkippableTheory] + [Theory] [AutoData] public void Replace_WithExistingBackupFile_ShouldIgnoreBackup( string sourceName, @@ -309,7 +309,7 @@ public void Replace_WithExistingBackupFile_ShouldIgnoreBackup( .Which.HasContent(backupContents); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_WithoutBackup_ShouldReplaceFile( string sourceName, diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ResolveLinkTargetTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ResolveLinkTargetTests.cs index d78bb59d4..b96bb707e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ResolveLinkTargetTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ResolveLinkTargetTests.cs @@ -18,7 +18,7 @@ public partial class ResolveLinkTargetTests #endregion - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_AbsolutePath_ShouldFollowSymbolicLink( string path, string pathToTarget) @@ -34,7 +34,7 @@ public void ResolveLinkTarget_AbsolutePath_ShouldFollowSymbolicLink( target.Should().Exist(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FileWithDifferentCase_ShouldReturnPathToMissingFile( string path, string pathToTarget, string contents) @@ -61,7 +61,7 @@ public void ResolveLinkTarget_FileWithDifferentCase_ShouldReturnPathToMissingFil } } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FinalTarget_MultipleSteps_ShouldFollowSymbolicLinkToFinalTarget( string path, string pathToFinalTarget) @@ -85,7 +85,7 @@ public void ResolveLinkTarget_FinalTarget_MultipleSteps_ShouldFollowSymbolicLink target!.FullName.Should().Be(FileSystem.Path.GetFullPath(pathToFinalTarget)); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FinalTarget_ShouldFollowSymbolicLinkToFinalTarget( string path, string pathToFinalTarget) @@ -108,7 +108,7 @@ public void ResolveLinkTarget_FinalTarget_ShouldFollowSymbolicLinkToFinalTarget( target!.FullName.Should().Be(FileSystem.Path.GetFullPath(pathToFinalTarget)); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FinalTargetWithTooManyLevels_ShouldThrowIOException( string path, string pathToFinalTarget) @@ -133,7 +133,7 @@ public void ResolveLinkTarget_FinalTargetWithTooManyLevels_ShouldThrowIOExceptio hResult: Test.RunsOnWindows ? -2147022975 : -2146232800); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_MissingFileAtBeginningOfLinkChain_ShouldReturnPathToMissingFile( string path, string pathToFinalTarget, string pathToMissingFile) @@ -151,7 +151,7 @@ public void ResolveLinkTarget_MissingFileAtBeginningOfLinkChain_ShouldReturnPath target!.FullName.Should().Be(FileSystem.Path.GetFullPath(pathToMissingFile)); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_MissingFileInLinkChain_ShouldReturnPathToMissingFile( string path, @@ -174,7 +174,7 @@ public void ResolveLinkTarget_MissingFileInLinkChain_ShouldReturnPathToMissingFi target!.FullName.Should().Be(FileSystem.Path.GetFullPath(pathToMissingFile)); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_NormalDirectory_ShouldReturnNull( string path) @@ -187,7 +187,7 @@ public void ResolveLinkTarget_NormalDirectory_ShouldReturnNull( target.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_NormalFile_ShouldReturnNull( string path) @@ -200,7 +200,7 @@ public void ResolveLinkTarget_NormalFile_ShouldReturnNull( target.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_RelativePath_ShouldFollowSymbolicLinkUnderWindows( string path, string pathToTarget) @@ -216,7 +216,7 @@ public void ResolveLinkTarget_RelativePath_ShouldFollowSymbolicLinkUnderWindows( target.Should().Exist(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_TargetDeletedAfterLinkCreation_ShouldReturnNull( string path, string pathToTarget) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/SetAttributesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/SetAttributesTests.cs index 5a5436922..5ae96bc9b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/SetAttributesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/SetAttributesTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class SetAttributesTests { - [SkippableTheory] + [Theory] [AutoData] public void SetAttributes_Directory_ShouldRemainFile(string path) { @@ -17,7 +17,7 @@ public void SetAttributes_Directory_ShouldRemainFile(string path) FileSystem.Should().HaveFile(path); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.ReadOnly)] [InlineAutoData(FileAttributes.Normal)] public void SetAttributes_ShouldNotAdjustTimes(FileAttributes attributes, string path) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/Tests.cs index 95e59d246..0498d9712 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/Tests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void GetCreationTime_PathNotFound_ShouldReturnNullTime(string path) { @@ -14,7 +14,7 @@ public void GetCreationTime_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetCreationTimeUtc_PathNotFound_ShouldReturnNullTime(string path) { @@ -25,7 +25,7 @@ public void GetCreationTimeUtc_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetLastAccessTime_PathNotFound_ShouldReturnNullTime(string path) { @@ -36,7 +36,7 @@ public void GetLastAccessTime_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetLastAccessTimeUtc_PathNotFound_ShouldReturnNullTime(string path) { @@ -47,7 +47,7 @@ public void GetLastAccessTimeUtc_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetLastWriteTime_PathNotFound_ShouldReturnNullTime(string path) { @@ -58,7 +58,7 @@ public void GetLastWriteTime_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void GetLastWriteTimeUtc_PathNotFound_ShouldReturnNullTime(string path) { @@ -69,7 +69,7 @@ public void GetLastWriteTimeUtc_PathNotFound_ShouldReturnNullTime(string path) result.Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void LastAccessTime_ShouldBeSet(string path) { @@ -82,7 +82,7 @@ public void LastAccessTime_ShouldBeSet(string path) result.Kind.Should().Be(DateTimeKind.Local); } - [SkippableTheory] + [Theory] [AutoData] public void LastAccessTimeUtc_ShouldBeSet(string path) { @@ -95,7 +95,7 @@ public void LastAccessTimeUtc_ShouldBeSet(string path) result.Kind.Should().Be(DateTimeKind.Utc); } - [SkippableTheory] + [Theory] [AutoData] public void LastWriteTime_ShouldBeSet(string path) { @@ -108,7 +108,7 @@ public void LastWriteTime_ShouldBeSet(string path) result.Kind.Should().Be(DateTimeKind.Local); } - [SkippableTheory] + [Theory] [AutoData] public void LastWriteTimeUtc_ShouldBeSet(string path) { @@ -121,7 +121,7 @@ public void LastWriteTimeUtc_ShouldBeSet(string path) result.Kind.Should().Be(DateTimeKind.Utc); } - [SkippableTheory] + [Theory] [AutoData] public void SetCreationTime_ShouldChangeCreationTime( string path, DateTime creationTime) @@ -139,7 +139,7 @@ public void SetCreationTime_ShouldChangeCreationTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetCreationTimeUtc_ShouldChangeCreationTime( string path, DateTime creationTime) @@ -157,7 +157,7 @@ public void SetCreationTimeUtc_ShouldChangeCreationTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastAccessTime_ShouldChangeLastAccessTime( string path, DateTime lastAccessTime) @@ -172,7 +172,7 @@ public void SetLastAccessTime_ShouldChangeLastAccessTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastAccessTimeUtc_ShouldChangeLastAccessTime( string path, DateTime lastAccessTime) @@ -187,7 +187,7 @@ public void SetLastAccessTimeUtc_ShouldChangeLastAccessTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastWriteTime_ShouldChangeLastWriteTime( string path, DateTime lastWriteTime) @@ -202,7 +202,7 @@ public void SetLastWriteTime_ShouldChangeLastWriteTime( .Should().Be(expectedTime); } - [SkippableTheory] + [Theory] [AutoData] public void SetLastWriteTimeUtc_ShouldChangeLastWriteTime( string path, DateTime lastWriteTime) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/UnixFileModeTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/UnixFileModeTests.cs index dffc9538b..e01aefc95 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/UnixFileModeTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/UnixFileModeTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class UnixFileModeTests { - [SkippableTheory] + [Theory] [AutoData] public void GetUnixFileMode_ShouldBeInitializedCorrectly( string path) @@ -26,7 +26,7 @@ public void GetUnixFileMode_ShouldBeInitializedCorrectly( result.Should().Be(expected); } - [SkippableTheory] + [Theory] [AutoData] public void GetUnixFileMode_ShouldThrowPlatformNotSupportedException_OnWindows( string path) @@ -43,7 +43,7 @@ public void GetUnixFileMode_ShouldThrowPlatformNotSupportedException_OnWindows( exception.Should().BeException(hResult: -2146233031); } - [SkippableTheory] + [Theory] [AutoData] public void SetUnixFileMode_MissingFile_ShouldThrowFileNotFoundException( string path, UnixFileMode unixFileMode) @@ -60,7 +60,7 @@ public void SetUnixFileMode_MissingFile_ShouldThrowFileNotFoundException( exception.Should().BeException(hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void SetUnixFileMode_ShouldBeSettableOnLinux( string path, UnixFileMode unixFileMode) @@ -77,7 +77,7 @@ public void SetUnixFileMode_ShouldBeSettableOnLinux( result.Should().Be(unixFileMode); } - [SkippableTheory] + [Theory] [AutoData] public void SetUnixFileMode_ShouldThrowPlatformNotSupportedException_OnWindows( string path, UnixFileMode mode) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs index 84ec0066e..b0c5fd36b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs @@ -10,7 +10,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class WriteAllBytesAsyncTests { - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllBytesAsync_Cancelled_ShouldThrowTaskCanceledException( string path, byte[] bytes) @@ -24,7 +24,7 @@ public async Task WriteAllBytesAsync_Cancelled_ShouldThrowTaskCanceledException( exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllBytesAsync_PreviousFile_ShouldOverwriteFileWithBytes( string path, byte[] bytes) @@ -37,7 +37,7 @@ public async Task WriteAllBytesAsync_PreviousFile_ShouldOverwriteFileWithBytes( .Which.HasContent(bytes); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllBytesAsync_ShouldCreateFileWithBytes( string path, byte[] bytes) @@ -48,20 +48,22 @@ public async Task WriteAllBytesAsync_ShouldCreateFileWithBytes( .Which.HasContent(bytes); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllBytesAsync_WhenBytesAreNull_ShouldThrowArgumentNullException( string path) { - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.WriteAllBytesAsync(path, null!); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(paramName: "bytes"); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllBytesAsync_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( @@ -69,10 +71,12 @@ public async Task { FileSystem.Directory.CreateDirectory(path); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.WriteAllBytesAsync(path, bytes); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException( hResult: -2147024891); @@ -80,7 +84,7 @@ public async Task FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllTextAsync_WhenFileIsHidden_ShouldThrowUnauthorizedAccessException_OnWindows( @@ -91,10 +95,12 @@ public async Task await FileSystem.File.WriteAllTextAsync(path, null); FileSystem.File.SetAttributes(path, FileAttributes.Hidden); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.WriteAllBytesAsync(path, bytes); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2147024891); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesTests.cs index 3075e8972..b58d1e686 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class WriteAllBytesTests { - [SkippableTheory] + [Theory] [AutoData] public void WriteAllBytes_PreviousFile_ShouldOverwriteFileWithBytes( string path, byte[] bytes) @@ -19,7 +19,7 @@ public void WriteAllBytes_PreviousFile_ShouldOverwriteFileWithBytes( .Which.HasContent(bytes); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllBytes_ShouldCreateFileWithBytes(string path, byte[] bytes) { @@ -29,7 +29,7 @@ public void WriteAllBytes_ShouldCreateFileWithBytes(string path, byte[] bytes) .Which.HasContent(bytes); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllBytes_WhenBytesAreNull_ShouldThrowArgumentNullException(string path) { @@ -41,7 +41,7 @@ public void WriteAllBytes_WhenBytesAreNull_ShouldThrowArgumentNullException(stri exception.Should().BeException(paramName: "bytes"); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllBytes_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( @@ -60,7 +60,7 @@ public void FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllBytes_WhenFileIsHidden_ShouldThrowUnauthorizedAccessException_OnWindows( string path, byte[] bytes) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs index 7b930d2c1..51780bc1e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs @@ -10,7 +10,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class WriteAllLinesAsyncTests { - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_Cancelled_ShouldThrowTaskCanceledException( string path, string[] contents) @@ -24,7 +24,7 @@ public async Task WriteAllLinesAsync_Cancelled_ShouldThrowTaskCanceledException( exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_Cancelled_WithEncoding_ShouldThrowTaskCanceledException( @@ -39,7 +39,7 @@ public async Task exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_Enumerable_Cancelled_ShouldThrowTaskCanceledException( @@ -54,7 +54,7 @@ public async Task exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_Enumerable_Cancelled_WithEncoding_ShouldThrowTaskCanceledException( @@ -70,7 +70,7 @@ public async Task exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_Enumerable_PreviousFile_ShouldOverwriteFileWithText( @@ -84,7 +84,7 @@ public async Task result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_Enumerable_ShouldCreateFileWithText( string path, string[] contents) @@ -95,7 +95,7 @@ public async Task WriteAllLinesAsync_Enumerable_ShouldCreateFileWithText( result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_PreviousFile_ShouldOverwriteFileWithText( string path, string[] contents) @@ -108,7 +108,7 @@ public async Task WriteAllLinesAsync_PreviousFile_ShouldOverwriteFileWithText( result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_ShouldCreateFileWithText( string path, string[] contents) @@ -119,7 +119,7 @@ public async Task WriteAllLinesAsync_ShouldCreateFileWithText( result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( @@ -127,10 +127,12 @@ public async Task { FileSystem.Directory.CreateDirectory(path); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.WriteAllLinesAsync(path, contents); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException( hResult: -2147024891); @@ -138,7 +140,7 @@ public async Task FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllLinesAsync_WhenFileIsHidden_ShouldThrowUnauthorizedAccessException_OnWindows( @@ -149,10 +151,12 @@ public async Task await FileSystem.File.WriteAllTextAsync(path, null); FileSystem.File.SetAttributes(path, FileAttributes.Hidden); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.WriteAllLinesAsync(path, contents); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2147024891); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesTests.cs index 0629d9a6a..9196c5007 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class WriteAllLinesTests { - [SkippableTheory] + [Theory] [AutoData] public void WriteAllLines_Enumerable_PreviousFile_ShouldOverwriteFileWithText( string path, string[] contents) @@ -20,7 +20,7 @@ public void WriteAllLines_Enumerable_PreviousFile_ShouldOverwriteFileWithText( result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllLines_Enumerable_ShouldCreateFileWithText( string path, string[] contents) @@ -31,7 +31,7 @@ public void WriteAllLines_Enumerable_ShouldCreateFileWithText( result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllLines_Enumerable_WithEncoding_ShouldCreateFileWithText( Encoding encoding, string path, string[] contents) @@ -42,7 +42,7 @@ public void WriteAllLines_Enumerable_WithEncoding_ShouldCreateFileWithText( result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllLines_PreviousFile_ShouldOverwriteFileWithText( string path, string[] contents) @@ -55,7 +55,7 @@ public void WriteAllLines_PreviousFile_ShouldOverwriteFileWithText( result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllLines_ShouldCreateFileWithText(string path, string[] contents) { @@ -65,7 +65,7 @@ public void WriteAllLines_ShouldCreateFileWithText(string path, string[] content result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllLines_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( @@ -84,7 +84,7 @@ public void FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllLines_WhenFileIsHidden_ShouldThrowUnauthorizedAccessException_OnWindows( string path, string[] contents) @@ -102,7 +102,7 @@ public void WriteAllLines_WhenFileIsHidden_ShouldThrowUnauthorizedAccessExceptio exception.Should().BeException(hResult: -2147024891); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllLines_WithEncoding_ShouldCreateFileWithText( Encoding encoding, string path, string[] contents) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs index db8781db6..e8ef1f5fe 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs @@ -9,7 +9,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class WriteAllTextAsyncTests { - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllTextAsync_Cancelled_ShouldThrowTaskCanceledException( string path, string? contents) @@ -23,7 +23,7 @@ public async Task WriteAllTextAsync_Cancelled_ShouldThrowTaskCanceledException( exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllTextAsync_Cancelled_WithEncoding_ShouldThrowTaskCanceledException( @@ -38,7 +38,7 @@ public async Task exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllTextAsync_PreviousFile_ShouldOverwriteFileWithText( string path, string contents) @@ -51,7 +51,7 @@ public async Task WriteAllTextAsync_PreviousFile_ShouldOverwriteFileWithText( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllTextAsync_ShouldCreateFileWithText( string path, string contents) @@ -63,7 +63,7 @@ public async Task WriteAllTextAsync_ShouldCreateFileWithText( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllTextAsync_SpecialCharacters_ShouldReturnSameText( string path) @@ -89,19 +89,20 @@ public async Task WriteAllTextAsync_SpecialCharacters_ShouldReturnSameText( } } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllTextAsync_WhenContentIsNull_ShouldNotThrowException(string path) { - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.WriteAllTextAsync(path, null); - }); - + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllTextAsync_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( @@ -109,10 +110,12 @@ public async Task { FileSystem.Directory.CreateDirectory(path); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.WriteAllTextAsync(path, contents); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException( hResult: -2147024891); @@ -120,7 +123,7 @@ public async Task FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAllTextAsync_WhenFileIsHidden_ShouldThrowUnauthorizedAccessException_OnWindows( @@ -131,10 +134,12 @@ public async Task await FileSystem.File.WriteAllTextAsync(path, null); FileSystem.File.SetAttributes(path, FileAttributes.Hidden); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await FileSystem.File.WriteAllTextAsync(path, contents); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2147024891); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextTests.cs index 9eb24c7bf..9e3a4901d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; [FileSystemTests] public partial class WriteAllTextTests { - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_MissingDirectory_ShouldThrowDirectoryNotFoundException( string directory, string path) @@ -22,7 +22,7 @@ public void WriteAllText_MissingDirectory_ShouldThrowDirectoryNotFoundException( messageContains: $"'{FileSystem.Path.GetFullPath(fullPath)}'"); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_PreviousFile_ShouldOverwriteFileWithText( string path, string contents) @@ -35,7 +35,7 @@ public void WriteAllText_PreviousFile_ShouldOverwriteFileWithText( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_ShouldAdjustTimes(string path, string contents) { @@ -70,7 +70,7 @@ public void WriteAllText_ShouldAdjustTimes(string path, string contents) .BeOnOrAfter(updateTime.ApplySystemClockTolerance()); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_ShouldCreateFileWithByteOrderMark( string path) @@ -83,7 +83,7 @@ public void WriteAllText_ShouldCreateFileWithByteOrderMark( .Which.HasContent(expectedBytes); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_ShouldCreateFileWithText(string path, string contents) { @@ -93,7 +93,7 @@ public void WriteAllText_ShouldCreateFileWithText(string path, string contents) result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_SpecialCharacters_ShouldReturnSameText(string path) { @@ -119,7 +119,7 @@ public void WriteAllText_SpecialCharacters_ShouldReturnSameText(string path) } } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_WhenContentIsNull_ShouldNotThrowException(string path) { @@ -131,7 +131,7 @@ public void WriteAllText_WhenContentIsNull_ShouldNotThrowException(string path) exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorizedAccessException( string path) @@ -149,7 +149,7 @@ public void WriteAllText_WhenDirectoryWithSameNameExists_ShouldThrowUnauthorized FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void WriteAllText_WhenFileIsHidden_ShouldThrowUnauthorizedAccessException_OnWindows( string path, string contents) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AppendTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AppendTextTests.cs index 663bf5869..62927fc7e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AppendTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AppendTextTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class AppendTextTests { - [SkippableTheory] + [Theory] [AutoData] public void AppendText_MissingFile_ShouldCreateFile( string path, string appendText) @@ -21,7 +21,7 @@ public void AppendText_MissingFile_ShouldCreateFile( .Which.HasContent(appendText); } - [SkippableTheory] + [Theory] [AutoData] public void AppendText_ShouldAddTextToExistingFile( string path, string contents, string appendText) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AttributesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AttributesTests.cs index fcc4c1e33..241c4dbf7 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AttributesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AttributesTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class AttributesTests { - [SkippableTheory] + [Theory] [AutoData] public void Attributes_SetDirectoryAttribute_ShouldRemainFile(string path) { @@ -17,7 +17,7 @@ public void Attributes_SetDirectoryAttribute_ShouldRemainFile(string path) sut.Attributes.Should().NotHaveFlag(FileAttributes.Directory); } - [SkippableTheory] + [Theory] [AutoData] public void Attributes_ShouldNotHaveDirectoryAttribute(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CopyToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CopyToTests.cs index e3b9c2073..9fe85ba32 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CopyToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CopyToTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class CopyToTests { - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_DestinationExists_ShouldThrowIOException_AndNotCopyFile( string sourceName, @@ -32,7 +32,7 @@ public void CopyTo_DestinationExists_ShouldThrowIOException_AndNotCopyFile( } #if FEATURE_FILE_MOVETO_OVERWRITE - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_DestinationExists_WithOverwrite_ShouldOverwriteDestination( string sourceName, @@ -57,7 +57,7 @@ public void CopyTo_DestinationExists_WithOverwrite_ShouldOverwriteDestination( } #endif - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_ReadOnly_ShouldCopyFile( string sourceName, string destinationName, string contents) @@ -74,7 +74,7 @@ public void CopyTo_ReadOnly_ShouldCopyFile( .And.HasAttribute(FileAttributes.ReadOnly); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.ReadOnly)] [InlineAutoData(FileAttributes.System)] public void CopyTo_ShouldAddArchiveAttribute_OnWindows( @@ -100,7 +100,7 @@ public void CopyTo_ShouldAddArchiveAttribute_OnWindows( .Should().Be(expectedAttributes); } - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_ShouldCopyFileWithContent( string sourceName, string destinationName, string contents) @@ -124,7 +124,7 @@ public void CopyTo_ShouldCopyFileWithContent( .Which.HasContent(contents); } - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_ShouldKeepMetadata( string sourceName, @@ -171,7 +171,7 @@ public void CopyTo_ShouldKeepMetadata( .Should().Be(sourceLastWriteTime); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.Read)] [InlineAutoData(FileAccess.Read, FileShare.ReadWrite)] [InlineAutoData(FileAccess.ReadWrite, FileShare.Read)] @@ -198,7 +198,7 @@ public void CopyTo_SourceAccessedWithReadShare_ShouldNotThrow( FileSystem.File.ReadAllText(destinationPath).Should().Be(sourceContents); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read)] [InlineAutoData(FileAccess.ReadWrite)] [InlineAutoData(FileAccess.Write)] @@ -223,7 +223,7 @@ public void CopyTo_SourceAccessedWithWriteShare_ShouldNotThrowOnLinuxOrMac( FileSystem.File.ReadAllText(destinationPath).Should().Be(sourceContents); } - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_SourceIsDirectory_ShouldThrowUnauthorizedAccessException_AndNotCopyFile( string sourceName, @@ -244,7 +244,7 @@ public void CopyTo_SourceIsDirectory_ShouldThrowUnauthorizedAccessException_AndN FileSystem.Should().NotHaveFile(destinationName); } - [SkippableTheory] + [Theory] [InlineAutoData(FileShare.None)] [InlineAutoData(FileShare.Write)] public void CopyTo_SourceLocked_ShouldThrowIOException( @@ -277,7 +277,7 @@ public void CopyTo_SourceLocked_ShouldThrowIOException( } } - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_SourceMissing_ShouldThrowFileNotFoundException( string sourceName, diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateAsSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateAsSymbolicLinkTests.cs index d291d4ff8..76e24165b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateAsSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateAsSymbolicLinkTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class CreateAsSymbolicLinkTests { - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_ShouldCreateSymbolicLink( string path, string pathToTarget) @@ -20,7 +20,7 @@ public void CreateAsSymbolicLink_ShouldCreateSymbolicLink( .Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_SourceFileAlreadyExists_ShouldThrowIOException( string path, string pathToTarget) @@ -37,7 +37,7 @@ public void CreateAsSymbolicLink_SourceFileAlreadyExists_ShouldThrowIOException( hResult: Test.RunsOnWindows ? -2147024713 : 17); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_TargetFileMissing_ShouldNotThrowException( string path, string pathToTarget) @@ -50,7 +50,7 @@ public void CreateAsSymbolicLink_TargetFileMissing_ShouldNotThrowException( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithEmptyPath_ShouldThrowArgumentException( string pathToTarget) @@ -65,7 +65,7 @@ public void CreateAsSymbolicLink_WithEmptyPath_ShouldThrowArgumentException( exception.Should().BeException(paramName: "path"); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithEmptyTarget_ShouldThrowArgumentException( string path) @@ -80,7 +80,7 @@ public void CreateAsSymbolicLink_WithEmptyTarget_ShouldThrowArgumentException( exception.Should().BeException(paramName: "pathToTarget"); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithIllegalCharactersInPath_ShouldThrowIOException( string pathToTarget) @@ -97,7 +97,7 @@ public void CreateAsSymbolicLink_WithIllegalCharactersInPath_ShouldThrowIOExcept exception.Should().BeException(hResult: -2147024773); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithIllegalCharactersInTarget_ShouldThrowIOException( string path) @@ -114,7 +114,7 @@ public void CreateAsSymbolicLink_WithIllegalCharactersInTarget_ShouldThrowIOExce exception.Should().BeException(hResult: -2147024713); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithIllegalPath_ShouldThrowArgumentException_OnWindows( @@ -137,7 +137,7 @@ public void } } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithIllegalTarget_ShouldNotThrowException( string path) @@ -150,7 +150,7 @@ public void CreateAsSymbolicLink_WithIllegalTarget_ShouldNotThrowException( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithNullPath_ShouldThrowArgumentNullException( string pathToTarget) @@ -170,7 +170,7 @@ public void CreateAsSymbolicLink_WithNullPath_ShouldThrowArgumentNullException( #endif } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_WithNullTarget_ShouldThrowArgumentNullException( string path) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTests.cs index ce5dbc1c8..895dcb53c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class CreateTests { - [SkippableTheory] + [Theory] [AutoData] public void Create_MissingFile_ShouldCreateFile(string path) { @@ -17,7 +17,7 @@ public void Create_MissingFile_ShouldCreateFile(string path) FileSystem.Should().HaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void Create_ShouldRefreshExistsCacheForCurrentItem_ExceptOnNetFramework(string path) { @@ -46,7 +46,7 @@ public void Create_ShouldRefreshExistsCacheForCurrentItem_ExceptOnNetFramework(s FileSystem.Should().HaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void Create_ShouldUseReadWriteAccessAndNoneShare(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTextTests.cs index 45545ff2a..4900d0df4 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTextTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class CreateTextTests { - [SkippableTheory] + [Theory] [AutoData] public void CreateText_MissingFile_ShouldCreateFile( string path, string appendText) @@ -22,7 +22,7 @@ public void CreateText_MissingFile_ShouldCreateFile( } #if NET8_0_OR_GREATER - [SkippableTheory] + [Theory] [AutoData] public void CreateText_ShouldRefreshExistsCache( string path, string appendText) @@ -39,7 +39,7 @@ public void CreateText_ShouldRefreshExistsCache( FileSystem.Should().HaveFile(path); } #else - [SkippableTheory] + [Theory] [AutoData] public void CreateText_ShouldNotRefreshExistsCache( string path, string appendText) @@ -57,7 +57,7 @@ public void CreateText_ShouldNotRefreshExistsCache( } #endif - [SkippableTheory] + [Theory] [AutoData] public void CreateText_ShouldReplaceTextInExistingFile( string path, string contents, string appendText) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/DeleteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/DeleteTests.cs index dc4687903..ed643af05 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/DeleteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/DeleteTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class DeleteTests { - [SkippableTheory] + [Theory] [AutoData] public void Delete_MissingDirectory_ShouldThrowDirectoryNotFoundException( string missingDirectory, string fileName) @@ -20,7 +20,7 @@ public void Delete_MissingDirectory_ShouldThrowDirectoryNotFoundException( exception.Should().BeException(hResult: -2147024893); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_MissingFile_ShouldDoNothing( string fileName) @@ -33,7 +33,7 @@ public void Delete_MissingFile_ShouldDoNothing( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_ShouldRefreshExistsCache_ExceptOnNetFramework(string path) { @@ -55,7 +55,7 @@ public void Delete_ShouldRefreshExistsCache_ExceptOnNetFramework(string path) FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void Delete_WithOpenFile_ShouldThrowIOException_OnWindows(string filename) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/EncryptDecryptTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/EncryptDecryptTests.cs index 3aadf7a6b..c9a3ae02b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/EncryptDecryptTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/EncryptDecryptTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class EncryptDecryptTests { - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Decrypt_EncryptedData_ShouldReturnOriginalText( @@ -24,7 +24,7 @@ public void Decrypt_EncryptedData_ShouldReturnOriginalText( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Decrypt_UnencryptedData_ShouldReturnOriginalText( @@ -41,7 +41,7 @@ public void Decrypt_UnencryptedData_ShouldReturnOriginalText( result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Encrypt_Decrypt_ShouldChangeEncryptedFileAttribute( @@ -59,7 +59,7 @@ public void Encrypt_Decrypt_ShouldChangeEncryptedFileAttribute( sut.Attributes.Should().NotHaveFlag(FileAttributes.Encrypted); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Encrypt_ShouldChangeData( @@ -77,7 +77,7 @@ public void Encrypt_ShouldChangeData( result.Should().NotBeEquivalentTo(bytes); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Encrypt_Twice_ShouldIgnoreTheSecondTime( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExceptionTests.cs index 509cba84f..debce1607 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExceptionTests.cs @@ -8,8 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] - [MemberData(nameof(GetFileInfoCallbacks), parameters: "Illegal\tCharacter?InPath")] + [Theory] + [MemberData(nameof(GetFileInfoCallbacks), "Illegal\tCharacter?InPath")] public void Operations_WhenValueContainsIllegalPathCharacters_ShouldThrowCorrectException_OnWindows( Expression> callback, string paramName, @@ -47,8 +47,8 @@ public void } } - [SkippableTheory] - [MemberData(nameof(GetFileInfoCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetFileInfoCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) { @@ -64,8 +64,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileInfoCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetFileInfoCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExistsTests.cs index 6e23d4a93..dcae9c2eb 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExistsTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class ExistsTests { - [SkippableTheory] + [Theory] [AutoData] public void Exists_Directory_ShouldReturnFalse(string path) { @@ -13,7 +13,7 @@ public void Exists_Directory_ShouldReturnFalse(string path) sut.Should().NotExist(); } - [SkippableTheory] + [Theory] [InlineData("foo", "foo.")] [InlineData("foo.", "foo")] [InlineData("foo", "foo..")] @@ -26,7 +26,7 @@ public void Exists_ShouldIgnoreTrailingDot_OnWindows(string path1, string path2) sut.Exists.Should().Be(Test.RunsOnWindows); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ShouldReturnCachedValueUntilRefresh(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/LengthTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/LengthTests.cs index 0171a8187..038fc9527 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/LengthTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/LengthTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class LengthTests { - [SkippableTheory] + [Theory] [AutoData] public void Length_MissingDirectory_ShouldThrowFileNotFoundException( string missingDirectory, string fileName) @@ -25,7 +25,7 @@ public void Length_MissingDirectory_ShouldThrowFileNotFoundException( : $"'{FileSystem.Path.GetFullPath(path)}'"); } - [SkippableTheory] + [Theory] [AutoData] public void Length_MissingFile_ShouldThrowFileNotFoundException(string path) { @@ -43,7 +43,7 @@ public void Length_MissingFile_ShouldThrowFileNotFoundException(string path) : $"'{FileSystem.Path.GetFullPath(path)}'"); } - [SkippableTheory] + [Theory] [AutoData] public void Length_PathIsDirectory_ShouldThrowFileNotFoundException(string path) { @@ -62,7 +62,7 @@ public void Length_PathIsDirectory_ShouldThrowFileNotFoundException(string path) : $"'{FileSystem.Path.GetFullPath(path)}'"); } - [SkippableTheory] + [Theory] [AutoData] public void Length_WhenFileExists_ShouldBeSetCorrectly(string path, byte[] bytes) { @@ -74,7 +74,7 @@ public void Length_WhenFileExists_ShouldBeSetCorrectly(string path, byte[] bytes result.Should().Be(bytes.Length); } - [SkippableTheory] + [Theory] [AutoData] public void Length_WhenFileIsCreated_ShouldBeSetCorrectly(string path, byte[] bytes) { @@ -87,7 +87,7 @@ public void Length_WhenFileIsCreated_ShouldBeSetCorrectly(string path, byte[] by result.Should().Be(bytes.Length); } - [SkippableTheory] + [Theory] [AutoData] public void Length_WhenFileIsCreatedAfterAccessed_ShouldBeSetCorrectly( string path, byte[] bytes) @@ -107,7 +107,7 @@ public void Length_WhenFileIsCreatedAfterAccessed_ShouldBeSetCorrectly( result.Should().Be(bytes.Length); } - [SkippableTheory] + [Theory] [AutoData] public void Length_WhenFileIsCreatedAfterLengthAccessed_ShouldThrowFileNotFoundExceptionAgain( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/MoveToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/MoveToTests.cs index d4f75fbd8..624278a04 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/MoveToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/MoveToTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class MoveToTests { - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_DestinationExists_ShouldThrowIOException_AndNotMoveFile( string sourceName, @@ -33,7 +33,7 @@ public void MoveTo_DestinationExists_ShouldThrowIOException_AndNotMoveFile( } #if FEATURE_FILE_MOVETO_OVERWRITE - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_DestinationExists_WithOverwrite_ShouldOverwriteDestination( string sourceName, @@ -56,7 +56,7 @@ public void MoveTo_DestinationExists_WithOverwrite_ShouldOverwriteDestination( } #endif - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_Itself_ShouldDoNothing( string sourceName, @@ -73,7 +73,7 @@ public void MoveTo_Itself_ShouldDoNothing( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_Itself_SourceMissing_ShouldThrowFileNotFoundException( string sourceName) @@ -93,7 +93,7 @@ public void MoveTo_Itself_SourceMissing_ShouldThrowFileNotFoundException( FileSystem.Should().NotHaveFile(sourceName); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_MissingDestinationDirectory_ShouldThrowDirectoryNotFoundException_AndNotMoveFile( @@ -120,7 +120,7 @@ public void FileSystem.Should().NotHaveFile(destinationName); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_ReadOnly_ShouldMoveFile( string sourceName, string destinationName, string contents) @@ -137,7 +137,7 @@ public void MoveTo_ReadOnly_ShouldMoveFile( .And.HasAttribute(FileAttributes.ReadOnly); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.ReadOnly)] [InlineAutoData(FileAttributes.System)] public void MoveTo_ShouldAddArchiveAttribute_OnWindows( @@ -162,7 +162,7 @@ public void MoveTo_ShouldAddArchiveAttribute_OnWindows( .Should().Be(expectedAttributes); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_ShouldKeepMetadata( string sourceName, @@ -189,7 +189,7 @@ public void MoveTo_ShouldKeepMetadata( .Should().Be(sourceLastWriteTime); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_ShouldMoveFileWithContent( string sourceName, string destinationName, string contents) @@ -206,7 +206,7 @@ public void MoveTo_ShouldMoveFileWithContent( .Which.HasContent(contents); } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_ShouldNotAdjustTimes(string source, string destination) { @@ -233,7 +233,7 @@ public void MoveTo_ShouldNotAdjustTimes(string source, string destination) lastWriteTime.Should().Be(expectedLastWriteTime); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.None)] [InlineAutoData(FileAccess.Read, FileShare.Read)] [InlineAutoData(FileAccess.Read, FileShare.ReadWrite)] @@ -276,7 +276,7 @@ public void MoveTo_SourceLocked_ShouldThrowIOException( } } - [SkippableTheory] + [Theory] [AutoData] public void MoveTo_SourceMissing_ShouldThrowFileNotFoundException( string sourceName, diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenReadTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenReadTests.cs index 8ef114e82..c41ac7142 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenReadTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenReadTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class OpenReadTests { - [SkippableTheory] + [Theory] [AutoData] public void OpenRead_MissingFile_ShouldThrowFileNotFoundException(string path) { @@ -21,7 +21,7 @@ public void OpenRead_MissingFile_ShouldThrowFileNotFoundException(string path) hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void OpenRead_ShouldUseReadAccessAndReadShare(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTests.cs index 7c132b24d..35342fbfe 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; public partial class OpenTests { #if NETFRAMEWORK - [SkippableTheory] + [Theory] [AutoData] public void Open_AppendMode_ShouldThrowArgumentException(string path) { @@ -23,7 +23,7 @@ public void Open_AppendMode_ShouldThrowArgumentException(string path) #endif #if !NETFRAMEWORK - [SkippableTheory] + [Theory] [AutoData] public void Open_AppendMode_ShouldOpenExistingFile( string path, byte[] bytes) @@ -39,7 +39,7 @@ public void Open_AppendMode_ShouldOpenExistingFile( #endif #if !NETFRAMEWORK - [SkippableTheory] + [Theory] [AutoData] public void Open_AppendMode_SeekShouldThrowIOException_WhenReadingBackward( string path, byte[] bytes) @@ -62,7 +62,7 @@ public void Open_AppendMode_SeekShouldThrowIOException_WhenReadingBackward( #endif #if !NETFRAMEWORK - [SkippableTheory] + [Theory] [AutoData] public void Open_AppendMode_SeekShouldWorkWhenKeepingInNewArea( string path, byte[] bytes) @@ -87,7 +87,7 @@ public void Open_AppendMode_SeekShouldWorkWhenKeepingInNewArea( #endif #if !NETFRAMEWORK - [SkippableTheory] + [Theory] [AutoData] public void Open_AppendMode_ReadShouldThrowNotSupportedException( string path, byte[] bytes) @@ -112,7 +112,7 @@ public void Open_AppendMode_ReadShouldThrowNotSupportedException( } #endif - [SkippableTheory] + [Theory] [AutoData] public void Open_ExistingFileWithCreateNewMode_ShouldThrowIOException( string path) @@ -129,7 +129,7 @@ public void Open_ExistingFileWithCreateNewMode_ShouldThrowIOException( hResult: Test.RunsOnWindows ? -2147024816 : 17); } - [SkippableTheory] + [Theory] [InlineAutoData(FileMode.Open)] [InlineAutoData(FileMode.Truncate)] public void Open_MissingFileAndIncorrectMode_ShouldThrowFileNotFoundException( @@ -147,7 +147,7 @@ public void Open_MissingFileAndIncorrectMode_ShouldThrowFileNotFoundException( hResult: -2147024894); } - [SkippableTheory] + [Theory] #if !NETFRAMEWORK [InlineAutoData(FileMode.Append)] #endif @@ -169,7 +169,7 @@ public void Open_MissingFileAndCorrectMode_ShouldCreateFile( FileSystem.Should().HaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void Open_ShouldOpenWithReadAndWriteAccess( string path) @@ -182,7 +182,7 @@ public void Open_ShouldOpenWithReadAndWriteAccess( stream.CanWrite.Should().BeTrue(); } - [SkippableTheory] + [Theory] #if !NETFRAMEWORK [InlineAutoData(FileMode.Append, FileAccess.Write)] #endif @@ -202,7 +202,7 @@ public void Open_ShouldUseExpectedAccessDependingOnMode( FileTestHelper.CheckFileShare(FileSystem, path).Should().Be(FileShare.None); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.Write)] [InlineAutoData(FileAccess.Write, FileShare.Read)] public void Open_ShouldUseGivenAccessAndShare(string path, @@ -218,7 +218,7 @@ public void Open_ShouldUseGivenAccessAndShare(string path, FileTestHelper.CheckFileShare(FileSystem, path).Should().Be(share); } - [SkippableTheory] + [Theory] [AutoData] public void Open_ShouldUseNoneShareAsDefault(string path, FileAccess access) @@ -233,7 +233,7 @@ public void Open_ShouldUseNoneShareAsDefault(string path, } #if FEATURE_FILESYSTEM_STREAM_OPTIONS - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.Write)] [InlineAutoData(FileAccess.Write, FileShare.Read)] public void Open_WithFileStreamOptions_ShouldUseGivenAccessAndShare( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTextTests.cs index b0e7b0c6a..66e5d4848 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTextTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class OpenTextTests { - [SkippableTheory] + [Theory] [AutoData] public void OpenText_MissingFile_ShouldThrowFileNotFoundException( string path) @@ -22,7 +22,7 @@ public void OpenText_MissingFile_ShouldThrowFileNotFoundException( hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void OpenText_ShouldReturnFileContent( string path, string contents) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenWriteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenWriteTests.cs index fdabf97ea..c4bfdbe41 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenWriteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenWriteTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class OpenWriteTests { - [SkippableTheory] + [Theory] [AutoData] public void OpenWrite_MissingFile_ShouldCreateFile(string path) { @@ -16,7 +16,7 @@ public void OpenWrite_MissingFile_ShouldCreateFile(string path) FileSystem.Should().HaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void OpenWrite_ShouldUseWriteAccessAndNoneShare(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ReplaceTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ReplaceTests.cs index 353a3635c..ca344cf95 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ReplaceTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ReplaceTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class ReplaceTests { - [SkippableTheory] + [Theory] [AutoData] public void Replace_BackupDirectoryMissing_ShouldThrowCorrectException( string sourceName, @@ -25,7 +25,7 @@ public void Replace_BackupDirectoryMissing_ShouldThrowCorrectException( exception.Should().BeFileOrDirectoryNotFoundException(); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_DestinationDirectoryMissing_ShouldThrowDirectoryNotFoundException( string sourceName, @@ -46,7 +46,7 @@ public void Replace_DestinationDirectoryMissing_ShouldThrowDirectoryNotFoundExce exception.Should().BeFileOrDirectoryNotFoundException(); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_DestinationIsDirectory_ShouldThrowUnauthorizedAccessException( string sourceName, @@ -65,7 +65,7 @@ public void Replace_DestinationIsDirectory_ShouldThrowUnauthorizedAccessExceptio exception.Should().BeException(hResult: -2147024891); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_DestinationMissing_ShouldThrowFileNotFoundException( string sourceName, @@ -84,7 +84,7 @@ public void Replace_DestinationMissing_ShouldThrowFileNotFoundException( FileSystem.Should().NotHaveFile(backupName); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_ReadOnly_WithIgnoreMetadataError_ShouldReplaceFile( string sourceName, @@ -110,7 +110,7 @@ public void Replace_ReadOnly_WithIgnoreMetadataError_ShouldReplaceFile( .Which.HasContent(destinationContents); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_ReadOnly_WithoutIgnoreMetadataError_ShouldThrowUnauthorizedAccessException_OnWindows( @@ -153,7 +153,7 @@ public void } } - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.Hidden, FileAttributes.System)] [InlineAutoData(FileAttributes.System, FileAttributes.Hidden)] public void Replace_ShouldAddArchiveAttribute_OnWindows( @@ -202,7 +202,7 @@ public void Replace_ShouldAddArchiveAttribute_OnWindows( .Should().Be(expectedDestinationAttributes); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_ShouldKeepMetadata( string sourceName, @@ -254,7 +254,7 @@ public void Replace_ShouldKeepMetadata( .Should().Be(destinationLastWriteTime); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_ShouldReplaceFile( string sourceName, @@ -278,7 +278,7 @@ public void Replace_ShouldReplaceFile( .Which.HasContent(destinationContents); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_SourceDirectoryMissing_ShouldThrowFileNotFoundException( string missingDirectory, @@ -297,7 +297,7 @@ public void Replace_SourceDirectoryMissing_ShouldThrowFileNotFoundException( exception.Should().BeFileOrDirectoryNotFoundException(); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_SourceIsDirectory_ShouldThrowUnauthorizedAccessException( string sourceName, @@ -318,7 +318,7 @@ public void Replace_SourceIsDirectory_ShouldThrowUnauthorizedAccessException( exception.Should().BeException(hResult: -2147024891); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.None)] [InlineAutoData(FileAccess.Read, FileShare.Read)] [InlineAutoData(FileAccess.Read, FileShare.ReadWrite)] @@ -378,7 +378,7 @@ public void Replace_SourceLocked_ShouldThrowIOException_OnWindows( } } - [SkippableTheory] + [Theory] [AutoData] public void Replace_SourceMissing_ShouldThrowFileNotFoundException( string sourceName, @@ -401,7 +401,7 @@ public void Replace_SourceMissing_ShouldThrowFileNotFoundException( } } - [SkippableTheory] + [Theory] [AutoData] public void Replace_WhenFileIsReadOnly_ShouldThrowUnauthorizedAccessException_OnWindows( string sourceName, @@ -427,7 +427,7 @@ public void Replace_WhenFileIsReadOnly_ShouldThrowUnauthorizedAccessException_On exception.Should().BeException(hResult: -2147024891); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_WithExistingBackupFile_ShouldIgnoreBackup( string sourceName, @@ -453,7 +453,7 @@ public void Replace_WithExistingBackupFile_ShouldIgnoreBackup( .Which.HasContent(backupContents); } - [SkippableTheory] + [Theory] [AutoData] public void Replace_WithoutBackup_ShouldReplaceFile( string sourceName, diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/Tests.cs index a39c730ee..a35bfe769 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/Tests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void Attributes_WhenFileIsMissing_SetterShouldThrowFileNotFoundException( string path) @@ -21,7 +21,7 @@ public void Attributes_WhenFileIsMissing_SetterShouldThrowFileNotFoundException( exception.Should().BeException(hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void Attributes_WhenFileIsMissing_ShouldReturnMinusOne(string path) { @@ -31,7 +31,7 @@ public void Attributes_WhenFileIsMissing_ShouldReturnMinusOne(string path) sut.Attributes.Should().Be(expected); } - [SkippableFact] + [Fact] public void Directory_ShouldReturnParentDirectory() { IFileSystemDirectoryInitializer initialized = @@ -44,7 +44,7 @@ public void Directory_ShouldReturnParentDirectory() file!.Directory!.FullName.Should().Be(initialized[0].FullName); } - [SkippableFact] + [Fact] public void DirectoryName_ShouldReturnNameOfParentDirectory() { IFileSystemDirectoryInitializer initialized = @@ -57,7 +57,7 @@ public void DirectoryName_ShouldReturnNameOfParentDirectory() file!.DirectoryName.Should().Be(initialized[0].FullName); } - [SkippableTheory] + [Theory] [InlineData("foo", "")] [InlineData("foo.txt", ".txt")] [InlineData("foo.bar.txt", ".txt")] @@ -68,7 +68,7 @@ public void Extension_ShouldReturnExpectedValue(string fileName, string expected sut.Extension.Should().Be(expectedValue); } - [SkippableFact] + [Fact] public void Extension_WithTrailingDot_ShouldReturnExpectedValue() { IFileInfo sut = FileSystem.FileInfo.New("foo."); @@ -83,7 +83,7 @@ public void Extension_WithTrailingDot_ShouldReturnExpectedValue() } } - [SkippableTheory] + [Theory] [AutoData] public void IsReadOnly_MissingFile_ShouldBeTrue(string path) { @@ -92,7 +92,7 @@ public void IsReadOnly_MissingFile_ShouldBeTrue(string path) fileInfo.IsReadOnly.Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void IsReadOnly_SetToFalse_ShouldRemoveReadOnlyAttribute(string path) { @@ -106,7 +106,7 @@ public void IsReadOnly_SetToFalse_ShouldRemoveReadOnlyAttribute(string path) fileInfo.Attributes.Should().Be(FileAttributes.Normal); } - [SkippableTheory] + [Theory] [AutoData] public void IsReadOnly_SetToTrue_ShouldAddReadOnlyAttribute(string path) { @@ -129,7 +129,7 @@ public void IsReadOnly_SetToTrue_ShouldAddReadOnlyAttribute(string path) fileInfo.Attributes.Should().NotHaveFlag(FileAttributes.ReadOnly); } - [SkippableTheory] + [Theory] [AutoData] public void IsReadOnly_ShouldChangeWhenSettingReadOnlyAttribute(string path) { @@ -142,7 +142,7 @@ public void IsReadOnly_ShouldChangeWhenSettingReadOnlyAttribute(string path) fileInfo.Attributes.Should().HaveFlag(FileAttributes.ReadOnly); } - [SkippableTheory] + [Theory] [AutoData] public void IsReadOnly_ShouldInitializeToReadOnlyAttribute(string path) { @@ -153,7 +153,7 @@ public void IsReadOnly_ShouldInitializeToReadOnlyAttribute(string path) fileInfo.Attributes.Should().NotHaveFlag(FileAttributes.ReadOnly); } - [SkippableTheory] + [Theory] [InlineData("/foo")] [InlineData("./foo")] [InlineData("foo")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/ExceptionTests.cs index a18a87f1a..b7fc8056f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/ExceptionTests.cs @@ -7,9 +7,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfoFactory; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] - [MemberData(nameof(GetFileInfoFactoryCallbacks), - parameters: "Illegal\tCharacter?InPath")] + [Theory] + [MemberData(nameof(GetFileInfoFactoryCallbacks), "Illegal\tCharacter?InPath")] public void Operations_WhenValueContainsIllegalPathCharacters_ShouldThrowArgumentException_OnNetFramework( Expression> callback, string paramName, @@ -35,8 +34,8 @@ public void } } - [SkippableTheory] - [MemberData(nameof(GetFileInfoFactoryCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetFileInfoFactoryCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -53,8 +52,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileInfoFactoryCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetFileInfoFactoryCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -70,8 +69,8 @@ public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( $"\n{callback}\n has `null` parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileInfoFactoryCallbacks), parameters: " ")] + [Theory] + [MemberData(nameof(GetFileInfoFactoryCallbacks), " ")] public void Operations_WhenValueIsWhitespace_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/Tests.cs index e746fe8eb..8fe49eae9 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/Tests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfoFactory; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [InlineData(259)] [InlineData(260)] public void New_PathTooLong_ShouldThrowPathTooLongException_OnNetFramework( @@ -28,7 +28,7 @@ public void New_PathTooLong_ShouldThrowPathTooLongException_OnNetFramework( } } - [SkippableTheory] + [Theory] [AutoData] public void New_ShouldCreateNewFileInfoFromPath(string path) { @@ -38,7 +38,7 @@ public void New_ShouldCreateNewFileInfoFromPath(string path) result.Should().NotExist(); } - [SkippableTheory] + [Theory] [AutoData] public void New_ShouldOpenWithExistingContent(string path, string contents) { @@ -51,7 +51,7 @@ public void New_ShouldOpenWithExistingContent(string path, string contents) result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public void New_ShouldSetLength(string path, byte[] bytes) { @@ -68,7 +68,7 @@ public void New_ShouldSetLength(string path, byte[] bytes) result.Should().Be(bytes.Length); } - [SkippableTheory] + [Theory] [AutoData] public void New_WithTrailingDirectorySeparatorChar_ShouldHaveEmptyName(string path) { @@ -78,7 +78,7 @@ public void New_WithTrailingDirectorySeparatorChar_ShouldHaveEmptyName(string pa result.Name.Should().Be(string.Empty); } - [SkippableFact] + [Fact] public void New_WithUnicodeWhitespace_ShouldNotThrow() { Exception? exception = Record.Exception(() => @@ -96,7 +96,7 @@ public void New_WithUnicodeWhitespace_ShouldNotThrow() } } - [SkippableFact] + [Fact] public void New_WithWhitespace_ShouldThrowOnlyOnWindows() { Exception? exception = Record.Exception(() => @@ -114,7 +114,7 @@ public void New_WithWhitespace_ShouldThrowOnlyOnWindows() } } - [SkippableFact] + [Fact] public void Wrap_Null_ShouldReturnNull() { Skip.If(FileSystem is MockFileSystem mockFileSystem && @@ -125,7 +125,7 @@ public void Wrap_Null_ShouldReturnNull() result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Wrap_ShouldWrapFromFileInfo(string path) { @@ -140,7 +140,7 @@ public void Wrap_ShouldWrapFromFileInfo(string path) result.Exists.Should().Be(fileInfo.Exists); } - [SkippableTheory] + [Theory] [AutoData] public void Wrap_WithSimulatedMockFileSystem_ShouldThrowNotSupportedException(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs index 6f738d062..297ba45a8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; [FileSystemTests] public partial class AdjustTimesTests { - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_ShouldAdjustTimes(string path, byte[] bytes) { @@ -51,7 +51,7 @@ public void CopyTo_ShouldAdjustTimes(string path, byte[] bytes) } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void Read_AsSpan_ShouldAdjustTimes(string path, byte[] bytes) { @@ -90,7 +90,7 @@ public void Read_AsSpan_ShouldAdjustTimes(string path, byte[] bytes) } #endif - [SkippableTheory] + [Theory] [AutoData] public void Read_ShouldAdjustTimes(string path, byte[] bytes) { @@ -131,7 +131,7 @@ public void Read_ShouldAdjustTimes(string path, byte[] bytes) } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAsync_AsMemory_ShouldAdjustTimes(string path, byte[] bytes) { @@ -171,7 +171,7 @@ public async Task ReadAsync_AsMemory_ShouldAdjustTimes(string path, byte[] bytes #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAsync_ShouldAdjustTimes(string path, byte[] bytes) { @@ -214,7 +214,7 @@ public async Task ReadAsync_ShouldAdjustTimes(string path, byte[] bytes) } #endif - [SkippableTheory] + [Theory] [AutoData] public void ReadByte_ShouldAdjustTimes(string path, byte[] bytes) { @@ -253,7 +253,7 @@ public void ReadByte_ShouldAdjustTimes(string path, byte[] bytes) .BeBetween(creationTimeStart, creationTimeEnd); } - [SkippableTheory] + [Theory] [AutoData] public void Seek_ShouldNotAdjustTimes(string path, byte[] bytes) { @@ -286,7 +286,7 @@ public void Seek_ShouldNotAdjustTimes(string path, byte[] bytes) } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void Write_AsSpan_ShouldAdjustTimes(string path, byte[] bytes) { @@ -326,7 +326,7 @@ public void Write_AsSpan_ShouldAdjustTimes(string path, byte[] bytes) } #endif - [SkippableTheory] + [Theory] [AutoData] public void Write_ShouldAdjustTimes(string path, byte[] bytes) { @@ -368,7 +368,7 @@ public void Write_ShouldAdjustTimes(string path, byte[] bytes) } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAsync_AsMemory_ShouldAdjustTimes(string path, byte[] bytes) { @@ -409,7 +409,7 @@ public async Task WriteAsync_AsMemory_ShouldAdjustTimes(string path, byte[] byte #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAsync_ShouldAdjustTimes(string path, byte[] bytes) { @@ -453,7 +453,7 @@ public async Task WriteAsync_ShouldAdjustTimes(string path, byte[] bytes) } #endif - [SkippableTheory] + [Theory] [AutoData] public void WriteByte_ShouldAdjustTimes(string path, byte[] bytes, byte singleByte) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs index e907f8dad..516246575 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; [FileSystemTests] public partial class CopyToTests { - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_BufferSizeZero_ShouldThrowArgumentOutOfRangeException( string path, byte[] bytes) @@ -27,7 +27,7 @@ public void CopyTo_BufferSizeZero_ShouldThrowArgumentOutOfRangeException( paramName: "bufferSize"); } - [SkippableTheory] + [Theory] [AutoData] public void CopyTo_ShouldCopyBytes( string path, byte[] bytes) @@ -44,7 +44,7 @@ public void CopyTo_ShouldCopyBytes( } #if FEATURE_FILESYSTEM_ASYNC - [SkippableTheory] + [Theory] [AutoData] public async Task CopyToAsync_BufferSizeZero_ShouldThrowArgumentOutOfRangeException( string path, byte[] bytes) @@ -52,12 +52,14 @@ public async Task CopyToAsync_BufferSizeZero_ShouldThrowArgumentOutOfRangeExcept byte[] buffer = new byte[bytes.Length]; await FileSystem.File.WriteAllBytesAsync(path, bytes); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await using FileSystemStream stream = FileSystem.File.OpenRead(path); using MemoryStream destination = new(buffer); await stream.CopyToAsync(destination, 0); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException( paramName: "bufferSize"); @@ -65,7 +67,7 @@ public async Task CopyToAsync_BufferSizeZero_ShouldThrowArgumentOutOfRangeExcept #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableTheory] + [Theory] [AutoData] public async Task CopyToAsync_ShouldCopyBytes( string path, byte[] bytes) @@ -94,10 +96,12 @@ public async Task CopyToAsync_WhenBufferSizeIsNotPositive_ShouldThrowArgumentNul await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenRead(); await using FileSystemStream destination = FileSystem.FileInfo.New("bar.txt").OpenWrite(); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await source.CopyToAsync(destination, bufferSize); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeOfType(); } @@ -112,10 +116,12 @@ public async Task CopyToAsync_WhenDestinationIsClosed_ShouldThrowObjectDisposedE using MemoryStream destination = new(); destination.Close(); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await source.CopyToAsync(destination); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeOfType() .Which.Message.Should().Match("Cannot access a*"); @@ -129,10 +135,12 @@ public async Task CopyToAsync_WhenDestinationIsNull_ShouldThrowArgumentNullExcep await FileSystem.File.WriteAllTextAsync("foo.txt", ""); await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenRead(); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await source.CopyToAsync(null!); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeOfType() .Which.Message.Should().Match("*cannot be null*"); @@ -148,10 +156,12 @@ public async Task CopyToAsync_WhenDestinationIsReadOnly_ShouldThrowNotSupportedE await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenRead(); await using FileSystemStream destination = FileSystem.FileInfo.New("bar.txt").OpenRead(); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await source.CopyToAsync(destination); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeOfType() .Which.Message.Should().Match("Stream does not support writing*"); @@ -168,10 +178,12 @@ public async Task CopyToAsync_WhenSourceIsClosed_ShouldThrowObjectDisposedExcept await using FileSystemStream destination = FileSystem.FileInfo.New("bar.txt").OpenWrite(); source.Close(); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await source.CopyToAsync(destination); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeOfType() .Which.Message.Should().Match("Cannot access a*"); @@ -187,10 +199,12 @@ public async Task CopyToAsync_WhenSourceIsWriteOnly_ShouldThrowNotSupportedExcep await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenWrite(); await using FileSystemStream destination = FileSystem.FileInfo.New("bar.txt").OpenWrite(); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { await source.CopyToAsync(destination); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeOfType() .Which.Message.Should().Match("Stream does not support reading*"); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs index 9149af33b..35550440e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; [FileSystemTests] public partial class DisposeTests { - [SkippableTheory] + [Theory] [AutoData] public void Dispose_CalledTwiceShouldDoNothing( string path, byte[] bytes) @@ -29,7 +29,7 @@ public void Dispose_CalledTwiceShouldDoNothing( FileSystem.Should().HaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void Dispose_ShouldNotResurrectFile(string path, string contents) { @@ -50,7 +50,7 @@ public void Dispose_ShouldNotResurrectFile(string path, string contents) fileCount3.Should().Be(0, "Dispose should not have resurrected the file"); } - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileStreamCallbacks))] public void Operations_ShouldThrowAfterStreamIsDisposed( Expression> callback) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs index 8a117c5b7..ac829c950 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; [FileSystemTests] public partial class FileAccessTests { - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.Read, FileAccess.ReadWrite, FileShare.Read)] [InlineAutoData(FileAccess.ReadWrite, FileShare.Read, @@ -50,7 +50,7 @@ public void FileAccess_ConcurrentAccessWithInvalidScenarios_ShouldThrowIOExcepti } } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read, FileShare.Read, FileAccess.Read, FileShare.Read)] [InlineAutoData(FileAccess.Read, FileShare.ReadWrite, FileAccess.ReadWrite, FileShare.Read)] @@ -75,7 +75,7 @@ public void FileAccess_ConcurrentReadAccessWithValidScenarios_ShouldNotThrowExce result2.Should().Be(contents); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Write, FileShare.Write, FileAccess.Write, FileShare.Write)] [InlineAutoData(FileAccess.ReadWrite, FileShare.ReadWrite, FileAccess.ReadWrite, FileShare.ReadWrite)] @@ -106,7 +106,7 @@ public void result.Should().Be(contents2); } - [SkippableTheory] + [Theory] [AutoData] public void FileAccess_ReadAfterFirstAppend_ShouldContainBothContents( string path, string contents1, string contents2) @@ -132,7 +132,7 @@ public void FileAccess_ReadAfterFirstAppend_ShouldContainBothContents( result.Should().Be(contents1 + contents2); } - [SkippableTheory] + [Theory] [AutoData] public void FileAccess_ReadBeforeFirstAppend_ShouldOnlyContainSecondContent( string path, string contents1, string contents2) @@ -158,7 +158,7 @@ public void FileAccess_ReadBeforeFirstAppend_ShouldOnlyContainSecondContent( result.Should().Be(contents2); } - [SkippableTheory] + [Theory] [AutoData] public void FileAccess_ReadWhileWriteLockActive_ShouldThrowIOException( string path, string contents) @@ -185,7 +185,7 @@ public void FileAccess_ReadWhileWriteLockActive_ShouldThrowIOException( } } - [SkippableTheory] + [Theory] [AutoData] public async Task MultipleParallelReads_ShouldBeAllowed(string path, string contents) { @@ -209,7 +209,7 @@ public async Task MultipleParallelReads_ShouldBeAllowed(string path, string cont results.Should().AllBeEquivalentTo(contents); } - [SkippableTheory] + [Theory] [AutoData] public void Read_ShouldCreateValidFileStream(string path, string contents) { @@ -221,7 +221,7 @@ public void Read_ShouldCreateValidFileStream(string path, string contents) result.Should().Be(contents); } - [SkippableTheory] + [Theory] [AutoData] public void Write_ShouldCreateValidFileStream(string path, string contents) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/OptionsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/OptionsTests.cs index 848fc6965..180c157c9 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/OptionsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/OptionsTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; [FileSystemTests] public partial class OptionsTests { - [SkippableTheory] + [Theory] [AutoData] public void Options_DeleteOnClose_ShouldDeleteFileOnClose( string path, string contents) @@ -22,7 +22,7 @@ public void Options_DeleteOnClose_ShouldDeleteFileOnClose( FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] public void Options_DeleteOnClose_ShouldDeleteFileOnDispose( string path, string contents) @@ -38,7 +38,7 @@ public void Options_DeleteOnClose_ShouldDeleteFileOnDispose( FileSystem.Should().NotHaveFile(path); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Options_Encrypt_ShouldKeepEncryptionFlag( @@ -63,7 +63,7 @@ public void Options_Encrypt_ShouldKeepEncryptionFlag( .And.HasAttribute(FileAttributes.Encrypted); } - [SkippableTheory] + [Theory] [AutoData] public void Options_Encrypt_Unencrypted_ShouldBeIgnored( string path, string contents1, string contents2) @@ -82,7 +82,7 @@ public void Options_Encrypt_Unencrypted_ShouldBeIgnored( FileSystem.File.ReadAllText(path).Should().Be(contents2); } - [SkippableTheory] + [Theory] [AutoData] [SupportedOSPlatform("windows")] public void Options_EncryptedWithoutEncryptionOption_ShouldKeepEncryptionFlag( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs index 9a2ddfabc..c2a3e2c6a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs @@ -12,7 +12,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; [FileSystemTests] public partial class ReadTests { - [SkippableTheory] + [Theory] [AutoData] public void BeginRead_CanReadFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -32,7 +32,7 @@ public void BeginRead_CanReadFalse_ShouldThrowNotSupportedException( exception.Should().BeException(hResult: -2146233067); } - [SkippableTheory] + [Theory] [AutoData] public void BeginRead_ShouldCopyContentsToBuffer( string path, byte[] bytes) @@ -61,7 +61,7 @@ public void BeginRead_ShouldCopyContentsToBuffer( buffer.Should().BeEquivalentTo(bytes); } - [SkippableTheory] + [Theory] [AutoData] public void EndRead_Null_ShouldThrowArgumentNullException( string path, byte[] bytes) @@ -78,7 +78,7 @@ public void EndRead_Null_ShouldThrowArgumentNullException( exception.Should().BeException(hResult: -2147467261); } - [SkippableTheory] + [Theory] [AutoData] public void EndRead_ShouldNotAdjustTimes(string path, byte[] bytes) { @@ -124,7 +124,7 @@ public void EndRead_ShouldNotAdjustTimes(string path, byte[] bytes) } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void Read_AsSpan_CanReadFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -147,7 +147,7 @@ public void Read_AsSpan_CanReadFalse_ShouldThrowNotSupportedException( #endif #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void Read_AsSpan_ShouldFillBuffer(string path, byte[] bytes) { @@ -163,7 +163,7 @@ public void Read_AsSpan_ShouldFillBuffer(string path, byte[] bytes) #endif #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void Read_AsSpan_ShouldUseSharedBuffer(string path) { @@ -190,7 +190,7 @@ public void Read_AsSpan_ShouldUseSharedBuffer(string path) } #endif - [SkippableTheory] + [Theory] [AutoData] public void Read_CanReadFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -211,7 +211,7 @@ public void Read_CanReadFalse_ShouldThrowNotSupportedException( exception.Should().BeException(hResult: -2146233067); } - [SkippableTheory] + [Theory] [AutoData] public void Read_ShouldFillBuffer(string path, byte[] bytes) { @@ -226,7 +226,7 @@ public void Read_ShouldFillBuffer(string path, byte[] bytes) } #if FEATURE_FILESYSTEM_ASYNC - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAsync_CanReadFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -238,13 +238,15 @@ public async Task ReadAsync_CanReadFalse_ShouldThrowNotSupportedException( await using (FileSystemStream stream = FileSystem.File.OpenWrite(path)) { - exception = await Record.ExceptionAsync(async () => + async Task Act() { // ReSharper disable once AccessToDisposedClosure #pragma warning disable CA1835 _ = await stream.ReadAsync(buffer, 0, bytes.Length, cts.Token); #pragma warning restore CA1835 - }); + } + + exception = await Record.ExceptionAsync(Act); } exception.Should().BeException(hResult: -2146233067); @@ -252,7 +254,7 @@ public async Task ReadAsync_CanReadFalse_ShouldThrowNotSupportedException( #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAsync_Memory_CanReadFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -264,13 +266,15 @@ public async Task ReadAsync_Memory_CanReadFalse_ShouldThrowNotSupportedException await using (FileSystemStream stream = FileSystem.File.OpenWrite(path)) { - exception = await Record.ExceptionAsync(async () => + async Task Act() { // ReSharper disable once AccessToDisposedClosure #pragma warning disable CA1835 _ = await stream.ReadAsync(buffer.AsMemory(), cts.Token); #pragma warning restore CA1835 - }); + } + + exception = await Record.ExceptionAsync(Act); } exception.Should().BeException(hResult: -2146233067); @@ -278,7 +282,7 @@ public async Task ReadAsync_Memory_CanReadFalse_ShouldThrowNotSupportedException #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableTheory] + [Theory] [AutoData] public async Task ReadAsync_ShouldFillBuffer(string path, byte[] bytes) { @@ -296,7 +300,7 @@ public async Task ReadAsync_ShouldFillBuffer(string path, byte[] bytes) } #endif - [SkippableTheory] + [Theory] [AutoData] public void ReadByte_CanReadFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -316,7 +320,7 @@ public void ReadByte_CanReadFalse_ShouldThrowNotSupportedException( exception.Should().BeException(hResult: -2146233067); } - [SkippableTheory] + [Theory] [AutoData] public void ReadByte_ShouldReadSingleByteAndAdvancePosition( string path, byte[] bytes) @@ -333,7 +337,7 @@ public void ReadByte_ShouldReadSingleByteAndAdvancePosition( result2.Should().Be(bytes[1]); } - [SkippableTheory] + [Theory] [AutoData] public void ReadTimeout_ShouldThrowInvalidOperationException( string path, string contents) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs index e3f629eb1..68094f7ee 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs @@ -11,7 +11,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void CanSeek_ShouldReturnTrue( string path, string contents) @@ -23,7 +23,7 @@ public void CanSeek_ShouldReturnTrue( stream.CanSeek.Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void CanTimeout_ShouldReturnFalse( string path, string contents) @@ -35,7 +35,7 @@ public void CanTimeout_ShouldReturnFalse( stream.CanTimeout.Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void Close_CalledMultipleTimes_ShouldNotThrow( string path, string contents) @@ -53,7 +53,7 @@ public void Close_CalledMultipleTimes_ShouldNotThrow( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Extensibility_ShouldWrapFileStreamOnRealFileSystem( string path) @@ -76,7 +76,7 @@ public void Extensibility_ShouldWrapFileStreamOnRealFileSystem( } } - [SkippableTheory] + [Theory] [AutoData] public void Flush_ShouldNotChangePosition( string path, byte[] bytes) @@ -91,7 +91,7 @@ public void Flush_ShouldNotChangePosition( stream.Position.Should().Be(2); } - [SkippableTheory] + [Theory] [AutoData] public void Flush_ShouldNotUpdateFileContentWhenAlreadyFlushed( string path, byte[] bytes1, byte[] bytes2) @@ -119,7 +119,7 @@ public void Flush_ShouldNotUpdateFileContentWhenAlreadyFlushed( .Which.HasContent(bytes2); } - [SkippableTheory] + [Theory] [InlineAutoData(false)] [InlineAutoData(true)] public void Flush_WriteToDisk_ShouldNotChangePosition( @@ -135,7 +135,7 @@ public void Flush_WriteToDisk_ShouldNotChangePosition( stream.Position.Should().Be(2); } - [SkippableTheory] + [Theory] [AutoData] public async Task FlushAsync_Cancelled_ShouldThrowTaskCanceledException( string path) @@ -143,17 +143,19 @@ public async Task FlushAsync_Cancelled_ShouldThrowTaskCanceledException( using CancellationTokenSource cts = new(); await cts.CancelAsync(); - Exception? exception = await Record.ExceptionAsync(async () => + async Task Act() { // ReSharper disable once UseAwaitUsing using FileSystemStream stream = FileSystem.File.Create(path); await stream.FlushAsync(cts.Token); - }); + } + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2146233029); } - [SkippableTheory] + [Theory] [AutoData] public async Task FlushAsync_ShouldNotChangePosition( string path, byte[] bytes) @@ -169,7 +171,7 @@ public async Task FlushAsync_ShouldNotChangePosition( stream.Position.Should().Be(2); } - [SkippableTheory] + [Theory] [AutoData] public void Name_ShouldReturnFullPath(string path) { @@ -179,7 +181,7 @@ public void Name_ShouldReturnFullPath(string path) stream.Name.Should().Be(expectedName); } - [SkippableTheory] + [Theory] [AutoData] public void Position_ShouldChangeWhenReading( string path, string contents) @@ -194,7 +196,7 @@ public void Position_ShouldChangeWhenReading( } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void Position_ShouldNotChangeSharedBufferStreamsWhenWriting( string path, string contents, string changedContents) @@ -223,7 +225,7 @@ public void Position_ShouldNotChangeSharedBufferStreamsWhenWriting( } #endif - [SkippableTheory] + [Theory] [AutoData] public void Seek_Begin_ShouldSetAbsolutePositionFromBegin( string path, string contents) @@ -237,7 +239,7 @@ public void Seek_Begin_ShouldSetAbsolutePositionFromBegin( stream.Position.Should().Be(4); } - [SkippableTheory] + [Theory] [AutoData] public void Seek_Current_ShouldSetRelativePosition(string path, string contents) { @@ -254,7 +256,7 @@ public void Seek_Current_ShouldSetRelativePosition(string path, string contents) stream.Position.Should().Be(6); } - [SkippableTheory] + [Theory] [AutoData] public void Seek_End_ShouldSetAbsolutePositionFromEnd(string path, string contents) { @@ -267,7 +269,7 @@ public void Seek_End_ShouldSetAbsolutePositionFromEnd(string path, string conten stream.Position.Should().Be(contents.Length - 4); } - [SkippableTheory] + [Theory] [AutoData] public void SetLength(string path, int length) { @@ -278,7 +280,7 @@ public void SetLength(string path, int length) stream.Length.Should().Be(length); } - [SkippableTheory] + [Theory] [AutoData] public void SetLength_ReadOnlyStream_ShouldThrowNotSupportedException( string path, int length) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs index e34c8f1e7..aeedac928 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs @@ -9,7 +9,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; [FileSystemTests] public partial class WriteTests { - [SkippableTheory] + [Theory] [AutoData] public void BeginWrite_CanWriteFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -29,7 +29,7 @@ public void BeginWrite_CanWriteFalse_ShouldThrowNotSupportedException( exception.Should().BeException(hResult: -2146233067); } - [SkippableTheory] + [Theory] [AutoData] public void BeginWrite_ShouldCopyContentsToFile( string path, byte[] bytes) @@ -61,7 +61,7 @@ public void BeginWrite_ShouldCopyContentsToFile( .Which.HasContent(bytes); } - [SkippableTheory] + [Theory] [AutoData] public void EndWrite_Null_ShouldThrowArgumentNullException(string path) { @@ -76,7 +76,7 @@ public void EndWrite_Null_ShouldThrowArgumentNullException(string path) exception.Should().BeException(hResult: -2147467261); } - [SkippableTheory] + [Theory] [AutoData] public void EndWrite_ShouldAdjustTimes(string path, byte[] bytes) { @@ -130,7 +130,7 @@ public void EndWrite_ShouldAdjustTimes(string path, byte[] bytes) } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void Write_AsSpan_CanWriteFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -153,7 +153,7 @@ public void Write_AsSpan_CanWriteFalse_ShouldThrowNotSupportedException( #endif #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void Write_AsSpan_ShouldFillBuffer(string path, byte[] bytes) { @@ -167,7 +167,7 @@ public void Write_AsSpan_ShouldFillBuffer(string path, byte[] bytes) } #endif - [SkippableTheory] + [Theory] [AutoData] public void Write_CanWriteFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -188,7 +188,7 @@ public void Write_CanWriteFalse_ShouldThrowNotSupportedException( exception.Should().BeException(hResult: -2146233067); } - [SkippableTheory] + [Theory] [AutoData] public void Write_ShouldFillBuffer(string path, byte[] bytes) { @@ -202,7 +202,7 @@ public void Write_ShouldFillBuffer(string path, byte[] bytes) } #if FEATURE_FILESYSTEM_ASYNC - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAsync_CanWriteFalse_ShouldThrowNotSupportedException( string path, byte[] bytes) @@ -214,13 +214,15 @@ public async Task WriteAsync_CanWriteFalse_ShouldThrowNotSupportedException( await using (FileSystemStream stream = FileSystem.File.OpenRead(path)) { - exception = await Record.ExceptionAsync(async () => + async Task Act() { // ReSharper disable once AccessToDisposedClosure #pragma warning disable CA1835 await stream.WriteAsync(buffer, 0, bytes.Length, cts.Token); #pragma warning restore CA1835 - }); + } + + exception = await Record.ExceptionAsync(Act); } exception.Should().BeException( @@ -229,7 +231,7 @@ public async Task WriteAsync_CanWriteFalse_ShouldThrowNotSupportedException( #endif #if FEATURE_FILESYSTEM_ASYNC - [SkippableTheory] + [Theory] [AutoData] public async Task WriteAsync_ShouldFillBuffer(string path, byte[] bytes) { @@ -247,7 +249,7 @@ public async Task WriteAsync_ShouldFillBuffer(string path, byte[] bytes) } #endif - [SkippableTheory] + [Theory] [AutoData] public void WriteByte_HiddenFile_ShouldNotThrow( string path, byte[] bytes) @@ -268,7 +270,7 @@ public void WriteByte_HiddenFile_ShouldNotThrow( exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void WriteByte_ShouldWriteSingleByteAndAdvancePosition( string path, byte byte1, byte byte2) @@ -285,7 +287,7 @@ public void WriteByte_ShouldWriteSingleByteAndAdvancePosition( .Which.HasContent([byte1, byte2]); } - [SkippableTheory] + [Theory] [AutoData] public void WriteTimeout_ShouldThrowInvalidOperationException( string path, string contents) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/ExceptionTests.cs index bfe30a2b1..bc26d7a06 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/ExceptionTests.cs @@ -8,9 +8,9 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStreamFactory; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] + [Theory] [MemberData(nameof(GetFileStreamFactoryCallbacks), - parameters: "Illegal\tCharacter?InPath")] + "Illegal\tCharacter?InPath")] public void Operations_WhenValueContainsIllegalPathCharacters_ShouldThrowCorrectException_OnWindows( Expression> callback, string paramName, @@ -48,8 +48,8 @@ public void } } - [SkippableTheory] - [MemberData(nameof(GetFileStreamFactoryCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetFileStreamFactoryCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -66,8 +66,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileStreamFactoryCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetFileStreamFactoryCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -83,8 +83,8 @@ public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( $"\n{callback}\n has `null` parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileStreamFactoryCallbacks), parameters: " ")] + [Theory] + [MemberData(nameof(GetFileStreamFactoryCallbacks), " ")] public void Operations_WhenValueIsWhitespace_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/SafeFileHandleTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/SafeFileHandleTests.cs index d1b5fb613..a443eb851 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/SafeFileHandleTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/SafeFileHandleTests.cs @@ -9,7 +9,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStreamFactory; [FileSystemTests] public partial class SafeFileHandleTests { - [SkippableTheory] + [Theory] [AutoData] public void New_SafeFileHandle_InvalidHandle_ShouldThrowArgumentException( string filename) @@ -27,7 +27,7 @@ public void New_SafeFileHandle_InvalidHandle_ShouldThrowArgumentException( paramName: "handle"); } - [SkippableTheory] + [Theory] [AutoData] public void New_SafeFileHandle_InvalidHandle_WithBufferSize_ShouldThrowArgumentException( string filename) @@ -45,7 +45,7 @@ public void New_SafeFileHandle_InvalidHandle_WithBufferSize_ShouldThrowArgumentE paramName: "handle"); } - [SkippableTheory] + [Theory] [AutoData] public void New_SafeFileHandle_InvalidHandle_WithBufferSizeAndAsync_ShouldThrowArgumentException( @@ -64,7 +64,7 @@ public void paramName: "handle"); } - [SkippableTheory] + [Theory] [AutoData] public void New_SafeFileHandle_Valid_ShouldCreateWritableStream( string filename, string contents) @@ -98,7 +98,7 @@ public void New_SafeFileHandle_Valid_ShouldCreateWritableStream( } } - [SkippableTheory] + [Theory] [AutoData] public void New_SafeFileHandle_Valid_WithBufferSize_ShouldCreateWritableStream( string filename, string contents) @@ -133,7 +133,7 @@ public void New_SafeFileHandle_Valid_WithBufferSize_ShouldCreateWritableStream( } } - [SkippableTheory] + [Theory] [AutoData] public void New_SafeFileHandle_Valid_WithBufferSizeAndAsync_ShouldCreateWritableStream( diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/Tests.cs index d00a6ece4..c5f94206a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/Tests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStreamFactory; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void New_AppendAccessWithReadWriteMode_ShouldThrowArgumentException( string path) @@ -21,7 +21,7 @@ public void New_AppendAccessWithReadWriteMode_ShouldThrowArgumentException( paramName: Test.IsNetFramework ? null : "access"); } - [SkippableTheory] + [Theory] [AutoData] public void New_ExistingFileWithCreateMode_ShouldIgnoreContent( string path) @@ -33,7 +33,7 @@ public void New_ExistingFileWithCreateMode_ShouldIgnoreContent( FileSystem.File.ReadAllText(path).Should().BeEmpty(); } - [SkippableTheory] + [Theory] [AutoData] public void New_ExistingFileWithCreateNewMode_ShouldThrowIOException( string path) @@ -49,7 +49,7 @@ public void New_ExistingFileWithCreateNewMode_ShouldThrowIOException( hResult: Test.RunsOnWindows ? -2147024816 : 17); } - [SkippableTheory] + [Theory] [AutoData] public void New_ExistingFileWithTruncateMode_ShouldIgnoreContent( string path) @@ -61,7 +61,7 @@ public void New_ExistingFileWithTruncateMode_ShouldIgnoreContent( FileSystem.File.ReadAllText(path).Should().BeEmpty(); } - [SkippableTheory] + [Theory] [InlineAutoData(FileMode.Append)] [InlineAutoData(FileMode.Truncate)] [InlineAutoData(FileMode.Create)] @@ -84,7 +84,7 @@ public void New_InvalidModeForReadAccess_ShouldThrowArgumentException( .Contain(access.ToString()); } - [SkippableTheory] + [Theory] [InlineAutoData(FileMode.Open)] [InlineAutoData(FileMode.Truncate)] public void New_MissingFileWithIncorrectMode_ShouldThrowFileNotFoundException( @@ -100,7 +100,7 @@ public void New_MissingFileWithIncorrectMode_ShouldThrowFileNotFoundException( hResult: -2147024894); } - [SkippableTheory] + [Theory] [AutoData] public void New_MissingFileWithTruncateMode_ShouldThrowFileNotFoundException( string path) @@ -115,7 +115,7 @@ public void New_MissingFileWithTruncateMode_ShouldThrowFileNotFoundException( hResult: -2147024894); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAccess.Read)] [InlineAutoData(FileAccess.ReadWrite)] [InlineAutoData(FileAccess.Write)] @@ -141,7 +141,7 @@ public void } } - [SkippableTheory] + [Theory] [AutoData] public void New_SamePathAsExistingDirectory_ShouldThrowCorrectException( string path) @@ -166,7 +166,7 @@ public void New_SamePathAsExistingDirectory_ShouldThrowCorrectException( } } - [SkippableTheory] + [Theory] [InlineAutoData(false)] [InlineAutoData(true)] public void New_WithUseAsyncSet_ShouldSetProperty(bool useAsync, string path) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/CreateAsSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/CreateAsSymbolicLinkTests.cs index f113fbcb8..8235e17b1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/CreateAsSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/CreateAsSymbolicLinkTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemInfo; [FileSystemTests] public partial class CreateAsSymbolicLinkTests { - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_ShouldCreateSymbolicLink( string path, string pathToTarget) @@ -21,7 +21,7 @@ public void CreateAsSymbolicLink_ShouldCreateSymbolicLink( .Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void CreateAsSymbolicLink_SourceFileAlreadyExists_ShouldThrowIOException( string path, string pathToTarget) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ExceptionTests.cs index d71d8887f..8a9f573c5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ExceptionTests.cs @@ -8,8 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemInfo; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] - [MemberData(nameof(GetFileSystemInfoCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetFileSystemInfoCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -26,8 +26,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileSystemInfoCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetFileSystemInfoCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ResolveLinkTargetTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ResolveLinkTargetTests.cs index c2583516c..f0a85da4e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ResolveLinkTargetTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ResolveLinkTargetTests.cs @@ -18,7 +18,7 @@ public partial class ResolveLinkTargetTests #endregion - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FileWithDifferentCase_ShouldReturnPathToMissingFile( string path, string pathToTarget, string contents) @@ -44,7 +44,7 @@ public void ResolveLinkTarget_FileWithDifferentCase_ShouldReturnPathToMissingFil } } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FinalTarget_ShouldFollowSymbolicLinkToFinalTarget( string path, string pathToFinalTarget) @@ -68,7 +68,7 @@ public void ResolveLinkTarget_FinalTarget_ShouldFollowSymbolicLinkToFinalTarget( target!.FullName.Should().Be(FileSystem.Path.GetFullPath(pathToFinalTarget)); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_FinalTargetWithTooManyLevels_ShouldThrowIOException( string path, string pathToFinalTarget) @@ -96,7 +96,7 @@ public void ResolveLinkTarget_FinalTargetWithTooManyLevels_ShouldThrowIOExceptio messageContains: $"'{fileInfo.FullName}'"); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_MissingFileInLinkChain_ShouldReturnPathToMissingFile( string path, string pathToFinalTarget, string pathToMissingFile) @@ -113,7 +113,7 @@ public void ResolveLinkTarget_MissingFileInLinkChain_ShouldReturnPathToMissingFi target!.FullName.Should().Be(FileSystem.Path.GetFullPath(pathToMissingFile)); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_NormalDirectory_ShouldReturnNull( string path) @@ -126,7 +126,7 @@ public void ResolveLinkTarget_NormalDirectory_ShouldReturnNull( target.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_NormalFile_ShouldReturnNull( string path) @@ -139,7 +139,7 @@ public void ResolveLinkTarget_NormalFile_ShouldReturnNull( target.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_ShouldFollowSymbolicLink( string path, string pathToTarget) @@ -155,7 +155,7 @@ public void ResolveLinkTarget_ShouldFollowSymbolicLink( target.Should().Exist(); } - [SkippableTheory] + [Theory] [AutoData] public void ResolveLinkTarget_TargetDeletedAfterLinkCreation_ShouldReturnNull( string path, string pathToTarget) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/Tests.cs index 01105689b..81b3d5218 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/Tests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemInfo; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void Extensibility_ShouldWrapFileSystemInfoOnRealFileSystem( string path) @@ -32,7 +32,7 @@ public void Extensibility_ShouldWrapFileSystemInfoOnRealFileSystem( } #if FEATURE_FILESYSTEM_LINK - [SkippableTheory] + [Theory] [AutoData] public void LinkTarget_ShouldBeSetByCreateAsSymbolicLink( string path, string pathToTarget) @@ -47,7 +47,7 @@ public void LinkTarget_ShouldBeSetByCreateAsSymbolicLink( } #endif - [SkippableTheory] + [Theory] [AutoData] public void SetAttributes_Hidden_OnFileStartingWithDot_ShouldBeSet(string path) { @@ -64,7 +64,7 @@ public void SetAttributes_Hidden_OnFileStartingWithDot_ShouldBeSet(string path) result2.Should().Be(FileAttributes.Hidden); } - [SkippableTheory] + [Theory] [AutoData] public void SetAttributes_Hidden_OnNormalFile_ShouldBeIgnored(string path) { @@ -80,7 +80,7 @@ public void SetAttributes_Hidden_OnNormalFile_ShouldBeIgnored(string path) result2.Should().Be(FileAttributes.Normal); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.Compressed)] [InlineAutoData(FileAttributes.Device)] [InlineAutoData(FileAttributes.Encrypted)] @@ -98,7 +98,7 @@ public void SetAttributes_ShouldBeIgnoredOnAllPlatforms(FileAttributes attribute result.Should().Be(FileAttributes.Normal); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.Hidden)] public void SetAttributes_ShouldBeIgnoredOnLinux(FileAttributes attributes, string path) @@ -118,7 +118,7 @@ public void SetAttributes_ShouldBeIgnoredOnLinux(FileAttributes attributes, } } - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.ReadOnly)] public void SetAttributes_ShouldBeSupportedOnAllPlatforms( FileAttributes attributes, @@ -132,7 +132,7 @@ public void SetAttributes_ShouldBeSupportedOnAllPlatforms( result.Should().Be(attributes); } - [SkippableTheory] + [Theory] [InlineAutoData(FileAttributes.Archive)] [InlineAutoData(FileAttributes.NoScrubData)] [InlineAutoData(FileAttributes.NotContentIndexed)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/UnixFileModeTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/UnixFileModeTests.cs index dee2b29e2..39d6970dd 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/UnixFileModeTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/UnixFileModeTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemInfo; [FileSystemTests] public partial class UnixFileModeTests { - [SkippableTheory] + [Theory] [AutoData] public void UnixFileMode_MissingFile_ShouldBeInitializedToMinusOne( string path) @@ -17,7 +17,7 @@ public void UnixFileMode_MissingFile_ShouldBeInitializedToMinusOne( fileSystemInfo.UnixFileMode.Should().Be(expected); } - [SkippableTheory] + [Theory] [AutoData] public void UnixFileMode_SetterShouldThrowPlatformNotSupportedException_OnWindows( string path, UnixFileMode unixFileMode) @@ -36,7 +36,7 @@ public void UnixFileMode_SetterShouldThrowPlatformNotSupportedException_OnWindow exception.Should().BeException(hResult: -2146233031); } - [SkippableTheory] + [Theory] [AutoData] public void UnixFileMode_ShouldBeInitializedCorrectly( string path) @@ -53,7 +53,7 @@ public void UnixFileMode_ShouldBeInitializedCorrectly( fileSystemInfo.UnixFileMode.Should().Be(expected); } - [SkippableTheory] + [Theory] [AutoData] public void UnixFileMode_ShouldBeSettableOnLinux( string path, UnixFileMode unixFileMode) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.Extensibility.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.Extensibility.cs index e27468ac1..26397cee9 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.Extensibility.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.Extensibility.cs @@ -4,7 +4,7 @@ namespace Testably.Abstractions.Tests.FileSystem; public partial class FileSystemTests { - [SkippableTheory] + [Theory] [AutoData] public void Extensibility_HasWrappedInstance_WithCorrectType_ShouldReturnTrueOnRealFileSystem( @@ -27,7 +27,7 @@ public void } } - [SkippableTheory] + [Theory] [AutoData] public void Extensibility_HasWrappedInstance_WithIncorrectType_ShouldReturnAlwaysFalse( @@ -44,7 +44,7 @@ public void directoryInfo.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Extensibility_RetrieveMetadata_CorrectKeyAndType_ShouldReturnStoredValue( @@ -61,7 +61,7 @@ public void result.Should().Be(time); } - [SkippableTheory] + [Theory] [AutoData] public void Extensibility_RetrieveMetadata_DifferentKey_ShouldReturnNull( string name) @@ -77,7 +77,7 @@ public void Extensibility_RetrieveMetadata_DifferentKey_ShouldReturnNull( result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Extensibility_RetrieveMetadata_DifferentType_ShouldReturnNull( string name) @@ -93,7 +93,7 @@ public void Extensibility_RetrieveMetadata_DifferentType_ShouldReturnNull( result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Extensibility_RetrieveMetadata_NotRegisteredKey_ShouldReturnNull( string name) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.cs index d27348f3c..5f272d6ee 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem; [FileSystemTests] public partial class FileSystemTests { - [SkippableFact] + [Fact] public void Paths_UnderWindows_ShouldUseNormalSlashAndBackslashInterchangeable() { Skip.IfNot(Test.RunsOnWindows); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs index f4ddbf562..f272912ac 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; [FileSystemTests] public partial class EnableRaisingEventsTests { - [SkippableTheory] + [Theory] [AutoData] public void EnableRaisingEvents_SetToFalse_ShouldStop(string path1, string path2) { @@ -36,7 +36,7 @@ public void EnableRaisingEvents_SetToFalse_ShouldStop(string path1, string path2 ms.Wait(ExpectTimeout).Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void EnableRaisingEvents_ShouldBeInitializedAsFalse(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs index 076447717..5e5738e38 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs @@ -10,7 +10,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; [FileSystemTests] public partial class EventTests { - [SkippableTheory] + [Theory] [AutoData] public void Changed_ShouldTriggerUntilEventIsRemoved(string path) { @@ -84,7 +84,7 @@ void FileSystemWatcherOnChanged(object sender, FileSystemEventArgs e) cts.Cancel(); } - [SkippableTheory] + [Theory] [AutoData] public void Created_ShouldTriggerUntilEventIsRemoved(string path) { @@ -154,7 +154,7 @@ void FileSystemWatcherOnCreated(object sender, FileSystemEventArgs e) cts.Cancel(); } - [SkippableTheory] + [Theory] [AutoData] public void Deleted_ShouldTriggerUntilEventIsRemoved(string path) { @@ -224,7 +224,7 @@ void FileSystemWatcherOnDeleted(object sender, FileSystemEventArgs e) cts.Cancel(); } - [SkippableTheory] + [Theory] [AutoData] public void Renamed_ShouldTriggerUntilEventIsRemoved(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs index 8aee08df9..e7268d6f9 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs @@ -10,7 +10,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; [FileSystemTests] public partial class FilterTests { - [SkippableTheory] + [Theory] [AutoData] public void Filter_Matching_ShouldTriggerNotification(string path) { @@ -43,7 +43,7 @@ public void Filter_Matching_ShouldTriggerNotification(string path) result.Name.Should().Be(FileSystem.Path.GetFileName(path)); } - [SkippableTheory] + [Theory] [AutoData] public void Filter_NotMatching_ShouldNotTriggerNotification( string path, string filter) @@ -77,7 +77,7 @@ public void Filter_NotMatching_ShouldNotTriggerNotification( } #if FEATURE_FILESYSTEMWATCHER_ADVANCED - [SkippableTheory] + [Theory] [AutoData] public void Filters_ShouldMatchAnyOfTheSpecifiedFilters( string[] filteredPaths, string[] otherPaths) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs index 2be05d146..2147597f9 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; [FileSystemTests] public partial class IncludeSubdirectoriesTests { - [SkippableTheory] + [Theory] [AutoData] public void IncludeSubdirectories_SetToFalse_ShouldNotTriggerNotification( string baseDirectory, string path) @@ -39,7 +39,7 @@ public void IncludeSubdirectories_SetToFalse_ShouldNotTriggerNotification( result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void IncludeSubdirectories_SetToTrue_ShouldOnlyTriggerNotificationOnSubdirectories( @@ -74,7 +74,7 @@ public void result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void IncludeSubdirectories_SetToTrue_ShouldTriggerNotificationOnSubdirectories( string baseDirectory, string subdirectoryName) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs index 88a3f4fa7..83f599a3a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; [FileSystemTests] public partial class NotifyFiltersTests { - [SkippableTheory] + [Theory] [AutoData] public void NotifyFilter_AppendFile_ShouldNotNotifyOnOtherFilters(string fileName) { @@ -54,7 +54,7 @@ public void NotifyFilter_AppendFile_ShouldNotNotifyOnOtherFilters(string fileNam result.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineAutoData(NotifyFilters.CreationTime)] [InlineAutoData(NotifyFilters.LastAccess)] [InlineAutoData(NotifyFilters.LastWrite)] @@ -113,7 +113,7 @@ public void NotifyFilter_AppendFile_ShouldTriggerChangedEventOnNotifyFilters( result.Name.Should().Be(FileSystem.Path.GetFileName(fileName)); } - [SkippableTheory] + [Theory] [AutoData] public void NotifyFilter_CreateDirectory_ShouldNotNotifyOnOtherFilters(string path) { @@ -152,7 +152,7 @@ public void NotifyFilter_CreateDirectory_ShouldNotNotifyOnOtherFilters(string pa result.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineAutoData(NotifyFilters.DirectoryName)] public void NotifyFilter_CreateDirectory_ShouldTriggerCreatedEventOnNotifyFilters( NotifyFilters notifyFilter, string path) @@ -189,7 +189,7 @@ public void NotifyFilter_CreateDirectory_ShouldTriggerCreatedEventOnNotifyFilter result.Name.Should().Be(FileSystem.Path.GetFileName(path)); } - [SkippableTheory] + [Theory] [AutoData] public void NotifyFilter_CreateFile_ShouldNotNotifyOnOtherFilters(string path) { @@ -228,7 +228,7 @@ public void NotifyFilter_CreateFile_ShouldNotNotifyOnOtherFilters(string path) result.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineAutoData(NotifyFilters.FileName)] public void NotifyFilter_CreateFile_ShouldTriggerCreatedEventOnNotifyFilters( NotifyFilters notifyFilter, string path) @@ -265,7 +265,7 @@ public void NotifyFilter_CreateFile_ShouldTriggerCreatedEventOnNotifyFilters( result.Name.Should().Be(FileSystem.Path.GetFileName(path)); } - [SkippableTheory] + [Theory] [AutoData] public void NotifyFilter_DeleteDirectory_ShouldNotNotifyOnOtherFilters(string path) { @@ -304,7 +304,7 @@ public void NotifyFilter_DeleteDirectory_ShouldNotNotifyOnOtherFilters(string pa result.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineAutoData(NotifyFilters.DirectoryName)] public void NotifyFilter_DeleteDirectory_ShouldTriggerDeletedEventOnNotifyFilters( NotifyFilters notifyFilter, string path) @@ -341,7 +341,7 @@ public void NotifyFilter_DeleteDirectory_ShouldTriggerDeletedEventOnNotifyFilter result.Name.Should().Be(FileSystem.Path.GetFileName(path)); } - [SkippableTheory] + [Theory] [AutoData] public void NotifyFilter_DeleteFile_ShouldNotNotifyOnOtherFilters(string path) { @@ -380,7 +380,7 @@ public void NotifyFilter_DeleteFile_ShouldNotNotifyOnOtherFilters(string path) result.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineAutoData(NotifyFilters.FileName)] public void NotifyFilter_DeleteFile_ShouldTriggerDeletedEventOnNotifyFilters( NotifyFilters notifyFilter, string path) @@ -417,7 +417,7 @@ public void NotifyFilter_DeleteFile_ShouldTriggerDeletedEventOnNotifyFilters( result.Name.Should().Be(FileSystem.Path.GetFileName(path)); } - [SkippableTheory] + [Theory] [AutoData] public void NotifyFilter_MoveFile_DifferentDirectories_ShouldNotifyOnLinuxOrMac( @@ -468,7 +468,7 @@ public void result.OldName.Should().Be(FileSystem.Path.Combine(sourcePath, sourceName)); } - [SkippableTheory] + [Theory] [AutoData] public void NotifyFilter_MoveFile_DifferentDirectories_ShouldNotNotify_OnWindows( @@ -511,7 +511,7 @@ public void result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void NotifyFilter_MoveFile_ShouldNotNotifyOnOtherFilters( string sourceName, string destinationName) @@ -553,7 +553,7 @@ public void NotifyFilter_MoveFile_ShouldNotNotifyOnOtherFilters( result.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineAutoData(NotifyFilters.FileName)] public void NotifyFilter_MoveFile_ShouldTriggerChangedEventOnNotifyFilters( NotifyFilters notifyFilter, string sourceName, string destinationName) @@ -595,7 +595,7 @@ public void NotifyFilter_MoveFile_ShouldTriggerChangedEventOnNotifyFilters( result.OldName.Should().Be(FileSystem.Path.GetFileName(sourceName)); } - [SkippableTheory] + [Theory] [AutoData] public void NotifyFilter_WriteFile_ShouldNotNotifyOnOtherFilters(string fileName) { @@ -644,7 +644,7 @@ public void NotifyFilter_WriteFile_ShouldNotNotifyOnOtherFilters(string fileName result.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineAutoData(NotifyFilters.CreationTime)] [InlineAutoData(NotifyFilters.LastAccess)] [InlineAutoData(NotifyFilters.LastWrite)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/PathTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/PathTests.cs index eb4e81db7..9a8cf2438 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/PathTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/PathTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; [FileSystemTests] public partial class PathTests { - [SkippableFact] + [Fact] public void Path_Empty_ShouldNotThrowException() { using IFileSystemWatcher fileSystemWatcher = @@ -18,7 +18,7 @@ public void Path_Empty_ShouldNotThrowException() exception.Should().BeNull(); } - [SkippableFact] + [Fact] public void Path_Null_ShouldNotThrowException() { using IFileSystemWatcher fileSystemWatcher = @@ -33,7 +33,7 @@ public void Path_Null_ShouldNotThrowException() exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void Path_SetToNotExistingPath_ShouldThrowArgumentException(string path) { @@ -51,7 +51,7 @@ public void Path_SetToNotExistingPath_ShouldThrowArgumentException(string path) messageContains: path); } - [SkippableFact] + [Fact] public void Path_Whitespace_ShouldThrowArgumentException() { using IFileSystemWatcher fileSystemWatcher = diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs index 4b766c484..de6042353 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void BeginInit_ShouldStopListening(string path) { @@ -57,7 +57,7 @@ public void BeginInit_ShouldStopListening(string path) } } - [SkippableFact] + [Fact] public void Container_ShouldBeInitializedWithNull() { FileSystem.Initialize(); @@ -67,7 +67,7 @@ public void Container_ShouldBeInitializedWithNull() fileSystemWatcher.Container.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void EndInit_ShouldRestartListening(string path) { @@ -112,7 +112,7 @@ public void EndInit_ShouldRestartListening(string path) } } - [SkippableTheory] + [Theory] [InlineData(-1, 4096)] [InlineData(4095, 4096)] [InlineData(4097, 4097)] @@ -128,7 +128,7 @@ public void InternalBufferSize_ShouldAtLeastHave4096Bytes( fileSystemWatcher.InternalBufferSize.Should().Be(expectedBytes); } - [SkippableFact] + [Fact] public void Site_ShouldBeInitializedWithNull() { FileSystem.Initialize(); @@ -138,7 +138,7 @@ public void Site_ShouldBeInitializedWithNull() fileSystemWatcher.Site.Should().BeNull(); } - [SkippableFact] + [Fact] public void Site_ShouldBeWritable() { ISite site = new MockSite(); @@ -151,7 +151,7 @@ public void Site_ShouldBeWritable() fileSystemWatcher.Site.Should().Be(site); } - [SkippableFact] + [Fact] public void SynchronizingObject_ShouldBeInitializedWithNull() { FileSystem.Initialize(); @@ -161,7 +161,7 @@ public void SynchronizingObject_ShouldBeInitializedWithNull() fileSystemWatcher.SynchronizingObject.Should().BeNull(); } - [SkippableFact] + [Fact] public void SynchronizingObject_ShouldBeWritable() { ISynchronizeInvoke synchronizingObject = new MockSynchronizeInvoke(); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs index 809405a09..660c210dd 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; [FileSystemTests] public partial class WaitForChangedTests { - [SkippableTheory] + [Theory] [AutoData] public void WaitForChanged_ShouldBlockUntilEventHappens(string path) { @@ -52,7 +52,7 @@ public void WaitForChanged_ShouldBlockUntilEventHappens(string path) } } - [SkippableTheory] + [Theory] [MemberData(nameof(GetWaitForChangedTimeoutParameters))] public void WaitForChanged_Timeout_ShouldReturnTimedOut(string path, Func callback) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/ExceptionTests.cs index 5b2c9b1c5..9df8bafc5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/ExceptionTests.cs @@ -8,9 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcherFactory; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] - [MemberData(nameof(GetFileSystemWatcherFactoryCallbacks), - parameters: "Illegal\tCharacter?InPath")] + [Theory] + [MemberData(nameof(GetFileSystemWatcherFactoryCallbacks), "Illegal\tCharacter?InPath")] public void Operations_WhenValueContainsIllegalPathCharacters_ShouldThrowCorrectException_OnWindows( Expression> callback, string paramName, @@ -38,8 +37,8 @@ public void } } - [SkippableTheory] - [MemberData(nameof(GetFileSystemWatcherFactoryCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetFileSystemWatcherFactoryCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -56,8 +55,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileSystemWatcherFactoryCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetFileSystemWatcherFactoryCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -73,8 +72,8 @@ public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( $"\n{callback}\n has `null` parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileSystemWatcherFactoryCallbacks), parameters: " ")] + [Theory] + [MemberData(nameof(GetFileSystemWatcherFactoryCallbacks), " ")] public void Operations_WhenValueIsWhitespace_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/Tests.cs index 06d183e14..dcc9681ee 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/Tests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcherFactory; [FileSystemTests] public partial class Tests { - [SkippableFact] + [Fact] public void New_ShouldInitializeWithDefaultValues() { using IFileSystemWatcher result = @@ -25,7 +25,7 @@ public void New_ShouldInitializeWithDefaultValues() result.EnableRaisingEvents.Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void New_WithPath_ShouldInitializeWithDefaultValues(string path) { @@ -47,7 +47,7 @@ public void New_WithPath_ShouldInitializeWithDefaultValues(string path) result.EnableRaisingEvents.Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void New_WithPathAndFilter_ShouldInitializeWithDefaultValues( string path, string filter) @@ -66,7 +66,7 @@ public void New_WithPathAndFilter_ShouldInitializeWithDefaultValues( result.EnableRaisingEvents.Should().BeFalse(); } - [SkippableFact] + [Fact] public void Wrap_Null_ShouldReturnNull() { using IFileSystemWatcher? result = FileSystem.FileSystemWatcher.Wrap(null); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfo/Tests.cs index 2a73fd059..20c67ec19 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfo/Tests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileVersionInfo; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void ToString_ShouldReturnProvidedPath(string fileName) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/ExceptionTests.cs index 7d9a2ca45..bad69f80c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/ExceptionTests.cs @@ -7,8 +7,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileVersionInfoFactory; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] - [MemberData(nameof(GetFileVersionInfoFactoryCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetFileVersionInfoFactoryCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -25,8 +25,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileVersionInfoFactoryCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetFileVersionInfoFactoryCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -42,8 +42,8 @@ public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( $"\n{callback}\n has `null` parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetFileVersionInfoFactoryCallbacks), parameters: " ")] + [Theory] + [MemberData(nameof(GetFileVersionInfoFactoryCallbacks), " ")] public void Operations_WhenValueIsWhitespace_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/Tests.cs index 2f7bb65f8..8a3ea17e9 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/Tests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileVersionInfoFactory; [FileSystemTests] public partial class Tests { - [SkippableTheory] + [Theory] [AutoData] public void GetVersionInfo_ArbitraryFile_ShouldHaveFileNameSet(string fileName) { @@ -22,7 +22,7 @@ public void GetVersionInfo_ArbitraryFile_ShouldHaveFileNameSet(string fileName) result.FileName.Should().Be(filePath); } - [SkippableTheory] + [Theory] [AutoData] public void GetVersionInfo_MissingFile_ShouldThrowFileNotFoundException( string path) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ChangeExtensionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ChangeExtensionTests.cs index 84f65d065..daa20f990 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ChangeExtensionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ChangeExtensionTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class ChangeExtensionTests { - [SkippableTheory] + [Theory] [AutoData] public void ChangeExtension_EmptyPath_ShouldReturnEmptyString(string extension) { @@ -12,7 +12,7 @@ public void ChangeExtension_EmptyPath_ShouldReturnEmptyString(string extension) result.Should().BeEmpty(); } - [SkippableTheory] + [Theory] [AutoData] public void ChangeExtension_NullPath_ShouldReturnNull(string extension) { @@ -21,7 +21,7 @@ public void ChangeExtension_NullPath_ShouldReturnNull(string extension) result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void ChangeExtension_WhenExtensionIsNull_ShouldRemovePreviousExtension( string fileName) @@ -34,7 +34,7 @@ public void ChangeExtension_WhenExtensionIsNull_ShouldRemovePreviousExtension( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void ChangeExtension_WithDirectory_ShouldIncludeDirectory( string directory, string fileName, string extension) @@ -48,7 +48,7 @@ public void ChangeExtension_WithDirectory_ShouldIncludeDirectory( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void ChangeExtension_WithDotOnlyInDirectory_ShouldAppendExtensionToPath( string directory, string fileName, string extension) @@ -62,7 +62,7 @@ public void ChangeExtension_WithDotOnlyInDirectory_ShouldAppendExtensionToPath( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void ChangeExtension_WithFileStartingWithDot_ShouldAppendExtensionToPath( string fileName, string extension) @@ -75,7 +75,7 @@ public void ChangeExtension_WithFileStartingWithDot_ShouldAppendExtensionToPath( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void ChangeExtension_WithLeadingDotInExtension_ShouldNotIncludeTwoDots( string fileName, string extension) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/CombineTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/CombineTests.cs index 1c5a576bb..4972fb8a0 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/CombineTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/CombineTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class CombineTests { - [SkippableTheory] + [Theory] [AutoData] public void Combine_2Paths_OneEmpty_ShouldReturnCombinationOfOtherParts( string path) @@ -15,7 +15,7 @@ public void Combine_2Paths_OneEmpty_ShouldReturnCombinationOfOtherParts( result2.Should().Be(path); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_2Paths_OneNull_ShouldThrowArgumentNullException(string path) { @@ -30,7 +30,7 @@ public void Combine_2Paths_OneNull_ShouldThrowArgumentNullException(string path) .BeException(paramName: "path1", hResult: -2147467261); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_2Paths_Rooted_ShouldReturnLastRootedPath( string path1, string path2) @@ -43,7 +43,7 @@ public void Combine_2Paths_Rooted_ShouldReturnLastRootedPath( result.Should().Be(path2); } - [SkippableTheory] + [Theory] [InlineData("", "", "")] [InlineData("/foo/", "/bar/", "/bar/")] [InlineData("foo/", "/bar", "/bar")] @@ -63,7 +63,7 @@ public void Combine_2Paths_ShouldReturnExpectedResult( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [InlineAutoData] [InlineAutoData(" ")] [InlineAutoData("foo", " ")] @@ -78,7 +78,7 @@ public void Combine_2Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( result.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_3Paths_OneEmpty_ShouldReturnCombinationOfOtherParts( string pathA, string pathB) @@ -94,7 +94,7 @@ public void Combine_3Paths_OneEmpty_ShouldReturnCombinationOfOtherParts( result3.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_3Paths_OneNull_ShouldThrowArgumentNullException(string pathA, string pathB) { @@ -113,7 +113,7 @@ public void Combine_3Paths_OneNull_ShouldThrowArgumentNullException(string pathA .BeException(paramName: "path2", hResult: -2147467261); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_3Paths_Rooted_ShouldReturnLastRootedPath( string path1, string path2, string path3) @@ -127,7 +127,7 @@ public void Combine_3Paths_Rooted_ShouldReturnLastRootedPath( result.Should().Be(path3); } - [SkippableTheory] + [Theory] [InlineData("", "", "", "")] [InlineData("/foo/", "/bar/", "/baz/", "/baz/")] [InlineData("foo/", "/bar/", "/baz", "/baz")] @@ -149,7 +149,7 @@ public void Combine_3Paths_ShouldReturnExpectedResult( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [InlineAutoData] [InlineAutoData(" ")] [InlineAutoData("foo", " ")] @@ -166,7 +166,7 @@ public void Combine_3Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( result.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_4Paths_OneEmpty_ShouldReturnCombinationOfOtherParts( string pathA, string pathB, string pathC) @@ -184,7 +184,7 @@ public void Combine_4Paths_OneEmpty_ShouldReturnCombinationOfOtherParts( result4.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_4Paths_OneNull_ShouldThrowArgumentNullException(string pathA, string pathB, string pathC) @@ -208,7 +208,7 @@ public void Combine_4Paths_OneNull_ShouldThrowArgumentNullException(string pathA .BeException(paramName: "path3", hResult: -2147467261); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_4Paths_Rooted_ShouldReturnLastRootedPath( string path1, string path2, string path3, string path4) @@ -223,7 +223,7 @@ public void Combine_4Paths_Rooted_ShouldReturnLastRootedPath( result.Should().Be(path4); } - [SkippableTheory] + [Theory] [InlineData("", "", "", "", "")] [InlineData("/foo/", "/bar/", "/baz/", "/muh/", "/muh/")] [InlineData("foo/", "/bar/", "/baz/", "/muh", "/muh")] @@ -246,7 +246,7 @@ public void Combine_4Paths_ShouldReturnExpectedResult( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [InlineAutoData] [InlineAutoData(" ")] [InlineAutoData("foo", " ")] @@ -265,7 +265,7 @@ public void Combine_4Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( result.Should().Be(expectedPath); } - [SkippableFact] + [Fact] public void Combine_ParamPaths_Null_ShouldThrowArgumentNullException() { Exception? exception = Record.Exception(() => @@ -275,7 +275,7 @@ public void Combine_ParamPaths_Null_ShouldThrowArgumentNullException() .BeException(paramName: "paths", hResult: -2147467261); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_ParamPaths_OneEmpty_ShouldReturnCombinationOfOtherParts( string path1, string path2, string path3, string path4) @@ -300,7 +300,7 @@ public void Combine_ParamPaths_OneEmpty_ShouldReturnCombinationOfOtherParts( result5.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_ParamPaths_OneNull_ShouldThrowArgumentNullException( string pathA, string pathB, string pathC, string pathD) @@ -328,7 +328,7 @@ public void Combine_ParamPaths_OneNull_ShouldThrowArgumentNullException( .BeException(paramName: "paths", hResult: -2147467261); } - [SkippableTheory] + [Theory] [AutoData] public void Combine_ParamPaths_Rooted_ShouldReturnLastRootedPath( string path1, string path2, string path3, string path4, string path5) @@ -344,7 +344,7 @@ public void Combine_ParamPaths_Rooted_ShouldReturnLastRootedPath( result.Should().Be(path5); } - [SkippableTheory] + [Theory] [InlineData("", "", "", "", "", "")] [InlineData("/foo/", "/bar/", "/baz/", "/muh/", "/maeh/", "/maeh/")] [InlineData("foo/", "/bar/", "/baz/", "/muh", "/maeh", "/maeh")] @@ -368,7 +368,7 @@ public void Combine_ParamPaths_ShouldReturnExpectedResult( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [InlineAutoData] [InlineAutoData(" ")] [InlineAutoData("foo", " ")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/EndsInDirectorySeparatorTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/EndsInDirectorySeparatorTests.cs index 3c521dec3..a6ca29ae5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/EndsInDirectorySeparatorTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/EndsInDirectorySeparatorTests.cs @@ -4,7 +4,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class EndsInDirectorySeparatorTests { - [SkippableFact] + [Fact] public void EndsInDirectorySeparator_Empty_ShouldReturnExpectedResult() { bool result = FileSystem.Path.EndsInDirectorySeparator(string.Empty); @@ -12,7 +12,7 @@ public void EndsInDirectorySeparator_Empty_ShouldReturnExpectedResult() result.Should().BeFalse(); } - [SkippableFact] + [Fact] public void EndsInDirectorySeparator_Null_ShouldReturnExpectedResult() { bool result = FileSystem.Path.EndsInDirectorySeparator(null!); @@ -20,7 +20,7 @@ public void EndsInDirectorySeparator_Null_ShouldReturnExpectedResult() result.Should().BeFalse(); } - [SkippableFact] + [Fact] public void EndsInDirectorySeparator_Span_Empty_ShouldReturnExpectedResult() { bool result = FileSystem.Path.EndsInDirectorySeparator(string.Empty.AsSpan()); @@ -28,7 +28,7 @@ public void EndsInDirectorySeparator_Span_Empty_ShouldReturnExpectedResult() result.Should().BeFalse(); } - [SkippableTheory] + [Theory] [InlineAutoData('.')] [InlineAutoData('a')] public void @@ -42,7 +42,7 @@ public void result.Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void EndsInDirectorySeparator_Span_WithTrailingAltDirectorySeparator_ShouldReturnTrue( @@ -55,7 +55,7 @@ public void result.Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void EndsInDirectorySeparator_Span_WithTrailingDirectorySeparator_ShouldReturnTrue( @@ -68,7 +68,7 @@ public void result.Should().BeTrue(); } - [SkippableTheory] + [Theory] [InlineAutoData('.')] [InlineAutoData('a')] public void @@ -82,7 +82,7 @@ public void result.Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void EndsInDirectorySeparator_WithTrailingAltDirectorySeparator_ShouldReturnTrue( string path) @@ -94,7 +94,7 @@ public void EndsInDirectorySeparator_WithTrailingAltDirectorySeparator_ShouldRet result.Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void EndsInDirectorySeparator_WithTrailingDirectorySeparator_ShouldReturnTrue( string path) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExceptionTests.cs index a69e94fda..5bc03c31c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExceptionTests.cs @@ -7,8 +7,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class ExceptionTests { - [SkippableTheory] - [MemberData(nameof(GetPathCallbacks), parameters: "")] + [Theory] + [MemberData(nameof(GetPathCallbacks), "")] public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -25,8 +25,8 @@ public void Operations_WhenValueIsEmpty_ShouldThrowArgumentException( $"\n{callback}\n has empty parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetPathCallbacks), parameters: (string?)null)] + [Theory] + [MemberData(nameof(GetPathCallbacks), (string?)null)] public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( Expression> callback, string paramName, bool ignoreParamCheck) @@ -42,8 +42,8 @@ public void Operations_WhenValueIsNull_ShouldThrowArgumentNullException( $"\n{callback}\n has `null` parameter for '{paramName}' (ignored: {ignoreParamCheck})"); } - [SkippableTheory] - [MemberData(nameof(GetPathCallbacks), parameters: " ")] + [Theory] + [MemberData(nameof(GetPathCallbacks), " ")] public void Operations_WhenValueIsWhitespace_ShouldThrowArgumentException( Expression> callback, string paramName, bool ignoreParamCheck) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExistsTests.cs index 107765ad8..8088e2740 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExistsTests.cs @@ -4,7 +4,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class ExistsTests { - [SkippableTheory] + [Theory] [AutoData] public void Exists_ExistingDirectory_ShouldReturnTrue(string path) { @@ -15,7 +15,7 @@ public void Exists_ExistingDirectory_ShouldReturnTrue(string path) result.Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ExistingFile_ShouldReturnTrue(string path) { @@ -26,7 +26,7 @@ public void Exists_ExistingFile_ShouldReturnTrue(string path) result.Should().BeTrue(); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ExistingFileOrDirectory_ShouldReturnTrue(string path) { @@ -35,7 +35,7 @@ public void Exists_ExistingFileOrDirectory_ShouldReturnTrue(string path) result.Should().BeFalse(); } - [SkippableFact] + [Fact] public void Exists_Null_ShouldReturnFalse() { bool result = FileSystem.Path.Exists(null); @@ -43,7 +43,7 @@ public void Exists_Null_ShouldReturnFalse() result.Should().BeFalse(); } - [SkippableTheory] + [Theory] [AutoData] public void Exists_ShouldWorkWithAbsolutePaths(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetDirectoryNameTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetDirectoryNameTests.cs index 6b6dc386c..5f11487e4 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetDirectoryNameTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetDirectoryNameTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetDirectoryNameTests { - [SkippableTheory] + [Theory] [InlineData((string?)null)] #if !NETFRAMEWORK [InlineData("")] @@ -16,7 +16,7 @@ public void GetDirectoryName_NullOrEmpty_ShouldReturnNull(string? path) } #if NETFRAMEWORK - [SkippableTheory] + [Theory] [InlineData("")] [InlineData(" ")] [InlineData(" ")] @@ -34,7 +34,7 @@ public void GetDirectoryName_EmptyOrWhiteSpace_ShouldThrowArgumentException(stri #endif #if !NETFRAMEWORK - [SkippableTheory] + [Theory] [InlineData(" ")] [InlineData(" ")] public void GetDirectoryName_Spaces_ShouldReturnNullOnWindowsOtherwiseEmpty(string? path) @@ -53,7 +53,7 @@ public void GetDirectoryName_Spaces_ShouldReturnNullOnWindowsOtherwiseEmpty(stri #endif #if !NETFRAMEWORK - [SkippableTheory] + [Theory] [InlineData("\t")] [InlineData("\n")] [InlineData(" \t")] @@ -66,7 +66,7 @@ public void GetDirectoryName_TabOrNewline_ShouldReturnEmptyString(string? path) } #endif - [SkippableTheory] + [Theory] [AutoData] public void GetDirectoryName_ShouldReturnDirectory( string directory, string filename, string extension) @@ -79,7 +79,7 @@ public void GetDirectoryName_ShouldReturnDirectory( result.Should().Be(directory); } - [SkippableTheory] + [Theory] [AutoData] public void GetDirectoryName_ShouldReplaceAltDirectorySeparator( string parentDirectory, string directory, string filename) @@ -93,7 +93,7 @@ public void GetDirectoryName_ShouldReplaceAltDirectorySeparator( result.Should().Be(expected); } - [SkippableTheory] + [Theory] [InlineData("foo//bar/file", "foo/bar", TestOS.All)] [InlineData("foo///bar/file", "foo/bar", TestOS.All)] [InlineData("//foo//bar/file", "/foo/bar", TestOS.Linux | TestOS.Mac)] @@ -112,7 +112,7 @@ public void GetDirectoryName_ShouldNormalizeDirectorySeparators( } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void GetDirectoryName_Span_ShouldReturnDirectory( string directory, string filename, string extension) @@ -126,7 +126,7 @@ public void GetDirectoryName_Span_ShouldReturnDirectory( } #endif - [SkippableTheory] + [Theory] [InlineData("//", null, TestOS.Windows)] [InlineData(@"\\", null, TestOS.Windows)] [InlineData(@"\\", "", TestOS.Linux | TestOS.Mac)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetExtensionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetExtensionTests.cs index fa6ebd13c..070c2c497 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetExtensionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetExtensionTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetExtensionTests { - [SkippableFact] + [Fact] public void GetExtension_Empty_ShouldReturnEmpty() { string? result = FileSystem.Path.GetExtension(string.Empty); @@ -11,7 +11,7 @@ public void GetExtension_Empty_ShouldReturnEmpty() result.Should().BeEmpty(); } - [SkippableFact] + [Fact] public void GetExtension_Null_ShouldReturnNull() { string? result = FileSystem.Path.GetExtension(null); @@ -19,7 +19,7 @@ public void GetExtension_Null_ShouldReturnNull() result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void GetExtension_ShouldReturnExtensionWithLeadingDot( string directory, string filename, string extension) @@ -33,7 +33,7 @@ public void GetExtension_ShouldReturnExtensionWithLeadingDot( } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void GetExtension_Span_ShouldReturnExtensionWithLeadingDot( string directory, string filename, string extension) @@ -47,7 +47,7 @@ public void GetExtension_Span_ShouldReturnExtensionWithLeadingDot( } #endif - [SkippableTheory] + [Theory] [AutoData] public void GetExtension_StartingDot_ShouldReturnCompleteFileName( string directory, string filename) @@ -59,7 +59,7 @@ public void GetExtension_StartingDot_ShouldReturnCompleteFileName( result.Should().Be("." + filename); } - [SkippableTheory] + [Theory] [AutoData] public void GetExtension_TrailingDot_ShouldReturnEmptyString( string directory, string filename) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameTests.cs index cc98b4e70..62c252d34 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetFileNameTests { - [SkippableFact] + [Fact] public void GetFileName_EmptyString_ShouldReturnEmptyString() { string result = FileSystem.Path.GetFileName(string.Empty); @@ -11,7 +11,7 @@ public void GetFileName_EmptyString_ShouldReturnEmptyString() result.Should().Be(string.Empty); } - [SkippableFact] + [Fact] public void GetFileName_Null_ShouldReturnNull() { string? result = FileSystem.Path.GetFileName(null); @@ -19,7 +19,7 @@ public void GetFileName_Null_ShouldReturnNull() result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void GetFileName_ShouldReturnFilename(string directory, string filename, string extension) @@ -33,7 +33,7 @@ public void GetFileName_ShouldReturnFilename(string directory, string filename, } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void GetFileName_Span_ShouldReturnDirectory( string directory, string filename, @@ -48,7 +48,7 @@ public void GetFileName_Span_ShouldReturnDirectory( } #endif - [SkippableTheory] + [Theory] [InlineData("foo/", "", TestOS.All)] [InlineData("bar\\", "", TestOS.Windows)] [InlineData("/foo", "foo", TestOS.All)] @@ -63,7 +63,7 @@ public void GetFileName_SpecialCases_ShouldReturnExpectedResult( result.Should().Be(expected); } - [SkippableTheory] + [Theory] [AutoData] public void GetFileName_WithoutDirectory_ShouldReturnFilename(string filename) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameWithoutExtensionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameWithoutExtensionTests.cs index 14625201b..adf1c0466 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameWithoutExtensionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameWithoutExtensionTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetFileNameWithoutExtensionTests { - [SkippableTheory] + [Theory] [AutoData] public void GetFileNameWithoutExtension_MultipleDots_ShouldReturnOnlyRemoveTheLastExtension( string directory, string filename1, string filename2, string extension) @@ -17,7 +17,7 @@ public void GetFileNameWithoutExtension_MultipleDots_ShouldReturnOnlyRemoveTheLa result.Should().Be(filename); } - [SkippableFact] + [Fact] public void GetFileNameWithoutExtension_Null_ShouldReturnNull() { string? result = FileSystem.Path.GetFileNameWithoutExtension(null); @@ -25,7 +25,7 @@ public void GetFileNameWithoutExtension_Null_ShouldReturnNull() result.Should().BeNull(); } - [SkippableTheory] + [Theory] [AutoData] public void GetFileNameWithoutExtension_ShouldReturnFileNameWithoutExtension( string directory, string filename, string extension) @@ -39,7 +39,7 @@ public void GetFileNameWithoutExtension_ShouldReturnFileNameWithoutExtension( } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void GetFileNameWithoutExtension_Span_ShouldReturnFileNameWithoutExtension( string directory, string filename, string extension) @@ -54,7 +54,7 @@ public void GetFileNameWithoutExtension_Span_ShouldReturnFileNameWithoutExtensio } #endif - [SkippableTheory] + [Theory] [AutoData] public void GetFileNameWithoutExtension_StartingDot_ShouldReturnEmptyString( string directory, string filename) @@ -66,7 +66,7 @@ public void GetFileNameWithoutExtension_StartingDot_ShouldReturnEmptyString( result.Should().Be(""); } - [SkippableTheory] + [Theory] [AutoData] public void GetFileNameWithoutExtension_TrailingDot_ShouldReturnFilenameWithoutTrailingDot( string directory, string filename) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs index 550cc9d11..baabee8ce 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetFullPathTests { - [SkippableFact] + [Fact] public void GetFullPath_Dot_ShouldReturnToCurrentDirectory() { string expectedFullPath = FileSystem.Directory.GetCurrentDirectory(); @@ -13,7 +13,7 @@ public void GetFullPath_Dot_ShouldReturnToCurrentDirectory() result.Should().Be(expectedFullPath); } - [SkippableTheory] + [Theory] [InlineData(@"C:\..", @"C:\", TestOS.Windows)] [InlineData(@"C:\foo", @"C:\foo", TestOS.Windows)] [InlineData(@"C:\foo\", @"C:\foo\", TestOS.Windows)] @@ -38,7 +38,7 @@ public void GetFullPath_EdgeCases_ShouldReturnExpectedValue( result.Should().Be(expected); } - [SkippableTheory] + [Theory] [InlineData(@"C:\..", @"C:\", TestOS.Windows)] [InlineData("/..", "/", TestOS.Linux | TestOS.Mac)] public void GetFullPath_ParentOfRoot_ShouldReturnRoot(string path, @@ -52,7 +52,7 @@ public void GetFullPath_ParentOfRoot_ShouldReturnRoot(string path, } #if FEATURE_PATH_RELATIVE - [SkippableFact] + [Fact] public void GetFullPath_Relative_NullBasePath_ShouldThrowArgumentNullException() { Exception? exception = Record.Exception(() => @@ -66,7 +66,7 @@ public void GetFullPath_Relative_NullBasePath_ShouldThrowArgumentNullException() #endif #if FEATURE_PATH_RELATIVE - [SkippableFact] + [Fact] public void GetFullPath_Relative_RelativeBasePath_ShouldThrowArgumentException() { string relativeBasePath = "not-fully-qualified-base-path"; @@ -84,7 +84,7 @@ public void GetFullPath_Relative_RelativeBasePath_ShouldThrowArgumentException() #endif #if FEATURE_PATH_RELATIVE - [SkippableTheory] + [Theory] [InlineData("top/../most/file", "foo/bar", "foo/bar/most/file")] [InlineData("top/../most/../dir/file", "foo", "foo/dir/file")] [InlineData("top/../../most/file", "foo/bar", "foo/most/file")] @@ -103,7 +103,7 @@ public void GetFullPath_Relative_ShouldRemoveRelativeSegments(string input, stri #endif #if FEATURE_PATH_RELATIVE - [SkippableTheory] + [Theory] [InlineData(@"C:\top\..\most\file", @"C:\foo\bar", @"C:\most\file", TestOS.Windows)] [InlineData(@"C:\top\..\most\file", @"D:\foo\bar", @"C:\most\file", TestOS.Windows)] [InlineData("/top/../most/file", "/foo/bar", "/most/file", TestOS.Linux | TestOS.Mac)] @@ -119,7 +119,7 @@ public void GetFullPath_Relative_WithRootedPath_ShouldIgnoreBasePath( } #endif - [SkippableFact] + [Fact] public void GetFullPath_RelativePathWithDrive_ShouldReturnExpectedValue() { Skip.IfNot(Test.RunsOnWindows); @@ -134,7 +134,7 @@ public void GetFullPath_RelativePathWithDrive_ShouldReturnExpectedValue() result.Should().Be(expectedFullPath); } - [SkippableFact] + [Fact] public void GetFullPath_RelativePathWithDrive_WhenCurrentDirectoryIsDifferent_ShouldReturnExpectedValue() { @@ -154,7 +154,7 @@ public void result.Should().Be(expectedFullPath); } - [SkippableTheory] + [Theory] [InlineData(@"X:\foo/bar", @"X:\foo\bar")] [InlineData(@"Y:\foo/bar/", @"Y:\foo\bar\")] public void GetFullPath_ShouldFlipAltDirectorySeparators(string path, @@ -167,7 +167,7 @@ public void GetFullPath_ShouldFlipAltDirectorySeparators(string path, result.Should().Be(expected); } - [SkippableTheory] + [Theory] [InlineData("top/../most/file", "most/file")] [InlineData("top/../most/../dir/file", "dir/file")] [InlineData("top/../../most/file", "most/file")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetPathRootTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetPathRootTests.cs index 9a4f87b58..0e2ed9371 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetPathRootTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetPathRootTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetPathRootTests { - [SkippableTheory] + [Theory] [InlineData(@"\\?\foo", @"\\?\foo", TestOS.Windows)] [InlineData(@"\\.\BAR", @"\\.\BAR", TestOS.Windows)] [InlineData(@"\\.\.", @"\\.\.", TestOS.Windows)] @@ -35,7 +35,7 @@ public void GetPathRoot_EdgeCases_ShouldReturnExpectedValue( result.Should().Be(expected); } - [SkippableFact] + [Fact] public void GetPathRoot_Null_ShouldReturnNull() { string? result = FileSystem.Path.GetPathRoot(null); @@ -43,7 +43,7 @@ public void GetPathRoot_Null_ShouldReturnNull() result.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineData("D:")] [InlineData("D:\\")] public void GetPathRoot_RootedDrive_ShouldReturnDriveOnWindows(string path) @@ -55,7 +55,7 @@ public void GetPathRoot_RootedDrive_ShouldReturnDriveOnWindows(string path) result.Should().Be(path); } - [SkippableTheory] + [Theory] [InlineData("D:some-path", "D:")] [InlineData("D:\\some-path", "D:\\")] public void GetPathRoot_RootedDriveWithPath_ShouldReturnDriveOnWindows( @@ -68,7 +68,7 @@ public void GetPathRoot_RootedDriveWithPath_ShouldReturnDriveOnWindows( result.Should().Be(expected); } - [SkippableTheory] + [Theory] [AutoData] public void GetPathRoot_ShouldReturnDefaultValue(string path) { @@ -78,7 +78,7 @@ public void GetPathRoot_ShouldReturnDefaultValue(string path) } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void GetPathRoot_Span_ShouldReturnDefaultValue(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRandomFileNameTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRandomFileNameTests.cs index 02abddba5..45e7a1434 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRandomFileNameTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRandomFileNameTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetRandomFileNameTests { - [SkippableFact] + [Fact] public void GetRandomFileName_ShouldMatch8Dot3Pattern() { string result = FileSystem.Path.GetRandomFileName(); @@ -14,7 +14,7 @@ public void GetRandomFileName_ShouldMatch8Dot3Pattern() result.Should().Match("????????.???"); } - [SkippableFact] + [Fact] public void GetRandomFileName_ShouldReturnRandomFileNameWithExtension() { string result = FileSystem.Path.GetRandomFileName(); @@ -29,7 +29,7 @@ public void GetRandomFileName_ShouldReturnRandomFileNameWithExtension() .Should().NotBeEmpty(); } - [SkippableFact] + [Fact] public void GetRandomFileName_ShouldReturnRandomStrings() { ConcurrentBag results = []; diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRelativePathTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRelativePathTests.cs index a512cdd3a..70116e09b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRelativePathTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRelativePathTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetRelativePathTests { - [SkippableTheory] + [Theory] [AutoData] public void GetRelativePath_CommonParentDirectory_ShouldReturnRelativePath( string baseDirectory, string directory1, string directory2) @@ -19,7 +19,7 @@ public void GetRelativePath_CommonParentDirectory_ShouldReturnRelativePath( result.Should().Be(expectedRelativePath); } - [SkippableTheory] + [Theory] [AutoData] public void GetRelativePath_DifferentDrives_ShouldReturnAbsolutePath( string path1, string path2) @@ -33,7 +33,7 @@ public void GetRelativePath_DifferentDrives_ShouldReturnAbsolutePath( result.Should().Be(path2); } - [SkippableTheory] + [Theory] [InlineData(@"C:\FOO", @"C:\foo", ".", TestOS.Windows)] [InlineData("/FOO", "/foo", "../foo", TestOS.Linux)] [InlineData("/FOO", "/foo", ".", TestOS.Mac)] @@ -68,7 +68,7 @@ public void GetRelativePath_EdgeCases_ShouldReturnExpectedValue(string relativeT result.Should().Be(expected); } - [SkippableFact] + [Fact] public void GetRelativePath_FromAbsolutePathInCurrentDirectory_ShouldReturnRelativePath() { string rootedPath = FileSystem.Path.Combine(BasePath, "input"); @@ -80,7 +80,7 @@ public void GetRelativePath_FromAbsolutePathInCurrentDirectory_ShouldReturnRelat Assert.Equal("a.txt", result); } - [SkippableTheory] + [Theory] [AutoData] public void GetRelativePath_RootedPath_ShouldReturnAbsolutePath( string baseDirectory, string directory1, string directory2) @@ -94,7 +94,7 @@ public void GetRelativePath_RootedPath_ShouldReturnAbsolutePath( result.Should().Be(expectedRelativePath); } - [SkippableFact] + [Fact] public void GetRelativePath_RootedPath_ShouldWorkOnAnyDrive() { Skip.IfNot(Test.RunsOnWindows); @@ -108,7 +108,7 @@ public void GetRelativePath_RootedPath_ShouldWorkOnAnyDrive() result.Should().Be("subDirectory"); } - [SkippableTheory] + [Theory] [AutoData] public void GetRelativePath_ToItself_ShouldReturnDot(string path) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempFileNameTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempFileNameTests.cs index 86f1caa58..12fc81384 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempFileNameTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempFileNameTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetTempFileNameTests { - [SkippableFact] + [Fact] public void GetTempFileName_ShouldBeInTempPath() { string tempPath = FileSystem.Path.GetTempPath(); @@ -13,7 +13,7 @@ public void GetTempFileName_ShouldBeInTempPath() result.Should().StartWith(tempPath); } - [SkippableFact] + [Fact] public void GetTempFileName_ShouldExist() { string result = FileSystem.Path.GetTempFileName(); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempPathTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempPathTests.cs index 78cfa492f..6fcb57ac4 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempPathTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempPathTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class GetTempPathTests { - [SkippableFact] + [Fact] public void GetTempPath_Linux_ShouldBeTmp() { Skip.IfNot(Test.RunsOnLinux); @@ -13,7 +13,7 @@ public void GetTempPath_Linux_ShouldBeTmp() result.Should().Be("/tmp/"); } - [SkippableFact] + [Fact] public void GetTempPath_MacOs_ShouldBeTmp() { Skip.IfNot(Test.RunsOnMac); @@ -23,7 +23,7 @@ public void GetTempPath_MacOs_ShouldBeTmp() result.Should().Match("/var/folders/??/*/T/"); } - [SkippableFact] + [Fact] public void GetTempPath_ShouldEndWithDirectorySeparator() { string directorySeparator = FileSystem.Path.DirectorySeparatorChar.ToString(); @@ -33,7 +33,7 @@ public void GetTempPath_ShouldEndWithDirectorySeparator() result.Should().EndWith(directorySeparator); } - [SkippableFact] + [Fact] public void GetTempPath_ShouldRemainTheSame() { string result1 = FileSystem.Path.GetTempPath(); @@ -42,7 +42,7 @@ public void GetTempPath_ShouldRemainTheSame() result1.Should().Be(result2); } - [SkippableFact] + [Fact] public void GetTempPath_Windows_ShouldBeOnDriveC() { Skip.IfNot(Test.RunsOnWindows); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/HasExtensionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/HasExtensionTests.cs index c083504d8..be7d20d9c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/HasExtensionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/HasExtensionTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class HasExtensionTests { - [SkippableFact] + [Fact] public void HasExtension_Null_ShouldReturnFalse() { bool result = FileSystem.Path.HasExtension(null); @@ -11,7 +11,7 @@ public void HasExtension_Null_ShouldReturnFalse() result.Should().BeFalse(); } - [SkippableTheory] + [Theory] [InlineAutoData("abc.", false)] [InlineAutoData(".foo", true)] [InlineAutoData(".abc.xyz", true)] @@ -28,7 +28,7 @@ public void HasExtension_ShouldReturnExpectedResult( } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [InlineAutoData("abc.", false)] [InlineAutoData(".foo", true)] [InlineAutoData(".abc.xyz", true)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathFullyQualifiedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathFullyQualifiedTests.cs index cb808a3a2..f5b87aefd 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathFullyQualifiedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathFullyQualifiedTests.cs @@ -4,7 +4,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class IsPathFullyQualifiedTests { - [SkippableTheory] + [Theory] [InlineData("C", false, TestOS.Windows)] [InlineData("//", true, TestOS.All)] [InlineData("/Foo", true, TestOS.Linux | TestOS.Mac)] @@ -23,7 +23,7 @@ public void IsPathFullyQualified_EdgeCases_ShouldReturnExpectedValue( result.Should().Be(expected); } - [SkippableTheory] + [Theory] [AutoData] public void IsPathFullyQualified_PrefixedRoot_ShouldReturnTrue( string directory) @@ -35,7 +35,7 @@ public void IsPathFullyQualified_PrefixedRoot_ShouldReturnTrue( } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void IsPathFullyQualified_Span_PrefixedRoot_ShouldReturnTrue( string directory) @@ -48,7 +48,7 @@ public void IsPathFullyQualified_Span_PrefixedRoot_ShouldReturnTrue( #endif #if FEATURE_SPAN - [SkippableTheory] + [Theory] [AutoData] public void IsPathFullyQualified_Span_WithoutPrefixedRoot_ShouldReturnFalse( string path) @@ -59,7 +59,7 @@ public void IsPathFullyQualified_Span_WithoutPrefixedRoot_ShouldReturnFalse( } #endif - [SkippableTheory] + [Theory] [AutoData] public void IsPathFullyQualified_WithoutPrefixedRoot_ShouldReturnFalse( string path) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathRootedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathRootedTests.cs index 90e447d98..9f923f5c6 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathRootedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathRootedTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class IsPathRootedTests { - [SkippableTheory] + [Theory] [MemberData(nameof(TestData))] public void IsPathRooted_ShouldReturnDefaultValue(string path, TestOS isRootedOn) { @@ -13,7 +13,7 @@ public void IsPathRooted_ShouldReturnDefaultValue(string path, TestOS isRootedOn } #if FEATURE_SPAN - [SkippableTheory] + [Theory] [MemberData(nameof(TestData))] public void IsPathRooted_Span_ShouldReturnDefaultValue(string path, TestOS isRootedOn) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/JoinTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/JoinTests.cs index b39701abe..de1afbfb6 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/JoinTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/JoinTests.cs @@ -4,7 +4,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class JoinTests { - [SkippableTheory] + [Theory] [InlineAutoData((string?)null)] [InlineAutoData("")] public void Join_2Paths_OneNullOrEmpty_ShouldReturnCombinationOfOtherParts( @@ -17,7 +17,7 @@ public void Join_2Paths_OneNullOrEmpty_ShouldReturnCombinationOfOtherParts( result2.Should().Be(path); } - [SkippableTheory] + [Theory] [InlineAutoData("/foo/", "/bar/", "/foo//bar/")] [InlineAutoData("foo/", "/bar", "foo//bar")] [InlineAutoData("foo/", "bar", "foo/bar")] @@ -36,7 +36,7 @@ public void Join_2Paths_ShouldReturnExpectedResult( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void Join_2Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( string path1, string path2) @@ -49,7 +49,7 @@ public void Join_2Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void Join_2Paths_Span_ShouldReturnPathsCombinedByDirectorySeparatorChar( string path1, string path2) @@ -64,7 +64,7 @@ public void Join_2Paths_Span_ShouldReturnPathsCombinedByDirectorySeparatorChar( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [InlineAutoData((string?)null)] [InlineAutoData("")] public void Join_3Paths_OneNullOrEmpty_ShouldReturnCombinationOfOtherParts( @@ -81,7 +81,7 @@ public void Join_3Paths_OneNullOrEmpty_ShouldReturnCombinationOfOtherParts( result3.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [InlineAutoData("/foo/", "/bar/", "/baz/", "/foo//bar//baz/")] [InlineAutoData("foo/", "/bar/", "/baz", "foo//bar//baz")] [InlineAutoData("foo/", "bar", "/baz", "foo/bar/baz")] @@ -102,7 +102,7 @@ public void Join_3Paths_ShouldReturnExpectedResult( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void Join_3Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( string path1, string path2, string path3) @@ -116,7 +116,7 @@ public void Join_3Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void Join_3Paths_Span_ShouldReturnPathsCombinedByDirectorySeparatorChar( string path1, string path2, string path3) @@ -133,7 +133,7 @@ public void Join_3Paths_Span_ShouldReturnPathsCombinedByDirectorySeparatorChar( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [InlineAutoData((string?)null)] [InlineAutoData("")] public void Join_4Paths_OneNullOrEmpty_ShouldReturnCombinationOfOtherParts( @@ -153,7 +153,7 @@ public void Join_4Paths_OneNullOrEmpty_ShouldReturnCombinationOfOtherParts( result4.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [InlineAutoData("/foo/", "/bar/", "/baz/", "/muh/", "/foo//bar//baz//muh/")] [InlineAutoData("foo/", "/bar/", "/baz/", "/muh", "foo//bar//baz//muh")] [InlineAutoData("foo/", "bar", "/baz", "/muh", "foo/bar/baz/muh")] @@ -175,7 +175,7 @@ public void Join_4Paths_ShouldReturnExpectedResult( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void Join_4Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( string path1, string path2, string path3, string path4) @@ -190,7 +190,7 @@ public void Join_4Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void Join_4Paths_Span_ShouldReturnPathsCombinedByDirectorySeparatorChar( string path1, string path2, string path3, string path4) @@ -209,7 +209,7 @@ public void Join_4Paths_Span_ShouldReturnPathsCombinedByDirectorySeparatorChar( result.Should().Be(expectedResult); } - [SkippableFact] + [Fact] public void Join_ParamPaths_Empty_ShouldReturnEmptyString() { string?[] paths = Array.Empty(); @@ -219,7 +219,7 @@ public void Join_ParamPaths_Empty_ShouldReturnEmptyString() result.Should().Be(string.Empty); } - [SkippableFact] + [Fact] public void Join_ParamPaths_Null_ShouldThrow() { Exception? exception = Record.Exception(() => @@ -230,7 +230,7 @@ public void Join_ParamPaths_Null_ShouldThrow() exception.Should().BeException(paramName: "paths"); } - [SkippableTheory] + [Theory] [InlineAutoData((string?)null)] [InlineAutoData("")] public void Join_ParamPaths_OneNullOrEmpty_ShouldReturnCombinationOfOtherParts( @@ -257,7 +257,7 @@ public void Join_ParamPaths_OneNullOrEmpty_ShouldReturnCombinationOfOtherParts( result5.Should().Be(expectedPath); } - [SkippableTheory] + [Theory] [InlineAutoData("/foo/", "/bar/", "/baz/", "/muh/", "/maeh/", "/foo//bar//baz//muh//maeh/")] [InlineAutoData("foo/", "/bar/", "/baz/", "/muh", "/maeh", "foo//bar//baz//muh/maeh")] [InlineAutoData("foo/", "bar", "/baz", "/muh", "/maeh", "foo/bar/baz/muh/maeh")] @@ -280,7 +280,7 @@ public void Join_ParamPaths_ShouldReturnExpectedResult( result.Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void Join_ParamPaths_ShouldReturnPathsCombinedByDirectorySeparatorChar( string path1, string path2, string path3, string path4, string path5) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/Tests.cs index ae8eb0eab..97b6c54ef 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/Tests.cs @@ -5,7 +5,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class Tests { - [SkippableFact] + [Fact] public void AltDirectorySeparatorChar_ShouldReturnSlash() { char result = FileSystem.Path.AltDirectorySeparatorChar; @@ -13,7 +13,7 @@ public void AltDirectorySeparatorChar_ShouldReturnSlash() result.Should().Be('/'); } - [SkippableFact] + [Fact] public void DirectorySeparatorChar_WhenNotOnWindows_ShouldReturnSlash() { Skip.If(Test.RunsOnWindows); @@ -23,7 +23,7 @@ public void DirectorySeparatorChar_WhenNotOnWindows_ShouldReturnSlash() result.Should().Be('/'); } - [SkippableFact] + [Fact] public void DirectorySeparatorChar_WhenOnWindows_ShouldReturnBackslash() { Skip.IfNot(Test.RunsOnWindows); @@ -33,7 +33,7 @@ public void DirectorySeparatorChar_WhenOnWindows_ShouldReturnBackslash() result.Should().Be('\\'); } - [SkippableFact] + [Fact] public void GetInvalidFileNameChars_WhenNotOnWindows_ShouldReturnCorrectValues() { Skip.If(Test.RunsOnWindows); @@ -45,7 +45,7 @@ public void GetInvalidFileNameChars_WhenNotOnWindows_ShouldReturnCorrectValues() result.Should().BeEquivalentTo(expected); } - [SkippableFact] + [Fact] public void GetInvalidFileNameChars_WhenOnWindows_ShouldReturnCorrectValues() { Skip.IfNot(Test.RunsOnWindows); @@ -64,7 +64,7 @@ public void GetInvalidFileNameChars_WhenOnWindows_ShouldReturnCorrectValues() result.Should().BeEquivalentTo(expected); } - [SkippableFact] + [Fact] public void GetInvalidPathChars_WhenNotOnWindows_ShouldReturnCorrectValues() { Skip.If(Test.RunsOnWindows); @@ -76,7 +76,7 @@ public void GetInvalidPathChars_WhenNotOnWindows_ShouldReturnCorrectValues() result.Should().BeEquivalentTo(expected); } - [SkippableFact] + [Fact] public void GetInvalidPathChars_WhenOnWindows_ShouldReturnCorrectValues() { Skip.IfNot(Test.RunsOnWindows); @@ -98,7 +98,7 @@ public void GetInvalidPathChars_WhenOnWindows_ShouldReturnCorrectValues() result.Should().BeEquivalentTo(expected); } - [SkippableFact] + [Fact] public void PathSeparator_WhenNotOnWindows_ShouldReturnColon() { Skip.If(Test.RunsOnWindows); @@ -108,7 +108,7 @@ public void PathSeparator_WhenNotOnWindows_ShouldReturnColon() result.Should().Be(':'); } - [SkippableFact] + [Fact] public void PathSeparator_WhenOnWindows_ShouldReturnSemicolon() { Skip.IfNot(Test.RunsOnWindows); @@ -118,7 +118,7 @@ public void PathSeparator_WhenOnWindows_ShouldReturnSemicolon() result.Should().Be(';'); } - [SkippableFact] + [Fact] public void VolumeSeparatorChar_WhenNotOnWindows_ShouldReturnSlash() { Skip.If(Test.RunsOnWindows); @@ -128,7 +128,7 @@ public void VolumeSeparatorChar_WhenNotOnWindows_ShouldReturnSlash() result.Should().Be('/'); } - [SkippableFact] + [Fact] public void VolumeSeparatorChar_WhenOnWindows_ShouldReturnColon() { Skip.IfNot(Test.RunsOnWindows); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/TrimEndingDirectorySeparatorTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/TrimEndingDirectorySeparatorTests.cs index 5b759bb74..1e541953f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/TrimEndingDirectorySeparatorTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/TrimEndingDirectorySeparatorTests.cs @@ -4,7 +4,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class TrimEndingDirectorySeparatorTests { - [SkippableTheory] + [Theory] [AutoData] public void TrimEndingDirectorySeparator_DirectoryChar_ShouldTrim( string directory) @@ -16,7 +16,7 @@ public void TrimEndingDirectorySeparator_DirectoryChar_ShouldTrim( result.Should().Be(directory); } - [SkippableFact] + [Fact] public void TrimEndingDirectorySeparator_EmptyString_ShouldReturnEmptyString() { string result = FileSystem.Path.TrimEndingDirectorySeparator(string.Empty); @@ -24,7 +24,7 @@ public void TrimEndingDirectorySeparator_EmptyString_ShouldReturnEmptyString() result.Should().Be(string.Empty); } - [SkippableFact] + [Fact] public void TrimEndingDirectorySeparator_Root_ShouldReturnUnchanged() { string path = FileTestHelper.RootDrive(Test); @@ -34,7 +34,7 @@ public void TrimEndingDirectorySeparator_Root_ShouldReturnUnchanged() result.Should().Be(path); } - [SkippableTheory] + [Theory] [AutoData] public void TrimEndingDirectorySeparator_Span_DirectoryChar_ShouldTrim( string directory) @@ -47,7 +47,7 @@ public void TrimEndingDirectorySeparator_Span_DirectoryChar_ShouldTrim( result.ToString().Should().Be(directory); } - [SkippableFact] + [Fact] public void TrimEndingDirectorySeparator_Span_Root_ShouldReturnUnchanged() { string path = FileTestHelper.RootDrive(Test); @@ -58,7 +58,7 @@ public void TrimEndingDirectorySeparator_Span_Root_ShouldReturnUnchanged() result.ToString().Should().Be(path); } - [SkippableTheory] + [Theory] [AutoData] public void TrimEndingDirectorySeparator_Span_WithoutDirectoryChar_ShouldReturnUnchanged( @@ -70,7 +70,7 @@ public void result.ToString().Should().Be(path); } - [SkippableTheory] + [Theory] [AutoData] public void TrimEndingDirectorySeparator_WithoutDirectoryChar_ShouldReturnUnchanged( string path) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/TryJoinTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/TryJoinTests.cs index f0c9ec809..8bcf56ccf 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/TryJoinTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/TryJoinTests.cs @@ -4,7 +4,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; [FileSystemTests] public partial class TryJoinTests { - [SkippableTheory] + [Theory] [AutoData] public void TryJoin_2Paths_BufferTooLittle_ShouldReturnFalse( string path1, string path2) @@ -25,7 +25,7 @@ public void TryJoin_2Paths_BufferTooLittle_ShouldReturnFalse( charsWritten.Should().Be(0); } - [SkippableTheory] + [Theory] [InlineAutoData("/foo/", "/bar/", "/foo//bar/")] [InlineAutoData("foo/", "/bar", "foo//bar")] [InlineAutoData("foo/", "bar", "foo/bar")] @@ -52,7 +52,7 @@ public void TryJoin_2Paths_ShouldReturnExpectedResult( destination.Slice(0, charsWritten).ToString().Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void TryJoin_2Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( string path1, string path2) @@ -74,7 +74,7 @@ public void TryJoin_2Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( destination.Slice(0, charsWritten).ToString().Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void TryJoin_3Paths_BufferTooLittle_ShouldReturnFalse( string path1, string path2, string path3) @@ -97,7 +97,7 @@ public void TryJoin_3Paths_BufferTooLittle_ShouldReturnFalse( charsWritten.Should().Be(0); } - [SkippableTheory] + [Theory] [InlineAutoData("/foo/", "/bar/", "/baz/", "/foo//bar//baz/")] [InlineAutoData("foo/", "/bar/", "/baz", "foo//bar//baz")] [InlineAutoData("foo/", "bar", "/baz", "foo/bar/baz")] @@ -127,7 +127,7 @@ public void TryJoin_3Paths_ShouldReturnExpectedResult( destination.Slice(0, charsWritten).ToString().Should().Be(expectedResult); } - [SkippableTheory] + [Theory] [AutoData] public void TryJoin_3Paths_ShouldReturnPathsCombinedByDirectorySeparatorChar( string path1, string path2, string path3) diff --git a/Tests/Testably.Abstractions.Tests/Internal/FileStreamWrapperTests.cs b/Tests/Testably.Abstractions.Tests/Internal/FileStreamWrapperTests.cs index b468aa5db..b29be626e 100644 --- a/Tests/Testably.Abstractions.Tests/Internal/FileStreamWrapperTests.cs +++ b/Tests/Testably.Abstractions.Tests/Internal/FileStreamWrapperTests.cs @@ -1,7 +1,6 @@ using System.IO; using Testably.Abstractions.Helpers; using Testably.Abstractions.Testing.Initializer; -using Xunit.Abstractions; namespace Testably.Abstractions.Tests.Internal; diff --git a/Tests/Testably.Abstractions.Tests/RandomSystem/GuidTests.cs b/Tests/Testably.Abstractions.Tests/RandomSystem/GuidTests.cs index b030a9ec0..a1fe752d3 100644 --- a/Tests/Testably.Abstractions.Tests/RandomSystem/GuidTests.cs +++ b/Tests/Testably.Abstractions.Tests/RandomSystem/GuidTests.cs @@ -12,13 +12,13 @@ namespace Testably.Abstractions.Tests.RandomSystem; [RandomSystemTests] public partial class GuidTests { - [SkippableFact] + [Fact] public void Empty_ShouldReturnEmptyGuid() { RandomSystem.Guid.Empty.Should().Be(Guid.Empty); } - [SkippableFact] + [Fact] public void NewGuid_ShouldBeThreadSafeAndReturnUniqueItems() { ConcurrentBag results = []; @@ -32,7 +32,7 @@ public void NewGuid_ShouldBeThreadSafeAndReturnUniqueItems() } #if FEATURE_GUID_PARSE - [SkippableTheory] + [Theory] [AutoData] public void Parse_SpanArray_ShouldReturnCorrectGuid(Guid guid) { @@ -47,7 +47,7 @@ public void Parse_SpanArray_ShouldReturnCorrectGuid(Guid guid) #endif #if FEATURE_GUID_PARSE - [SkippableTheory] + [Theory] [AutoData] public void Parse_String_ShouldReturnCorrectGuid(Guid guid) { @@ -62,7 +62,7 @@ public void Parse_String_ShouldReturnCorrectGuid(Guid guid) #endif #if FEATURE_GUID_FORMATPROVIDER - [SkippableTheory] + [Theory] [AutoData] public void Parse_WithFormatProvider_SpanArray_ShouldReturnCorrectGuid(Guid guid) { @@ -75,7 +75,7 @@ public void Parse_WithFormatProvider_SpanArray_ShouldReturnCorrectGuid(Guid guid #endif #if FEATURE_GUID_FORMATPROVIDER - [SkippableTheory] + [Theory] [AutoData] public void Parse_WithFormatProvider_String_ShouldReturnCorrectGuid(Guid guid) { @@ -88,7 +88,7 @@ public void Parse_WithFormatProvider_String_ShouldReturnCorrectGuid(Guid guid) #endif #if FEATURE_GUID_PARSE - [SkippableTheory] + [Theory] [MemberAutoData(nameof(GuidFormats))] public void ParseExact_SpanArray_ShouldReturnCorrectGuid( string format, Guid guid) @@ -102,7 +102,7 @@ public void ParseExact_SpanArray_ShouldReturnCorrectGuid( #endif #if FEATURE_GUID_PARSE - [SkippableTheory] + [Theory] [MemberAutoData(nameof(GuidFormats))] public void ParseExact_String_ShouldReturnCorrectGuid(string format, Guid guid) { @@ -115,7 +115,7 @@ public void ParseExact_String_ShouldReturnCorrectGuid(string format, Guid guid) #endif #if FEATURE_GUID_PARSE - [SkippableTheory] + [Theory] [AutoData] public void TryParse_SpanArray_ShouldReturnTrue(Guid guid) { @@ -131,7 +131,7 @@ public void TryParse_SpanArray_ShouldReturnTrue(Guid guid) #endif #if FEATURE_GUID_PARSE - [SkippableTheory] + [Theory] [AutoData] public void TryParse_String_ShouldReturnTrue(Guid guid) { @@ -147,7 +147,7 @@ public void TryParse_String_ShouldReturnTrue(Guid guid) #endif #if FEATURE_GUID_FORMATPROVIDER - [SkippableTheory] + [Theory] [AutoData] public void TryParse_WithFormatProvider_SpanArray_ShouldReturnTrue(Guid guid) { @@ -162,7 +162,7 @@ public void TryParse_WithFormatProvider_SpanArray_ShouldReturnTrue(Guid guid) #endif #if FEATURE_GUID_FORMATPROVIDER - [SkippableTheory] + [Theory] [AutoData] public void TryParse_WithFormatProvider_String_ShouldReturnTrue(Guid guid) { @@ -177,7 +177,7 @@ public void TryParse_WithFormatProvider_String_ShouldReturnTrue(Guid guid) #endif #if FEATURE_GUID_PARSE - [SkippableTheory] + [Theory] [MemberAutoData(nameof(GuidFormats))] public void TryParseExact_SpanArray_ShouldReturnTrue(string format, Guid guid) { @@ -193,7 +193,7 @@ public void TryParseExact_SpanArray_ShouldReturnTrue(string format, Guid guid) #endif #if FEATURE_GUID_PARSE - [SkippableTheory] + [Theory] [MemberAutoData(nameof(GuidFormats))] public void TryParseExact_String_ShouldReturnTrue(string format, Guid guid) { diff --git a/Tests/Testably.Abstractions.Tests/RandomSystem/RandomFactoryTests.cs b/Tests/Testably.Abstractions.Tests/RandomSystem/RandomFactoryTests.cs index e8c766739..56f86b555 100644 --- a/Tests/Testably.Abstractions.Tests/RandomSystem/RandomFactoryTests.cs +++ b/Tests/Testably.Abstractions.Tests/RandomSystem/RandomFactoryTests.cs @@ -7,7 +7,7 @@ namespace Testably.Abstractions.Tests.RandomSystem; [RandomSystemTests] public partial class RandomFactoryTests { - [SkippableFact] + [Fact] public void New_Next_ShouldReturnDifferentValues() { List results = []; @@ -20,7 +20,7 @@ public void New_Next_ShouldReturnDifferentValues() results.Should().OnlyHaveUniqueItems(); } - [SkippableTheory] + [Theory] [AutoData] public void New_Next_WithSeed_ShouldReturnSameValue(int seed) { @@ -34,7 +34,7 @@ public void New_Next_WithSeed_ShouldReturnSameValue(int seed) results.Should().AllBeEquivalentTo(results[0]); } - [SkippableFact] + [Fact] public void New_Shared_ShouldReturnDifferentValues() { List results = []; @@ -47,7 +47,7 @@ public void New_Shared_ShouldReturnDifferentValues() results.Should().OnlyHaveUniqueItems(); } - [SkippableFact] + [Fact] public void Shared_ShouldReturnSameReference() { IRandom shared1 = RandomSystem.Random.Shared; diff --git a/Tests/Testably.Abstractions.Tests/RandomSystem/RandomTests.cs b/Tests/Testably.Abstractions.Tests/RandomSystem/RandomTests.cs index a6e2abb50..1c653efd3 100644 --- a/Tests/Testably.Abstractions.Tests/RandomSystem/RandomTests.cs +++ b/Tests/Testably.Abstractions.Tests/RandomSystem/RandomTests.cs @@ -141,7 +141,7 @@ public void GetItems_SpanDestination_ShouldSelectRandomElements() destination.ToArray().Should().OnlyContain(r => r >= 1 && r <= 100); } #endif - [SkippableFact] + [Fact] public void Next_MaxValue_ShouldOnlyReturnValidValues() { int maxValue = 10; @@ -155,7 +155,7 @@ public void Next_MaxValue_ShouldOnlyReturnValidValues() results.Should().OnlyContain(r => r < maxValue); } - [SkippableFact] + [Fact] public void Next_MinAndMaxValue_ShouldOnlyReturnValidValues() { int minValue = 10; @@ -170,7 +170,7 @@ public void Next_MinAndMaxValue_ShouldOnlyReturnValidValues() results.Should().OnlyContain(r => r >= minValue && r < maxValue); } - [SkippableFact] + [Fact] public void Next_ShouldBeThreadSafe() { ConcurrentBag results = []; @@ -183,7 +183,7 @@ public void Next_ShouldBeThreadSafe() results.Should().OnlyHaveUniqueItems(); } - [SkippableFact] + [Fact] public void NextBytes_ShouldBeThreadSafe() { ConcurrentBag results = []; @@ -199,7 +199,7 @@ public void NextBytes_ShouldBeThreadSafe() } #if FEATURE_SPAN - [SkippableFact] + [Fact] public void NextBytes_Span_ShouldBeThreadSafe() { ConcurrentBag results = []; @@ -215,7 +215,7 @@ public void NextBytes_Span_ShouldBeThreadSafe() } #endif - [SkippableFact] + [Fact] public void NextDouble_ShouldBeThreadSafe() { ConcurrentBag results = []; @@ -229,7 +229,7 @@ public void NextDouble_ShouldBeThreadSafe() } #if FEATURE_RANDOM_ADVANCED - [SkippableFact] + [Fact] public void NextInt64_MaxValue_ShouldOnlyReturnValidValues() { long maxValue = 10; @@ -245,7 +245,7 @@ public void NextInt64_MaxValue_ShouldOnlyReturnValidValues() #endif #if FEATURE_RANDOM_ADVANCED - [SkippableFact] + [Fact] public void NextInt64_MinAndMaxValue_ShouldOnlyReturnValidValues() { long minValue = 10; @@ -262,7 +262,7 @@ public void NextInt64_MinAndMaxValue_ShouldOnlyReturnValidValues() #endif #if FEATURE_RANDOM_ADVANCED - [SkippableFact] + [Fact] public void NextInt64_ShouldBeThreadSafe() { ConcurrentBag results = []; @@ -277,7 +277,7 @@ public void NextInt64_ShouldBeThreadSafe() #endif #if FEATURE_RANDOM_ADVANCED - [SkippableFact] + [Fact] public void NextSingle_ShouldBeThreadSafe() { ConcurrentBag results = []; diff --git a/Tests/Testably.Abstractions.Tests/TestHelpers/Usings.cs b/Tests/Testably.Abstractions.Tests/TestHelpers/Usings.cs index 5761b3561..36f6b906f 100644 --- a/Tests/Testably.Abstractions.Tests/TestHelpers/Usings.cs +++ b/Tests/Testably.Abstractions.Tests/TestHelpers/Usings.cs @@ -1,4 +1,4 @@ -global using AutoFixture.Xunit2; +global using AutoFixture.Xunit3; global using FluentAssertions; global using System; global using System.IO.Abstractions; diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/DateTimeTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/DateTimeTests.cs index 6492306c7..c00554fd2 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/DateTimeTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/DateTimeTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.TimeSystem; [TimeSystemTests] public partial class DateTimeTests { - [SkippableFact] + [Fact] public void MaxValue_ShouldReturnDefaultValue() { DateTime expectedResult = DateTime.MaxValue; @@ -13,7 +13,7 @@ public void MaxValue_ShouldReturnDefaultValue() result.Should().Be(expectedResult); } - [SkippableFact] + [Fact] public void MinValue_ShouldReturnDefaultValue() { DateTime expectedResult = DateTime.MinValue; @@ -23,7 +23,7 @@ public void MinValue_ShouldReturnDefaultValue() result.Should().Be(expectedResult); } - [SkippableFact] + [Fact] public void Now_ShouldBeSetToNow() { // Tests are brittle on the build system @@ -37,7 +37,7 @@ public void Now_ShouldBeSetToNow() result.Should().BeBetween(before, after, tolerance); } - [SkippableFact] + [Fact] public void Today_ShouldBeSetToToday() { DateTime before = DateTime.Today; @@ -50,7 +50,7 @@ public void Today_ShouldBeSetToToday() result.Should().BeBetween(before, after); } - [SkippableFact] + [Fact] public void UnixEpoch_ShouldReturnDefaultValue() { #pragma warning disable MA0113 // Use DateTime.UnixEpoch @@ -62,7 +62,7 @@ public void UnixEpoch_ShouldReturnDefaultValue() result.Should().Be(expectedResult); } - [SkippableFact] + [Fact] public void UtcNow_ShouldBeSetToUtcNow() { // Tests are brittle on the build system diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs index 80a86357d..e27a14457 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs @@ -6,7 +6,7 @@ namespace Testably.Abstractions.Tests.TimeSystem; [TimeSystemTests] public partial class TaskTests { - [SkippableFact] + [Fact] public async Task Delay_Milliseconds_Cancelled_ShouldThrowTaskCanceledException() { @@ -14,28 +14,28 @@ public async Task using CancellationTokenSource cts = new(); await cts.CancelAsync(); - - Exception? exception = await Record.ExceptionAsync(async () => - { - await TimeSystem.Task.Delay(millisecondsTimeout, cts.Token); - }); + + async Task Act() + => await TimeSystem.Task.Delay(millisecondsTimeout, cts.Token); + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2146233029); } - [SkippableFact] + [Fact] public async Task Delay_Milliseconds_LessThanNegativeOne_ShouldThrowArgumentOutOfRangeException() { - Exception? exception = await Record.ExceptionAsync(async () => - { - await TimeSystem.Task.Delay(-2); - }); + async Task Act() + => await TimeSystem.Task.Delay(-2); + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2146233086); } - [SkippableFact] + [Fact] public async Task Delay_Milliseconds_ShouldDelayForSpecifiedMilliseconds() { @@ -49,7 +49,7 @@ public async Task before.AddMilliseconds(millisecondsTimeout).ApplySystemClockTolerance()); } - [SkippableFact] + [Fact] public async Task Delay_Timespan_Cancelled_ShouldThrowTaskCanceledException() { @@ -57,28 +57,27 @@ public async Task using CancellationTokenSource cts = new(); await cts.CancelAsync(); - Exception? exception = await Record.ExceptionAsync(async () => - { - await TimeSystem.Task.Delay(timeout, cts.Token); - }); + async Task Act() + => await TimeSystem.Task.Delay(timeout, cts.Token); + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2146233029); } - [SkippableFact] + [Fact] public async Task Delay_Timespan_LessThanNegativeOne_ShouldThrowArgumentOutOfRangeException() { - Exception? exception = await Record.ExceptionAsync(async () => - { - await TimeSystem.Task - .Delay(TimeSpan.FromMilliseconds(-2)); - }); + async Task Act() + => await TimeSystem.Task.Delay(TimeSpan.FromMilliseconds(-2)); + + Exception? exception = await Record.ExceptionAsync(Act); exception.Should().BeException(hResult: -2146233086); } - [SkippableFact] + [Fact] public async Task Delay_Timespan_ShouldDelayForSpecifiedMilliseconds() { diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/ThreadTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/ThreadTests.cs index 8c1a881a3..d27009d3d 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/ThreadTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/ThreadTests.cs @@ -3,7 +3,7 @@ namespace Testably.Abstractions.Tests.TimeSystem; [TimeSystemTests] public partial class ThreadTests { - [SkippableFact] + [Fact] public void Sleep_LessThanNegativeOne_ShouldThrowArgumentOutOfRangeException() { Exception? exception = Record.Exception(() => TimeSystem.Thread.Sleep(-2)); @@ -11,7 +11,7 @@ public void Sleep_LessThanNegativeOne_ShouldThrowArgumentOutOfRangeException() exception.Should().BeException(hResult: -2146233086); } - [SkippableFact] + [Fact] public void Sleep_Milliseconds_ShouldSleepForSpecifiedMilliseconds() { int millisecondsTimeout = 100; @@ -24,7 +24,7 @@ public void Sleep_Milliseconds_ShouldSleepForSpecifiedMilliseconds() before.AddMilliseconds(millisecondsTimeout).ApplySystemClockTolerance()); } - [SkippableFact] + [Fact] public void Sleep_Timespan_LessThanNegativeOne_ShouldThrowArgumentOutOfRangeException() { @@ -34,7 +34,7 @@ public void exception.Should().BeException(hResult: -2146233086); } - [SkippableFact] + [Fact] public void Sleep_Timespan_ShouldSleepForSpecifiedMilliseconds() { TimeSpan timeout = TimeSpan.FromMilliseconds(100); diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs index a7f8c37a8..079b9c7d1 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs @@ -8,7 +8,7 @@ namespace Testably.Abstractions.Tests.TimeSystem; public partial class TimeFactoryTests { #if FEATURE_TIMER_COUNT - [SkippableFact] + [Fact] public void ActiveCount_ShouldBeIncrementedWhenCreatingANewTimer() { using ITimer timer = TimeSystem.Timer.New(_ => { }); @@ -17,7 +17,7 @@ public void ActiveCount_ShouldBeIncrementedWhenCreatingANewTimer() #endif #if FEATURE_TIMER_COUNT - [SkippableFact] + [Fact] public void ActiveCount_ShouldBeResetWhenDisposingATimer() { const int timersPerThread = 64; @@ -79,7 +79,7 @@ void CreateTimerThreadStart() } #endif - [SkippableTheory] + [Theory] [InlineData(-2)] [InlineData(-500)] public void New_InvalidDueTime_ShouldThrowArgumentOutOfRangeException(int dueTime) @@ -96,7 +96,7 @@ public void New_InvalidDueTime_ShouldThrowArgumentOutOfRangeException(int dueTim paramName: nameof(dueTime)); } - [SkippableTheory] + [Theory] [InlineData(-2)] [InlineData(-500)] public void New_InvalidPeriod_ShouldThrowArgumentOutOfRangeException(int period) @@ -113,7 +113,7 @@ public void New_InvalidPeriod_ShouldThrowArgumentOutOfRangeException(int period) paramName: nameof(period)); } - [SkippableFact] + [Fact] public void New_WithPeriod_ShouldStartTimer() { int count = 0; @@ -139,7 +139,7 @@ public void New_WithPeriod_ShouldStartTimer() count.Should().BeGreaterOrEqualTo(2); } - [SkippableFact] + [Fact] public async Task New_WithDueTime_ShouldStartTimerOnce() { int count = 0; @@ -163,7 +163,7 @@ public async Task New_WithDueTime_ShouldStartTimerOnce() count.Should().Be(1); } - [SkippableFact] + [Fact] public void New_WithoutPeriod_ShouldNotStartTimer() { using ManualResetEventSlim ms = new(); diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs index 3c5501f45..1f15e2266 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs @@ -15,7 +15,7 @@ public partial class TimerTests #endregion #if NET8_0_OR_GREATER - [SkippableFact] + [Fact] public void Change_DisposedTimer_ShouldReturnFalse() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -36,7 +36,7 @@ public void Change_DisposedTimer_ShouldReturnFalse() #endif #if !NET8_0_OR_GREATER - [SkippableFact] + [Fact] public void Change_DisposedTimer_ShouldThrowObjectDisposedException() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -54,7 +54,7 @@ public void Change_DisposedTimer_ShouldThrowObjectDisposedException() } #endif - [SkippableFact] + [Fact] public void Change_Infinite_ShouldBeValidDueTime() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -70,7 +70,7 @@ public void Change_Infinite_ShouldBeValidDueTime() exception.Should().BeNull(); } - [SkippableFact] + [Fact] public void Change_Infinite_ShouldBeValidPeriod() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -86,7 +86,7 @@ public void Change_Infinite_ShouldBeValidPeriod() exception.Should().BeNull(); } - [SkippableTheory] + [Theory] [InlineData(-2)] [InlineData(-500)] public void Change_InvalidDueTime_ShouldThrowArgumentOutOfRangeException(int dueTime) @@ -106,7 +106,7 @@ public void Change_InvalidDueTime_ShouldThrowArgumentOutOfRangeException(int due paramName: nameof(dueTime)); } - [SkippableTheory] + [Theory] [InlineData(-2)] [InlineData(-500)] public void Change_InvalidPeriod_ShouldThrowArgumentOutOfRangeException(int period) @@ -126,7 +126,7 @@ public void Change_InvalidPeriod_ShouldThrowArgumentOutOfRangeException(int peri paramName: nameof(period)); } - [SkippableFact] + [Fact] public void Change_SameValues_WithInt_ShouldReturnTrue() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -138,7 +138,7 @@ public void Change_SameValues_WithInt_ShouldReturnTrue() result.Should().BeTrue(); } - [SkippableFact] + [Fact] public void Change_SameValues_WithLong_ShouldReturnTrue() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -150,7 +150,7 @@ public void Change_SameValues_WithLong_ShouldReturnTrue() result.Should().BeTrue(); } - [SkippableFact] + [Fact] public void Change_SameValues_WithTimeSpan_ShouldReturnTrue() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -162,7 +162,7 @@ public void Change_SameValues_WithTimeSpan_ShouldReturnTrue() result.Should().BeTrue(); } - [SkippableFact] + [Fact] public void Change_WithInt_ShouldResetTimer() { SkipIfBrittleTestsShouldBeSkipped(); @@ -236,7 +236,7 @@ public void Change_WithInt_ShouldResetTimer() } } - [SkippableFact] + [Fact] public void Change_WithLong_ShouldResetTimer() { SkipIfBrittleTestsShouldBeSkipped(); @@ -310,7 +310,7 @@ public void Change_WithLong_ShouldResetTimer() } } - [SkippableFact] + [Fact] public void Change_WithTimeSpan_ShouldResetTimer() { SkipIfBrittleTestsShouldBeSkipped(); @@ -386,7 +386,7 @@ public void Change_WithTimeSpan_ShouldResetTimer() } } - [SkippableFact] + [Fact] public void Dispose_WithManualResetEventWaitHandle_ShouldBeSet() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -410,7 +410,7 @@ public void Dispose_WithManualResetEventWaitHandle_ShouldBeSet() #endif } - [SkippableFact] + [Fact] public void Dispose_WithMutexWaitHandle_ShouldBeSet() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -434,7 +434,7 @@ public void Dispose_WithMutexWaitHandle_ShouldBeSet() #endif } - [SkippableFact] + [Fact] public void Dispose_WithSemaphoreWaitHandle_ShouldBeSet() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -458,7 +458,7 @@ public void Dispose_WithSemaphoreWaitHandle_ShouldBeSet() #endif } - [SkippableFact] + [Fact] public void Dispose_WithWaitHandleCalledTwice_ShouldReturnFalse() { using ITimer timer = TimeSystem.Timer.New(_ => @@ -473,7 +473,7 @@ public void Dispose_WithWaitHandleCalledTwice_ShouldReturnFalse() } #if FEATURE_ASYNC_DISPOSABLE - [SkippableFact] + [Fact] public async Task DisposeAsync_ShouldDisposeTimer() { await using ITimer timer = TimeSystem.Timer.New(_ => From 7fdbc5b8c042c47ea778fc4a5017c4954c99bbe5 Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 24 Jan 2025 12:21:06 +0100 Subject: [PATCH 2/9] Fix xUnit1051 --- Tests/Directory.Build.props | 2 +- .../FileSystem/FileSystemWatcherMockTests.cs | 10 +++--- .../MockTimeSystemTests.cs | 8 ++--- .../NotificationTests.cs | 28 ++++++++-------- .../Statistics/StatisticsTests.cs | 2 +- .../TimeSystem/NotificationHandlerTests.cs | 10 +++--- .../TimeSystem/TimerFactoryMockTests.cs | 2 +- .../TimeSystem/TimerMockTests.cs | 8 ++--- .../FileSystem/FileStream/FileAccessTests.cs | 2 +- .../FileSystem/FileStream/ReadTests.cs | 4 +-- .../FileSystem/FileStream/WriteTests.cs | 4 +-- .../EnableRaisingEventsTests.cs | 2 +- .../FileSystemWatcher/FilterTests.cs | 4 +-- .../IncludeSubdirectoriesTests.cs | 2 +- .../FileSystemWatcher/NotifyFiltersTests.cs | 32 +++++++++---------- .../FileSystem/FileSystemWatcher/Tests.cs | 4 +-- .../FileSystemWatcher/WaitForChangedTests.cs | 4 +-- .../Testably.Abstractions.Tests.csproj | 1 + .../TimeSystem/TaskTests.cs | 4 +-- .../TimeSystem/TimerFactoryTests.cs | 8 ++--- .../TimeSystem/TimerTests.cs | 24 +++++++------- .../xunit.runner.json | 4 +++ 22 files changed, 87 insertions(+), 82 deletions(-) create mode 100644 Tests/Testably.Abstractions.Tests/xunit.runner.json diff --git a/Tests/Directory.Build.props b/Tests/Directory.Build.props index 9e39f7ee1..3590f1f85 100644 --- a/Tests/Directory.Build.props +++ b/Tests/Directory.Build.props @@ -16,7 +16,7 @@ enable false Exe - $(NoWarn);701;1702;CA1845;MA0003;MA0004;MA0018;MA0020;MA0042;MA0076;xUnit1044;xUnit1045;xUnit1051;NU1603 + $(NoWarn);701;1702;CA1845;MA0003;MA0004;MA0018;MA0020;MA0042;MA0076;xUnit1044;xUnit1045;NU1603 diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs index f3360a2c7..74c5909d8 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs @@ -83,7 +83,7 @@ public void Error_DefaultTo64Messages_ShouldBeTriggeredWhenBufferOverflows( FileSystem.Directory.CreateDirectory($"{i}_{path}"); } - block2.Wait(10000).Should().BeTrue(); + block2.Wait(10000, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.GetException().Should().BeOfType(); } @@ -141,7 +141,7 @@ public void Error_ShouldBeTriggeredWhenBufferOverflows( FileSystem.Directory.CreateDirectory($"{i}_{path}"); } - block2.Wait(5000).Should().BeTrue(); + block2.Wait(5000, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.GetException().Should().BeOfType(); } @@ -231,7 +231,7 @@ public void InternalBufferSize_ShouldResetQueue(string path1, string path2) FileSystem.Directory.CreateDirectory($"{i}_{path2}"); } - block2.Wait(100).Should().BeFalse(); + block2.Wait(100, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -271,7 +271,7 @@ public void FileSystemEventArgs_ShouldUseDirectorySeparatorFromSimulatedFileSyst fileSystemWatcher.NotifyFilter = NotifyFilters.DirectoryName; fileSystemWatcher.EnableRaisingEvents = true; fileSystem.Directory.CreateDirectory(expectedName); - ms.Wait(5000); + ms.Wait(5000, TestContext.Current.CancellationToken); result.Should().NotBeNull(); result!.FullPath.Should().Be(expectedFullPath); @@ -318,7 +318,7 @@ public void RenamedEventArgs_ShouldUseDirectorySeparatorFromSimulatedFileSystem( fileSystemWatcher.NotifyFilter = NotifyFilters.FileName; fileSystemWatcher.EnableRaisingEvents = true; fileSystem.File.Move(expectedOldFullPath, expectedFullPath); - ms.Wait(5000); + ms.Wait(5000, TestContext.Current.CancellationToken); result.Should().NotBeNull(); result!.FullPath.Should().Be(expectedFullPath); diff --git a/Tests/Testably.Abstractions.Testing.Tests/MockTimeSystemTests.cs b/Tests/Testably.Abstractions.Testing.Tests/MockTimeSystemTests.cs index 6599b30b2..e73383c65 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/MockTimeSystemTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/MockTimeSystemTests.cs @@ -11,7 +11,7 @@ public async Task Delay_Infinite_ShouldNotThrowException() { MockTimeSystem timeSystem = new(); Exception? exception = - await Record.ExceptionAsync(() => timeSystem.Task.Delay(Timeout.Infinite)); + await Record.ExceptionAsync(() => timeSystem.Task.Delay(Timeout.Infinite, TestContext.Current.CancellationToken)); exception.Should().BeNull(); } @@ -22,7 +22,7 @@ public async Task Delay_InfiniteTimeSpan_ShouldNotThrowException() MockTimeSystem timeSystem = new(); Exception? exception = await Record.ExceptionAsync(() - => timeSystem.Task.Delay(Timeout.InfiniteTimeSpan)); + => timeSystem.Task.Delay(Timeout.InfiniteTimeSpan, TestContext.Current.CancellationToken)); exception.Should().BeNull(); } @@ -32,7 +32,7 @@ public async Task Delay_LessThanInfinite_ShouldNotThrowException() { MockTimeSystem timeSystem = new(); Exception? exception = - await Record.ExceptionAsync(() => timeSystem.Task.Delay(-2)); + await Record.ExceptionAsync(() => timeSystem.Task.Delay(-2, TestContext.Current.CancellationToken)); exception.Should().BeOfType() .Which.ParamName.Should().Be("millisecondsDelay"); @@ -44,7 +44,7 @@ public async Task Delay_LessThanInfiniteTimeSpan_ShouldNotThrowException() MockTimeSystem timeSystem = new(); Exception? exception = await Record.ExceptionAsync(() - => timeSystem.Task.Delay(TimeSpan.FromMilliseconds(-2))); + => timeSystem.Task.Delay(TimeSpan.FromMilliseconds(-2), TestContext.Current.CancellationToken)); exception.Should().BeOfType() .Which.ParamName.Should().Be("delay"); diff --git a/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs b/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs index 8e058391e..5745ff965 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs @@ -21,13 +21,13 @@ public void AwaitableCallback_Amount_ShouldOnlyReturnAfterNumberOfCallbacks() _ = Task.Run(async () => { - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); for (int i = 1; i <= 10; i++) { timeSystem.Thread.Sleep(i); - await Task.Delay(1); + await Task.Delay(1, TestContext.Current.CancellationToken); } - }); + }, TestContext.Current.CancellationToken); wait.Wait(count: 7); receivedCount.Should().BeGreaterOrEqualTo(7); @@ -47,7 +47,7 @@ public async Task AwaitableCallback_Dispose_ShouldStopListening() wait.Dispose(); timeSystem.Thread.Sleep(1); - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); isCalled.Should().BeFalse(); } @@ -67,7 +67,7 @@ public async Task AwaitableCallback_DisposeFromExecuteWhileWaiting_ShouldStopLis wait.Dispose(); timeSystem.Thread.Sleep(1); - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); isCalled.Should().BeFalse(); } @@ -84,13 +84,13 @@ public void AwaitableCallback_Filter_ShouldOnlyUpdateAfterFilteredValue() _ = Task.Run(async () => { - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); for (int i = 1; i <= 10; i++) { timeSystem.Thread.Sleep(i); - await Task.Delay(1); + await Task.Delay(1, TestContext.Current.CancellationToken); } - }); + }, TestContext.Current.CancellationToken); wait.Wait(t => t.TotalMilliseconds > 6); receivedCount.Should().BeGreaterOrEqualTo(6); @@ -112,11 +112,11 @@ public void AwaitableCallback_Predicate_ShouldOnlyUpdateAfterFilteredValue() // ReSharper disable once AccessToDisposedClosure try { - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); for (int i = 1; i <= 10; i++) { timeSystem.Thread.Sleep(i); - await Task.Delay(1); + await Task.Delay(1, TestContext.Current.CancellationToken); } ms.Set(); @@ -125,9 +125,9 @@ public void AwaitableCallback_Predicate_ShouldOnlyUpdateAfterFilteredValue() { // Ignore any ObjectDisposedException } - }); + }, TestContext.Current.CancellationToken); - ms.Wait(30000); + ms.Wait(30000, TestContext.Current.CancellationToken); receivedCount.Should().BeLessOrEqualTo(4); } @@ -153,14 +153,14 @@ public void AwaitableCallback_ShouldWaitForCallbackExecution() while (!ms.IsSet) { timeSystem.Thread.Sleep(1); - await Task.Delay(1); + await Task.Delay(1, TestContext.Current.CancellationToken); } } catch (ObjectDisposedException) { // Ignore any ObjectDisposedException } - }); + }, TestContext.Current.CancellationToken); wait.Wait(); isCalled.Should().BeTrue(); diff --git a/Tests/Testably.Abstractions.Testing.Tests/Statistics/StatisticsTests.cs b/Tests/Testably.Abstractions.Testing.Tests/Statistics/StatisticsTests.cs index c9c6aad7d..08ccf3751 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/Statistics/StatisticsTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/Statistics/StatisticsTests.cs @@ -124,7 +124,7 @@ public async Task Statistics_ShouldSupportParallelCalls() tasks[taskId] = Task.Run(() => { sut.Directory.CreateDirectory(directories[taskId]); - }); + }, TestContext.Current.CancellationToken); } await Task.WhenAll(tasks); diff --git a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/NotificationHandlerTests.cs b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/NotificationHandlerTests.cs index 642a3b6a4..d1c4dfb06 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/NotificationHandlerTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/NotificationHandlerTests.cs @@ -102,7 +102,7 @@ public void IDisposable disposable = timeSystem.On.TaskDelay(d => receivedDelay = d); disposable.Dispose(); - _ = timeSystem.Task.Delay(millisecondsDelay); + _ = timeSystem.Task.Delay(millisecondsDelay, TestContext.Current.CancellationToken); receivedDelay.Should().BeNull(); } @@ -119,7 +119,7 @@ public void using (timeSystem.On.TaskDelay(d => receivedDelay1 = d)) { timeSystem.On.TaskDelay(d => receivedDelay2 = d).Dispose(); - _ = timeSystem.Task.Delay(expectedDelay); + _ = timeSystem.Task.Delay(expectedDelay, TestContext.Current.CancellationToken); } receivedDelay1.Should().Be(expectedDelay); @@ -139,7 +139,7 @@ public void { using (timeSystem.On.TaskDelay(d => receivedDelay2 = d)) { - _ = timeSystem.Task.Delay(expectedDelay); + _ = timeSystem.Task.Delay(expectedDelay, TestContext.Current.CancellationToken); } } @@ -173,7 +173,7 @@ public void using (timeSystem.On.TaskDelay(d => receivedDelay = d)) { - _ = timeSystem.Task.Delay(millisecondsDelay); + _ = timeSystem.Task.Delay(millisecondsDelay, TestContext.Current.CancellationToken); } receivedDelay.TotalMilliseconds.Should().Be(millisecondsDelay); @@ -205,7 +205,7 @@ public void using (timeSystem.On.TaskDelay(d => receivedDelay = d)) { - _ = timeSystem.Task.Delay(expectedDelay); + _ = timeSystem.Task.Delay(expectedDelay, TestContext.Current.CancellationToken); } receivedDelay.Should().Be(expectedDelay); diff --git a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerFactoryMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerFactoryMockTests.cs index f8a3f605d..7e7cadf4f 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerFactoryMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerFactoryMockTests.cs @@ -24,7 +24,7 @@ public void New_WithoutPeriod_ShouldStillBeRegistered() } }); - ms.Wait(300).Should().BeFalse(); + ms.Wait(300, TestContext.Current.CancellationToken).Should().BeFalse(); timeSystem.TimerHandler[0].Should().Be(timer); } diff --git a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs index 27e74ee32..7ec9a4d66 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs @@ -144,7 +144,7 @@ public async Task Exception_WhenSwallowExceptionsIsNotSet_ShouldStopTimer() timeSystem.TimerHandler[0].Wait(); }); - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); exception.Should().Be(expectedException); count.Should().Be(1); } @@ -198,7 +198,7 @@ public void Exception_WhenSwallowExceptionsIsSet_ShouldContinueTimerExecution() } }, null, 0, 20); - ms.Wait(10000).Should().BeTrue(); + ms.Wait(10000, TestContext.Current.CancellationToken).Should().BeTrue(); count.Should().BeGreaterThanOrEqualTo(3); } @@ -213,7 +213,7 @@ public async Task New_WithStartOnMockWaitMode_ShouldOnlyStartWhenCallingWait() int count = 0; using ITimer timer = timeSystem.Timer.New(_ => count++, null, 0, 100); - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); count.Should().Be(0); timerHandler[0].Wait(); count.Should().BeGreaterThan(0); @@ -357,7 +357,7 @@ public async Task Wait_WithExecutionCount_ShouldWaitForSpecifiedNumberOfExecutio testOutputHelper.WriteLine("Disposed."); }, timeout: 10000); testOutputHelper.WriteLine("Waiting 100ms..."); - await Task.Delay(1000); + await Task.Delay(1000, TestContext.Current.CancellationToken); testOutputHelper.WriteLine("Waiting completed."); count.Should().Be(executionCount); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs index ac829c950..ac90f1bd1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs @@ -202,7 +202,7 @@ public async Task MultipleParallelReads_ShouldBeAllowed(string path, string cont while (!wait.IsCompleted) { - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); } results.Should().HaveCount(100); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs index c2a3e2c6a..b18d75958 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs @@ -57,7 +57,7 @@ public void BeginRead_ShouldCopyContentsToBuffer( } }, null); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); buffer.Should().BeEquivalentTo(bytes); } @@ -108,7 +108,7 @@ public void EndRead_ShouldNotAdjustTimes(string path, byte[] bytes) } }, null); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); } DateTime creationTime = FileSystem.File.GetCreationTimeUtc(path); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs index aeedac928..9d104658c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs @@ -54,7 +54,7 @@ public void BeginWrite_ShouldCopyContentsToFile( } }, null); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); } FileSystem.Should().HaveFile(path) @@ -105,7 +105,7 @@ public void EndWrite_ShouldAdjustTimes(string path, byte[] bytes) } }, null); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); } DateTime creationTime = FileSystem.File.GetCreationTimeUtc(path); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs index f272912ac..693bd4d3a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs @@ -27,7 +27,7 @@ public void EnableRaisingEvents_SetToFalse_ShouldStop(string path1, string path2 }; fileSystemWatcher.EnableRaisingEvents = true; FileSystem.Directory.Delete(path1); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); ms.Reset(); fileSystemWatcher.EnableRaisingEvents = false; diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs index e7268d6f9..c2e49ebe0 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs @@ -35,7 +35,7 @@ public void Filter_Matching_ShouldTriggerNotification(string path) fileSystemWatcher.Filter = path; fileSystemWatcher.EnableRaisingEvents = true; FileSystem.Directory.Delete(path); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.FullPath.Should().Be(FileSystem.Path.GetFullPath(path)); @@ -107,7 +107,7 @@ public void Filters_ShouldMatchAnyOfTheSpecifiedFilters( FileSystem.Directory.Delete(path); } - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); foreach (string path in otherPaths) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs index 2147597f9..4e62f4eef 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs @@ -104,7 +104,7 @@ public void IncludeSubdirectories_SetToTrue_ShouldTriggerNotificationOnSubdirect fileSystemWatcher.IncludeSubdirectories = true; fileSystemWatcher.EnableRaisingEvents = true; FileSystem.Directory.Delete(subdirectoryPath); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.FullPath.Should().Be(FileSystem.Path.GetFullPath(subdirectoryPath)); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs index 83f599a3a..da9d9eca5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs @@ -50,7 +50,7 @@ public void NotifyFilter_AppendFile_ShouldNotNotifyOnOtherFilters(string fileNam FileSystem.File.AppendAllText(fileName, "foo"); - ms.Wait(EnsureTimeout).Should().BeFalse(); + ms.Wait(EnsureTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -106,7 +106,7 @@ public void NotifyFilter_AppendFile_ShouldTriggerChangedEventOnNotifyFilters( FileSystem.File.AppendAllText(fileName, "foo"); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.FullPath.Should().Be(FileSystem.Path.GetFullPath(fileName)); result.ChangeType.Should().Be(WatcherChangeTypes.Changed); @@ -148,7 +148,7 @@ public void NotifyFilter_CreateDirectory_ShouldNotNotifyOnOtherFilters(string pa FileSystem.Directory.CreateDirectory(path); - ms.Wait(EnsureTimeout).Should().BeFalse(); + ms.Wait(EnsureTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -182,7 +182,7 @@ public void NotifyFilter_CreateDirectory_ShouldTriggerCreatedEventOnNotifyFilter FileSystem.Directory.CreateDirectory(path); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.FullPath.Should().Be(FileSystem.Path.GetFullPath(path)); result.ChangeType.Should().Be(WatcherChangeTypes.Created); @@ -224,7 +224,7 @@ public void NotifyFilter_CreateFile_ShouldNotNotifyOnOtherFilters(string path) FileSystem.File.WriteAllText(path, "foo"); - ms.Wait(EnsureTimeout).Should().BeFalse(); + ms.Wait(EnsureTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -258,7 +258,7 @@ public void NotifyFilter_CreateFile_ShouldTriggerCreatedEventOnNotifyFilters( FileSystem.File.WriteAllText(path, "foo"); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.FullPath.Should().Be(FileSystem.Path.GetFullPath(path)); result.ChangeType.Should().Be(WatcherChangeTypes.Created); @@ -300,7 +300,7 @@ public void NotifyFilter_DeleteDirectory_ShouldNotNotifyOnOtherFilters(string pa FileSystem.Directory.Delete(path); - ms.Wait(EnsureTimeout).Should().BeFalse(); + ms.Wait(EnsureTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -334,7 +334,7 @@ public void NotifyFilter_DeleteDirectory_ShouldTriggerDeletedEventOnNotifyFilter FileSystem.Directory.Delete(path); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.FullPath.Should().Be(FileSystem.Path.GetFullPath(path)); result.ChangeType.Should().Be(WatcherChangeTypes.Deleted); @@ -376,7 +376,7 @@ public void NotifyFilter_DeleteFile_ShouldNotNotifyOnOtherFilters(string path) FileSystem.File.Delete(path); - ms.Wait(EnsureTimeout).Should().BeFalse(); + ms.Wait(EnsureTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -410,7 +410,7 @@ public void NotifyFilter_DeleteFile_ShouldTriggerDeletedEventOnNotifyFilters( FileSystem.File.Delete(path); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.FullPath.Should().Be(FileSystem.Path.GetFullPath(path)); result.ChangeType.Should().Be(WatcherChangeTypes.Deleted); @@ -456,7 +456,7 @@ public void FileSystem.Path.Combine(sourcePath, sourceName), FileSystem.Path.Combine(destinationPath, destinationName)); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.ChangeType.Should().Be(WatcherChangeTypes.Renamed); result.FullPath.Should() @@ -507,7 +507,7 @@ public void FileSystem.Path.Combine(sourcePath, sourceName), FileSystem.Path.Combine(destinationPath, destinationName)); - ms.Wait(EnsureTimeout).Should().BeFalse(); + ms.Wait(EnsureTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -549,7 +549,7 @@ public void NotifyFilter_MoveFile_ShouldNotNotifyOnOtherFilters( FileSystem.File.Move(sourceName, destinationName); - ms.Wait(EnsureTimeout).Should().BeFalse(); + ms.Wait(EnsureTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -586,7 +586,7 @@ public void NotifyFilter_MoveFile_ShouldTriggerChangedEventOnNotifyFilters( FileSystem.File.Move(sourceName, destinationName); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.ChangeType.Should().Be(WatcherChangeTypes.Renamed); result.FullPath.Should().Be(FileSystem.Path.GetFullPath(destinationName)); @@ -640,7 +640,7 @@ public void NotifyFilter_WriteFile_ShouldNotNotifyOnOtherFilters(string fileName FileSystem.File.WriteAllText(fileName, "foo"); - ms.Wait(EnsureTimeout).Should().BeFalse(); + ms.Wait(EnsureTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -696,7 +696,7 @@ public void NotifyFilter_WriteFile_ShouldTriggerChangedEventOnNotifyFilters( FileSystem.File.WriteAllText(fileName, "foo"); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); result.Should().NotBeNull(); result!.FullPath.Should().Be(FileSystem.Path.GetFullPath(fileName)); result.ChangeType.Should().Be(WatcherChangeTypes.Changed); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs index de6042353..0515d4d11 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs @@ -32,7 +32,7 @@ public void BeginInit_ShouldStopListening(string path) { while (!ms.IsSet) { - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); FileSystem.Directory.CreateDirectory(path); FileSystem.Directory.Delete(path); } @@ -90,7 +90,7 @@ public void EndInit_ShouldRestartListening(string path) { while (!ms.IsSet) { - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); FileSystem.Directory.CreateDirectory(path); FileSystem.Directory.Delete(path); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs index 660c210dd..d7194c1db 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs @@ -23,7 +23,7 @@ public void WaitForChanged_ShouldBlockUntilEventHappens(string path) { while (!ms.IsSet) { - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); FileSystem.Directory.CreateDirectory(path); FileSystem.Directory.Delete(path); } @@ -72,7 +72,7 @@ public void WaitForChanged_Timeout_ShouldReturnTimedOut(string path, { while (!ms.IsSet) { - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); FileSystem.Directory.CreateDirectory(fullPath); FileSystem.Directory.Delete(fullPath); } diff --git a/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj b/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj index 90f45be0e..62eb34427 100644 --- a/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj +++ b/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj @@ -25,6 +25,7 @@ + diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs index e27a14457..6416c277c 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs @@ -42,7 +42,7 @@ public async Task int millisecondsTimeout = 100; DateTime before = TimeSystem.DateTime.UtcNow; - await TimeSystem.Task.Delay(millisecondsTimeout); + await TimeSystem.Task.Delay(millisecondsTimeout, TestContext.Current.CancellationToken); DateTime after = TimeSystem.DateTime.UtcNow; after.Should().BeOnOrAfter( @@ -84,7 +84,7 @@ public async Task TimeSpan timeout = TimeSpan.FromMilliseconds(100); DateTime before = TimeSystem.DateTime.UtcNow; - await TimeSystem.Task.Delay(timeout); + await TimeSystem.Task.Delay(timeout, TestContext.Current.CancellationToken); DateTime after = TimeSystem.DateTime.UtcNow; after.Should().BeOnOrAfter(before.Add(timeout).ApplySystemClockTolerance()); diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs index 079b9c7d1..8a8cb0155 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs @@ -135,7 +135,7 @@ public void New_WithPeriod_ShouldStartTimer() } }, null, 0, 50); - ms.Wait(ExpectSuccess).Should().BeTrue(); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); count.Should().BeGreaterOrEqualTo(2); } @@ -158,8 +158,8 @@ public async Task New_WithDueTime_ShouldStartTimerOnce() } }, null, 5, 0); - ms.Wait(ExpectSuccess).Should().BeTrue(); - await Task.Delay(100); + ms.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); + await Task.Delay(100, TestContext.Current.CancellationToken); count.Should().Be(1); } @@ -180,6 +180,6 @@ public void New_WithoutPeriod_ShouldNotStartTimer() } }); - ms.Wait(EnsureTimeout).Should().BeFalse(); + ms.Wait(EnsureTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); } } diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs index 1f15e2266..1041c8bf8 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs @@ -185,14 +185,14 @@ public void Change_WithInt_ShouldResetTimer() ms1.Set(); triggerTimes.Add((int)diff); // ReSharper disable once AccessToDisposedClosure - ms2.Wait(ExpectSuccess).Should().BeTrue(); + ms2.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); if (triggerTimes.Count > 3) { // ReSharper disable once AccessToDisposedClosure ms3.Set(); } - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); } catch (ObjectDisposedException) { @@ -202,7 +202,7 @@ public void Change_WithInt_ShouldResetTimer() null, 0 * TimerMultiplier, 200 * TimerMultiplier)) #pragma warning restore MA0147 // Avoid async void method for delegate { - ms1.Wait(ExpectSuccess).Should().BeTrue(); + ms1.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); using ITimer timer2 = TimeSystem.Timer.New(_ => { // ReSharper disable once AccessToDisposedClosure @@ -218,7 +218,7 @@ public void Change_WithInt_ShouldResetTimer() } }, null, 100 * TimerMultiplier, 0 * TimerMultiplier); - ms3.Wait(ExpectSuccess * TimerMultiplier).Should().BeTrue(); + ms3.Wait(ExpectSuccess * TimerMultiplier, TestContext.Current.CancellationToken).Should().BeTrue(); } if (triggerTimes[0] < 30 * TimerMultiplier) @@ -259,14 +259,14 @@ public void Change_WithLong_ShouldResetTimer() ms1.Set(); triggerTimes.Add((int)diff); // ReSharper disable once AccessToDisposedClosure - ms2.Wait(ExpectSuccess).Should().BeTrue(); + ms2.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); if (triggerTimes.Count > 3) { // ReSharper disable once AccessToDisposedClosure ms3.Set(); } - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); } catch (ObjectDisposedException) { @@ -276,7 +276,7 @@ public void Change_WithLong_ShouldResetTimer() null, 0L * TimerMultiplier, 200L * TimerMultiplier)) #pragma warning restore MA0147 // Avoid async void method for delegate { - ms1.Wait(ExpectSuccess).Should().BeTrue(); + ms1.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); using ITimer timer2 = TimeSystem.Timer.New(_ => { // ReSharper disable once AccessToDisposedClosure @@ -292,7 +292,7 @@ public void Change_WithLong_ShouldResetTimer() } }, null, 100L * TimerMultiplier, 0L * TimerMultiplier); - ms3.Wait(ExpectSuccess).Should().BeTrue(); + ms3.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); } if (triggerTimes[0] < 30 * TimerMultiplier) @@ -333,14 +333,14 @@ public void Change_WithTimeSpan_ShouldResetTimer() ms1.Set(); triggerTimes.Add((int)diff); // ReSharper disable once AccessToDisposedClosure - ms2.Wait(ExpectSuccess).Should().BeTrue(); + ms2.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); if (triggerTimes.Count > 3) { // ReSharper disable once AccessToDisposedClosure ms3.Set(); } - await Task.Delay(10); + await Task.Delay(10, TestContext.Current.CancellationToken); } catch (ObjectDisposedException) { @@ -350,7 +350,7 @@ public void Change_WithTimeSpan_ShouldResetTimer() TimeSpan.FromMilliseconds(200 * TimerMultiplier))) #pragma warning restore MA0147 // Avoid async void method for delegate { - ms1.Wait(ExpectSuccess).Should().BeTrue(); + ms1.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); using ITimer timer2 = TimeSystem.Timer.New(_ => { // ReSharper disable once AccessToDisposedClosure @@ -368,7 +368,7 @@ public void Change_WithTimeSpan_ShouldResetTimer() }, null, TimeSpan.FromMilliseconds(100 * TimerMultiplier), TimeSpan.FromMilliseconds(0 * TimerMultiplier)); - ms3.Wait(ExpectSuccess).Should().BeTrue(); + ms3.Wait(ExpectSuccess, TestContext.Current.CancellationToken).Should().BeTrue(); } if (triggerTimes[0] < 30 * TimerMultiplier) diff --git a/Tests/Testably.Abstractions.Tests/xunit.runner.json b/Tests/Testably.Abstractions.Tests/xunit.runner.json new file mode 100644 index 000000000..7b6e73292 --- /dev/null +++ b/Tests/Testably.Abstractions.Tests/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "culture": "en-US" +} From a91f9bbb20bf850324c501f0b0ccc12e5923397b Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 24 Jan 2025 13:00:01 +0100 Subject: [PATCH 3/9] Fix sonar issues --- .../DirectoryAclExtensionsTests.cs | 2 +- .../DirectoryInfoAclExtensionsTests.cs | 2 +- .../File/AppendAllLinesAsyncTests.cs | 10 +++---- .../File/AppendAllTextAsyncTests.cs | 10 +++---- .../FileSystem/File/OpenReadTests.cs | 4 +-- .../FileSystem/File/ReadAllBytesAsyncTests.cs | 6 ++-- .../FileSystem/File/ReadAllLinesAsyncTests.cs | 10 +++---- .../FileSystem/File/ReadAllTextAsyncTests.cs | 6 ++-- .../FileSystem/File/ReadLinesAsyncTests.cs | 12 ++++---- .../File/WriteAllBytesAsyncTests.cs | 10 +++---- .../File/WriteAllLinesAsyncTests.cs | 22 +++++++-------- .../FileSystem/File/WriteAllTextAsyncTests.cs | 16 +++++------ .../FileSystem/FileStream/AdjustTimesTests.cs | 24 ++++++++-------- .../FileSystem/FileStream/CopyToTests.cs | 28 +++++++++---------- .../FileSystem/FileStream/Tests.cs | 2 +- .../EnableRaisingEventsTests.cs | 4 +-- .../FileSystemWatcher/FilterTests.cs | 2 +- .../IncludeSubdirectoriesTests.cs | 4 +-- .../FileSystem/FileSystemWatcher/Tests.cs | 4 +-- .../FileSystemWatcher/WaitForChangedTests.cs | 4 +-- 20 files changed, 91 insertions(+), 91 deletions(-) diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs index 266d030bb..5aca19a27 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs @@ -138,7 +138,7 @@ public async Task SetAccessControl_ShouldNotUpdateTimes() SkipIfLongRunningTestsShouldBeSkipped(); FileSystem.File.WriteAllText("foo.txt", "abc"); - await TimeSystem.Task.Delay(3000); + await TimeSystem.Task.Delay(3000, TestContext.Current.CancellationToken); DateTime previousCreationTimeUtc = FileSystem.File.GetCreationTimeUtc("foo.txt"); DateTime previousLastAccessTimeUtc = FileSystem.File.GetLastAccessTimeUtc("foo.txt"); DateTime previousLastWriteTimeUtc = FileSystem.File.GetLastWriteTimeUtc("foo.txt"); diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs index e14420574..404352369 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs @@ -172,7 +172,7 @@ public async Task SetAccessControl_ShouldNotUpdateTimes(string path) SkipIfLongRunningTestsShouldBeSkipped(); FileSystem.Directory.CreateDirectory(path); - await TimeSystem.Task.Delay(3000); + await TimeSystem.Task.Delay(3000, TestContext.Current.CancellationToken); DateTime previousCreationTimeUtc = FileSystem.File.GetCreationTimeUtc(path); DateTime previousLastAccessTimeUtc = FileSystem.File.GetLastAccessTimeUtc(path); DateTime previousLastWriteTimeUtc = FileSystem.File.GetLastWriteTimeUtc(path); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs index 1e9767a40..bfbf71958 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs @@ -50,9 +50,9 @@ public async Task AppendAllLinesAsync_ExistingFile_ShouldAppendLinesToFile( { string expectedContent = string.Join(Environment.NewLine, previousContents.Concat(contents)) + Environment.NewLine; - await FileSystem.File.AppendAllLinesAsync(path, previousContents); + await FileSystem.File.AppendAllLinesAsync(path, previousContents, TestContext.Current.CancellationToken); - await FileSystem.File.AppendAllLinesAsync(path, contents); + await FileSystem.File.AppendAllLinesAsync(path, contents, TestContext.Current.CancellationToken); FileSystem.Should().HaveFile(path) .Which.HasContent(expectedContent); @@ -83,7 +83,7 @@ public async Task AppendAllLinesAsync_MissingFile_ShouldCreateFile( string expectedContent = string.Join(Environment.NewLine, contents) + Environment.NewLine; - await FileSystem.File.AppendAllLinesAsync(path, contents); + await FileSystem.File.AppendAllLinesAsync(path, contents, TestContext.Current.CancellationToken); FileSystem.Should().HaveFile(path) .Which.HasContent(expectedContent); @@ -130,7 +130,7 @@ public async Task AppendAllLinesAsync_ShouldEndWithNewline(string path) string[] contents = ["foo", "bar"]; string expectedResult = "foo" + Environment.NewLine + "bar" + Environment.NewLine; - await FileSystem.File.AppendAllLinesAsync(path, contents); + await FileSystem.File.AppendAllLinesAsync(path, contents, TestContext.Current.CancellationToken); FileSystem.Should().HaveFile(path) .Which.HasContent(expectedResult); @@ -166,7 +166,7 @@ public async Task string path = new Fixture().Create(); string[] lines = new Fixture().Create(); lines[1] = specialLine; - await FileSystem.File.AppendAllLinesAsync(path, lines, writeEncoding); + await FileSystem.File.AppendAllLinesAsync(path, lines, writeEncoding, TestContext.Current.CancellationToken); string[] result = FileSystem.File.ReadAllLines(path, readEncoding); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs index 41db3b1a4..3f773529e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs @@ -45,9 +45,9 @@ public async Task public async Task AppendAllTextAsync_ExistingFile_ShouldAppendLinesToFile( string path, string previousContents, string contents) { - await FileSystem.File.AppendAllTextAsync(path, previousContents); + await FileSystem.File.AppendAllTextAsync(path, previousContents, TestContext.Current.CancellationToken); - await FileSystem.File.AppendAllTextAsync(path, contents); + await FileSystem.File.AppendAllTextAsync(path, contents, TestContext.Current.CancellationToken); FileSystem.Should().HaveFile(path) .Which.HasContent(previousContents + contents); @@ -75,7 +75,7 @@ async Task Act() public async Task AppendAllTextAsync_MissingFile_ShouldCreateFile( string path, string contents) { - await FileSystem.File.AppendAllTextAsync(path, contents); + await FileSystem.File.AppendAllTextAsync(path, contents, TestContext.Current.CancellationToken); FileSystem.Should().HaveFile(path) .Which.HasContent(contents); @@ -87,7 +87,7 @@ public async Task AppendAllTextAsync_ShouldNotEndWithNewline(string path) { string contents = "foo"; - await FileSystem.File.AppendAllTextAsync(path, contents); + await FileSystem.File.AppendAllTextAsync(path, contents, TestContext.Current.CancellationToken); FileSystem.Should().HaveFile(path) .Which.HasContent(contents); @@ -120,7 +120,7 @@ public async Task AppendAllTextAsync_WithDifferentEncoding_ShouldNotReturnWritte string contents, Encoding writeEncoding, Encoding readEncoding) { string path = new Fixture().Create(); - await FileSystem.File.AppendAllTextAsync(path, contents, writeEncoding); + await FileSystem.File.AppendAllTextAsync(path, contents, writeEncoding, TestContext.Current.CancellationToken); string[] result = FileSystem.File.ReadAllLines(path, readEncoding); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs index e6538ce8a..e45bfc90a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs @@ -94,12 +94,12 @@ async Task Act() public async Task OpenRead_WriteAsyncWithMemory_ShouldThrowNotSupportedException( string path, byte[] bytes) { - await FileSystem.File.WriteAllTextAsync(path, null); + await FileSystem.File.WriteAllTextAsync(path, null, TestContext.Current.CancellationToken); async Task Act() { using FileSystemStream stream = FileSystem.File.OpenRead(path); - await stream.WriteAsync(bytes.AsMemory()); + await stream.WriteAsync(bytes.AsMemory(), TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs index 991a1fcc3..4bb0d3ecd 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs @@ -28,7 +28,7 @@ public async Task ReadAllBytesAsync_MissingFile_ShouldThrowFileNotFoundException string path) { Exception? exception = await Record.ExceptionAsync(() => - FileSystem.File.ReadAllBytesAsync(path)); + FileSystem.File.ReadAllBytesAsync(path, TestContext.Current.CancellationToken)); exception.Should().BeException( $"'{FileSystem.Path.GetFullPath(path)}'", @@ -40,9 +40,9 @@ public async Task ReadAllBytesAsync_MissingFile_ShouldThrowFileNotFoundException public async Task ReadAllBytesAsync_ShouldReturnWrittenBytes( byte[] bytes, string path) { - await FileSystem.File.WriteAllBytesAsync(path, bytes); + await FileSystem.File.WriteAllBytesAsync(path, bytes, TestContext.Current.CancellationToken); - byte[] result = await FileSystem.File.ReadAllBytesAsync(path); + byte[] result = await FileSystem.File.ReadAllBytesAsync(path, TestContext.Current.CancellationToken); result.Should().BeEquivalentTo(bytes); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs index 49d34878a..ccba9f631 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs @@ -45,7 +45,7 @@ public async Task ReadAllLinesAsync_MissingFile_ShouldThrowFileNotFoundException string path) { Exception? exception = await Record.ExceptionAsync(() => - FileSystem.File.ReadAllLinesAsync(path)); + FileSystem.File.ReadAllLinesAsync(path, TestContext.Current.CancellationToken)); exception.Should().BeException( $"'{FileSystem.Path.GetFullPath(path)}'", @@ -57,9 +57,9 @@ public async Task ReadAllLinesAsync_MissingFile_ShouldThrowFileNotFoundException public async Task ReadAllLinesAsync_ShouldEnumerateLines(string path, string[] lines) { string contents = string.Join(Environment.NewLine, lines); - await FileSystem.File.WriteAllTextAsync(path, contents); + await FileSystem.File.WriteAllTextAsync(path, contents, TestContext.Current.CancellationToken); - string[] results = await FileSystem.File.ReadAllLinesAsync(path); + string[] results = await FileSystem.File.ReadAllLinesAsync(path, TestContext.Current.CancellationToken); results.Should().BeEquivalentTo(lines, o => o.WithStrictOrdering()); } @@ -73,9 +73,9 @@ public async Task ReadAllLinesAsync_WithDifferentEncoding_ShouldNotReturnWritten string[] lines = new Fixture().Create(); lines[1] = specialLine; string contents = string.Join(Environment.NewLine, lines); - await FileSystem.File.WriteAllTextAsync(path, contents, writeEncoding); + await FileSystem.File.WriteAllTextAsync(path, contents, writeEncoding, TestContext.Current.CancellationToken); - string[] result = await FileSystem.File.ReadAllLinesAsync(path, readEncoding); + string[] result = await FileSystem.File.ReadAllLinesAsync(path, readEncoding, TestContext.Current.CancellationToken); result.Should().NotBeEquivalentTo(lines, $"{contents} should be different when encoding from {writeEncoding} to {readEncoding}."); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs index a29cdc094..e7cdff310 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs @@ -45,7 +45,7 @@ public async Task ReadAllTextAsync_MissingFile_ShouldThrowFileNotFoundException( string path) { Exception? exception = await Record.ExceptionAsync(() => - FileSystem.File.ReadAllTextAsync(path)); + FileSystem.File.ReadAllTextAsync(path, TestContext.Current.CancellationToken)); exception.Should().BeException( $"'{FileSystem.Path.GetFullPath(path)}'", @@ -58,9 +58,9 @@ public async Task ReadAllTextAsync_WithDifferentEncoding_ShouldNotReturnWrittenT string contents, Encoding writeEncoding, Encoding readEncoding) { string path = new Fixture().Create(); - await FileSystem.File.WriteAllTextAsync(path, contents, writeEncoding); + await FileSystem.File.WriteAllTextAsync(path, contents, writeEncoding, TestContext.Current.CancellationToken); - string result = await FileSystem.File.ReadAllTextAsync(path, readEncoding); + string result = await FileSystem.File.ReadAllTextAsync(path, readEncoding, TestContext.Current.CancellationToken); result.Should().NotBe(contents, $"{contents} should be different when encoding from {writeEncoding} to {readEncoding}."); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs index f1bc0fc85..66bc5b54a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs @@ -16,7 +16,7 @@ public partial class ReadLinesAsyncTests public async Task ReadLinesAsync_Cancelled_ShouldThrowTaskCanceledException( string path) { - await FileSystem.File.WriteAllTextAsync(path, "some content"); + await FileSystem.File.WriteAllTextAsync(path, "some content", TestContext.Current.CancellationToken); using CancellationTokenSource cts = new(); await cts.CancelAsync(); @@ -39,7 +39,7 @@ public async Task ReadLinesAsync_Cancelled_WithEncoding_ShouldThrowTaskCanceledException( string path) { - await FileSystem.File.WriteAllTextAsync(path, "some content"); + await FileSystem.File.WriteAllTextAsync(path, "some content", TestContext.Current.CancellationToken); using CancellationTokenSource cts = new(); await cts.CancelAsync(); @@ -82,10 +82,10 @@ async Task Act() public async Task ReadLinesAsync_ShouldEnumerateLines(string path, string[] lines) { string contents = string.Join(Environment.NewLine, lines); - await FileSystem.File.WriteAllTextAsync(path, contents); + await FileSystem.File.WriteAllTextAsync(path, contents, TestContext.Current.CancellationToken); List results = []; - await foreach (string line in FileSystem.File.ReadLinesAsync(path)) + await foreach (string line in FileSystem.File.ReadLinesAsync(path, TestContext.Current.CancellationToken)) { results.Add(line); } @@ -102,10 +102,10 @@ public async Task ReadLinesAsync_WithDifferentEncoding_ShouldNotReturnWrittenTex string[] lines = new Fixture().Create(); lines[1] = specialLine; string contents = string.Join(Environment.NewLine, lines); - await FileSystem.File.WriteAllTextAsync(path, contents, writeEncoding); + await FileSystem.File.WriteAllTextAsync(path, contents, writeEncoding, TestContext.Current.CancellationToken); List results = []; - await foreach (string line in FileSystem.File.ReadLinesAsync(path, readEncoding)) + await foreach (string line in FileSystem.File.ReadLinesAsync(path, readEncoding, TestContext.Current.CancellationToken)) { results.Add(line); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs index b0c5fd36b..489195118 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs @@ -29,9 +29,9 @@ public async Task WriteAllBytesAsync_Cancelled_ShouldThrowTaskCanceledException( public async Task WriteAllBytesAsync_PreviousFile_ShouldOverwriteFileWithBytes( string path, byte[] bytes) { - await FileSystem.File.WriteAllBytesAsync(path, Encoding.UTF8.GetBytes("foo")); + await FileSystem.File.WriteAllBytesAsync(path, Encoding.UTF8.GetBytes("foo"), TestContext.Current.CancellationToken); - await FileSystem.File.WriteAllBytesAsync(path, bytes); + await FileSystem.File.WriteAllBytesAsync(path, bytes, TestContext.Current.CancellationToken); FileSystem.Should().HaveFile(path) .Which.HasContent(bytes); @@ -42,7 +42,7 @@ public async Task WriteAllBytesAsync_PreviousFile_ShouldOverwriteFileWithBytes( public async Task WriteAllBytesAsync_ShouldCreateFileWithBytes( string path, byte[] bytes) { - await FileSystem.File.WriteAllBytesAsync(path, bytes); + await FileSystem.File.WriteAllBytesAsync(path, bytes, TestContext.Current.CancellationToken); FileSystem.Should().HaveFile(path) .Which.HasContent(bytes); @@ -92,12 +92,12 @@ public async Task { Skip.IfNot(Test.RunsOnWindows); - await FileSystem.File.WriteAllTextAsync(path, null); + await FileSystem.File.WriteAllTextAsync(path, null, TestContext.Current.CancellationToken); FileSystem.File.SetAttributes(path, FileAttributes.Hidden); async Task Act() { - await FileSystem.File.WriteAllBytesAsync(path, bytes); + await FileSystem.File.WriteAllBytesAsync(path, bytes, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs index 51780bc1e..6f012dc1a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs @@ -76,11 +76,11 @@ public async Task WriteAllLinesAsync_Enumerable_PreviousFile_ShouldOverwriteFileWithText( string path, string[] contents) { - await FileSystem.File.WriteAllTextAsync(path, "foo"); + await FileSystem.File.WriteAllTextAsync(path, "foo", TestContext.Current.CancellationToken); - await FileSystem.File.WriteAllLinesAsync(path, contents.AsEnumerable()); + await FileSystem.File.WriteAllLinesAsync(path, contents.AsEnumerable(), TestContext.Current.CancellationToken); - string[] result = await FileSystem.File.ReadAllLinesAsync(path); + string[] result = await FileSystem.File.ReadAllLinesAsync(path, TestContext.Current.CancellationToken); result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } @@ -89,9 +89,9 @@ public async Task public async Task WriteAllLinesAsync_Enumerable_ShouldCreateFileWithText( string path, string[] contents) { - await FileSystem.File.WriteAllLinesAsync(path, contents.AsEnumerable()); + await FileSystem.File.WriteAllLinesAsync(path, contents.AsEnumerable(), TestContext.Current.CancellationToken); - string[] result = await FileSystem.File.ReadAllLinesAsync(path); + string[] result = await FileSystem.File.ReadAllLinesAsync(path, TestContext.Current.CancellationToken); result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } @@ -100,11 +100,11 @@ public async Task WriteAllLinesAsync_Enumerable_ShouldCreateFileWithText( public async Task WriteAllLinesAsync_PreviousFile_ShouldOverwriteFileWithText( string path, string[] contents) { - await FileSystem.File.WriteAllTextAsync(path, "foo"); + await FileSystem.File.WriteAllTextAsync(path, "foo", TestContext.Current.CancellationToken); - await FileSystem.File.WriteAllLinesAsync(path, contents); + await FileSystem.File.WriteAllLinesAsync(path, contents, TestContext.Current.CancellationToken); - string[] result = await FileSystem.File.ReadAllLinesAsync(path); + string[] result = await FileSystem.File.ReadAllLinesAsync(path, TestContext.Current.CancellationToken); result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } @@ -113,9 +113,9 @@ public async Task WriteAllLinesAsync_PreviousFile_ShouldOverwriteFileWithText( public async Task WriteAllLinesAsync_ShouldCreateFileWithText( string path, string[] contents) { - await FileSystem.File.WriteAllLinesAsync(path, contents); + await FileSystem.File.WriteAllLinesAsync(path, contents, TestContext.Current.CancellationToken); - string[] result = await FileSystem.File.ReadAllLinesAsync(path); + string[] result = await FileSystem.File.ReadAllLinesAsync(path, TestContext.Current.CancellationToken); result.Should().BeEquivalentTo(contents, o => o.WithStrictOrdering()); } @@ -148,7 +148,7 @@ public async Task { Skip.IfNot(Test.RunsOnWindows); - await FileSystem.File.WriteAllTextAsync(path, null); + await FileSystem.File.WriteAllTextAsync(path, null, TestContext.Current.CancellationToken); FileSystem.File.SetAttributes(path, FileAttributes.Hidden); async Task Act() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs index e8ef1f5fe..12d6411c0 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs @@ -43,10 +43,10 @@ public async Task public async Task WriteAllTextAsync_PreviousFile_ShouldOverwriteFileWithText( string path, string contents) { - await FileSystem.File.WriteAllTextAsync(path, "foo"); - await FileSystem.File.WriteAllTextAsync(path, contents); + await FileSystem.File.WriteAllTextAsync(path, "foo", TestContext.Current.CancellationToken); + await FileSystem.File.WriteAllTextAsync(path, contents, TestContext.Current.CancellationToken); - string result = await FileSystem.File.ReadAllTextAsync(path); + string result = await FileSystem.File.ReadAllTextAsync(path, TestContext.Current.CancellationToken); result.Should().Be(contents); } @@ -56,9 +56,9 @@ public async Task WriteAllTextAsync_PreviousFile_ShouldOverwriteFileWithText( public async Task WriteAllTextAsync_ShouldCreateFileWithText( string path, string contents) { - await FileSystem.File.WriteAllTextAsync(path, contents); + await FileSystem.File.WriteAllTextAsync(path, contents, TestContext.Current.CancellationToken); - string result = await FileSystem.File.ReadAllTextAsync(path); + string result = await FileSystem.File.ReadAllTextAsync(path, TestContext.Current.CancellationToken); result.Should().Be(contents); } @@ -80,9 +80,9 @@ public async Task WriteAllTextAsync_SpecialCharacters_ShouldReturnSameText( foreach (char specialCharacter in specialCharacters) { string contents = "_" + specialCharacter; - await FileSystem.File.WriteAllTextAsync(path, contents); + await FileSystem.File.WriteAllTextAsync(path, contents, TestContext.Current.CancellationToken); - string result = await FileSystem.File.ReadAllTextAsync(path); + string result = await FileSystem.File.ReadAllTextAsync(path, TestContext.Current.CancellationToken); result.Should().Be(contents, $"{contents} should be encoded and decoded identical."); @@ -131,7 +131,7 @@ public async Task { Skip.IfNot(Test.RunsOnWindows); - await FileSystem.File.WriteAllTextAsync(path, null); + await FileSystem.File.WriteAllTextAsync(path, null, TestContext.Current.CancellationToken); FileSystem.File.SetAttributes(path, FileAttributes.Hidden); async Task Act() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs index 297ba45a8..b97b5d80c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs @@ -139,13 +139,13 @@ public async Task ReadAsync_AsMemory_ShouldAdjustTimes(string path, byte[] bytes byte[] buffer = new byte[2]; DateTime creationTimeStart = TimeSystem.DateTime.UtcNow; - await FileSystem.File.WriteAllBytesAsync(path, bytes); + await FileSystem.File.WriteAllBytesAsync(path, bytes, TestContext.Current.CancellationToken); DateTime creationTimeEnd = TimeSystem.DateTime.UtcNow; - await TimeSystem.Task.Delay(FileTestHelper.AdjustTimesDelay); + await TimeSystem.Task.Delay(FileTestHelper.AdjustTimesDelay, TestContext.Current.CancellationToken); DateTime updateTime = TimeSystem.DateTime.UtcNow; await using FileSystemStream stream = FileSystem.File.OpenRead(path); - _ = await stream.ReadAsync(buffer.AsMemory()); + _ = await stream.ReadAsync(buffer.AsMemory(), TestContext.Current.CancellationToken); DateTime lastAccessTime = WaitToBeUpdatedToAfter( () => FileSystem.File.GetLastAccessTimeUtc(path), updateTime); @@ -181,14 +181,14 @@ public async Task ReadAsync_ShouldAdjustTimes(string path, byte[] bytes) byte[] buffer = new byte[2]; DateTime creationTimeStart = TimeSystem.DateTime.UtcNow; - await FileSystem.File.WriteAllBytesAsync(path, bytes); + await FileSystem.File.WriteAllBytesAsync(path, bytes, TestContext.Current.CancellationToken); DateTime creationTimeEnd = TimeSystem.DateTime.UtcNow; - await TimeSystem.Task.Delay(FileTestHelper.AdjustTimesDelay); + await TimeSystem.Task.Delay(FileTestHelper.AdjustTimesDelay, TestContext.Current.CancellationToken); DateTime updateTime = TimeSystem.DateTime.UtcNow; await using FileSystemStream stream = FileSystem.File.OpenRead(path); #pragma warning disable CA1835 - _ = await stream.ReadAsync(buffer, 0, 2); + _ = await stream.ReadAsync(buffer, 0, 2, TestContext.Current.CancellationToken); #pragma warning restore CA1835 DateTime lastAccessTime = WaitToBeUpdatedToAfter( @@ -375,14 +375,14 @@ public async Task WriteAsync_AsMemory_ShouldAdjustTimes(string path, byte[] byte SkipIfLongRunningTestsShouldBeSkipped(); DateTime creationTimeStart = TimeSystem.DateTime.UtcNow; - await FileSystem.File.WriteAllBytesAsync(path, Array.Empty()); + await FileSystem.File.WriteAllBytesAsync(path, Array.Empty(), TestContext.Current.CancellationToken); DateTime creationTimeEnd = TimeSystem.DateTime.UtcNow; - await TimeSystem.Task.Delay(FileTestHelper.AdjustTimesDelay); + await TimeSystem.Task.Delay(FileTestHelper.AdjustTimesDelay, TestContext.Current.CancellationToken); DateTime updateTime = TimeSystem.DateTime.UtcNow; await using (FileSystemStream stream = FileSystem.File.OpenWrite(path)) { - await stream.WriteAsync(bytes.AsMemory()); + await stream.WriteAsync(bytes.AsMemory(), TestContext.Current.CancellationToken); } DateTime lastWriteTime = WaitToBeUpdatedToAfter( @@ -418,15 +418,15 @@ public async Task WriteAsync_ShouldAdjustTimes(string path, byte[] bytes) SkipIfLongRunningTestsShouldBeSkipped(); DateTime creationTimeStart = TimeSystem.DateTime.UtcNow; - await FileSystem.File.WriteAllBytesAsync(path, Array.Empty()); + await FileSystem.File.WriteAllBytesAsync(path, Array.Empty(), TestContext.Current.CancellationToken); DateTime creationTimeEnd = TimeSystem.DateTime.UtcNow; - await TimeSystem.Task.Delay(FileTestHelper.AdjustTimesDelay); + await TimeSystem.Task.Delay(FileTestHelper.AdjustTimesDelay, TestContext.Current.CancellationToken); DateTime updateTime = TimeSystem.DateTime.UtcNow; await using (FileSystemStream stream = FileSystem.File.OpenWrite(path)) { #pragma warning disable CA1835 - await stream.WriteAsync(bytes, 0, 2); + await stream.WriteAsync(bytes, 0, 2, TestContext.Current.CancellationToken); #pragma warning restore CA1835 } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs index 516246575..fa3785f1a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs @@ -50,7 +50,7 @@ public async Task CopyToAsync_BufferSizeZero_ShouldThrowArgumentOutOfRangeExcept string path, byte[] bytes) { byte[] buffer = new byte[bytes.Length]; - await FileSystem.File.WriteAllBytesAsync(path, bytes); + await FileSystem.File.WriteAllBytesAsync(path, bytes, TestContext.Current.CancellationToken); async Task Act() { @@ -73,13 +73,13 @@ public async Task CopyToAsync_ShouldCopyBytes( string path, byte[] bytes) { byte[] buffer = new byte[bytes.Length]; - await FileSystem.File.WriteAllBytesAsync(path, bytes); + await FileSystem.File.WriteAllBytesAsync(path, bytes, TestContext.Current.CancellationToken); await using FileSystemStream stream = FileSystem.File.OpenRead(path); using MemoryStream destination = new(buffer); - await stream.CopyToAsync(destination); + await stream.CopyToAsync(destination, TestContext.Current.CancellationToken); - await destination.FlushAsync(); + await destination.FlushAsync(TestContext.Current.CancellationToken); buffer.Should().BeEquivalentTo(bytes); } #endif @@ -91,8 +91,8 @@ public async Task CopyToAsync_ShouldCopyBytes( public async Task CopyToAsync_WhenBufferSizeIsNotPositive_ShouldThrowArgumentNullException( int bufferSize) { - await FileSystem.File.WriteAllTextAsync("foo.txt", ""); - await FileSystem.File.WriteAllTextAsync("bar.txt", ""); + await FileSystem.File.WriteAllTextAsync("foo.txt", "", TestContext.Current.CancellationToken); + await FileSystem.File.WriteAllTextAsync("bar.txt", "", TestContext.Current.CancellationToken); await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenRead(); await using FileSystemStream destination = FileSystem.FileInfo.New("bar.txt").OpenWrite(); @@ -111,7 +111,7 @@ async Task Act() [Fact] public async Task CopyToAsync_WhenDestinationIsClosed_ShouldThrowObjectDisposedException() { - await FileSystem.File.WriteAllTextAsync("foo.txt", ""); + await FileSystem.File.WriteAllTextAsync("foo.txt", "", TestContext.Current.CancellationToken); await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenRead(); using MemoryStream destination = new(); destination.Close(); @@ -132,7 +132,7 @@ async Task Act() [Fact] public async Task CopyToAsync_WhenDestinationIsNull_ShouldThrowArgumentNullException() { - await FileSystem.File.WriteAllTextAsync("foo.txt", ""); + await FileSystem.File.WriteAllTextAsync("foo.txt", "", TestContext.Current.CancellationToken); await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenRead(); async Task Act() @@ -151,8 +151,8 @@ async Task Act() [Fact] public async Task CopyToAsync_WhenDestinationIsReadOnly_ShouldThrowNotSupportedException() { - await FileSystem.File.WriteAllTextAsync("foo.txt", ""); - await FileSystem.File.WriteAllTextAsync("bar.txt", ""); + await FileSystem.File.WriteAllTextAsync("foo.txt", "", TestContext.Current.CancellationToken); + await FileSystem.File.WriteAllTextAsync("bar.txt", "", TestContext.Current.CancellationToken); await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenRead(); await using FileSystemStream destination = FileSystem.FileInfo.New("bar.txt").OpenRead(); @@ -172,8 +172,8 @@ async Task Act() [Fact] public async Task CopyToAsync_WhenSourceIsClosed_ShouldThrowObjectDisposedException() { - await FileSystem.File.WriteAllTextAsync("foo.txt", ""); - await FileSystem.File.WriteAllTextAsync("bar.txt", ""); + await FileSystem.File.WriteAllTextAsync("foo.txt", "", TestContext.Current.CancellationToken); + await FileSystem.File.WriteAllTextAsync("bar.txt", "", TestContext.Current.CancellationToken); await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenRead(); await using FileSystemStream destination = FileSystem.FileInfo.New("bar.txt").OpenWrite(); source.Close(); @@ -194,8 +194,8 @@ async Task Act() [Fact] public async Task CopyToAsync_WhenSourceIsWriteOnly_ShouldThrowNotSupportedException() { - await FileSystem.File.WriteAllTextAsync("foo.txt", ""); - await FileSystem.File.WriteAllTextAsync("bar.txt", ""); + await FileSystem.File.WriteAllTextAsync("foo.txt", "", TestContext.Current.CancellationToken); + await FileSystem.File.WriteAllTextAsync("bar.txt", "", TestContext.Current.CancellationToken); await using FileSystemStream source = FileSystem.FileInfo.New("foo.txt").OpenWrite(); await using FileSystemStream destination = FileSystem.FileInfo.New("bar.txt").OpenWrite(); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs index 68094f7ee..45a9a1303 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs @@ -166,7 +166,7 @@ public async Task FlushAsync_ShouldNotChangePosition( stream.Seek(2, SeekOrigin.Begin); stream.Position.Should().Be(2); - await stream.FlushAsync(); + await stream.FlushAsync(TestContext.Current.CancellationToken); stream.Position.Should().Be(2); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs index 693bd4d3a..9653bfeec 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs @@ -33,7 +33,7 @@ public void EnableRaisingEvents_SetToFalse_ShouldStop(string path1, string path2 fileSystemWatcher.EnableRaisingEvents = false; FileSystem.Directory.Delete(path2); - ms.Wait(ExpectTimeout).Should().BeFalse(); + ms.Wait(ExpectTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); } [Theory] @@ -59,6 +59,6 @@ public void EnableRaisingEvents_ShouldBeInitializedAsFalse(string path) FileSystem.Directory.Delete(path); - ms.Wait(ExpectTimeout).Should().BeFalse(); + ms.Wait(ExpectTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); } } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs index c2e49ebe0..99daecb6b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs @@ -71,7 +71,7 @@ public void Filter_NotMatching_ShouldNotTriggerNotification( fileSystemWatcher.Filter = filter; fileSystemWatcher.EnableRaisingEvents = true; FileSystem.Directory.Delete(path); - ms.Wait(ExpectTimeout).Should().BeFalse(); + ms.Wait(ExpectTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs index 4e62f4eef..01164ea5f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs @@ -34,7 +34,7 @@ public void IncludeSubdirectories_SetToFalse_ShouldNotTriggerNotification( fileSystemWatcher.IncludeSubdirectories = false; fileSystemWatcher.EnableRaisingEvents = true; FileSystem.Directory.Delete(FileSystem.Path.Combine(baseDirectory, path)); - ms.Wait(ExpectTimeout).Should().BeFalse(); + ms.Wait(ExpectTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } @@ -69,7 +69,7 @@ public void fileSystemWatcher.IncludeSubdirectories = true; fileSystemWatcher.EnableRaisingEvents = true; FileSystem.Directory.Delete(otherDirectory); - ms.Wait(ExpectTimeout).Should().BeFalse(); + ms.Wait(ExpectTimeout, TestContext.Current.CancellationToken).Should().BeFalse(); result.Should().BeNull(); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs index 0515d4d11..6a987ded8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs @@ -41,7 +41,7 @@ public void BeginInit_ShouldStopListening(string path) { // Ignore any ObjectDisposedException } - }); + }, TestContext.Current.CancellationToken); IWaitForChangedResult result = fileSystemWatcher.WaitForChanged(WatcherChangeTypes.Created, 250); @@ -99,7 +99,7 @@ public void EndInit_ShouldRestartListening(string path) { // Ignore any ObjectDisposedException } - }); + }, TestContext.Current.CancellationToken); IWaitForChangedResult result = fileSystemWatcher.WaitForChanged(WatcherChangeTypes.Created, ExpectSuccess); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs index d7194c1db..4e4d2af57 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs @@ -32,7 +32,7 @@ public void WaitForChanged_ShouldBlockUntilEventHappens(string path) { // Ignore any ObjectDisposedException } - }); + }, TestContext.Current.CancellationToken); using (CancellationTokenSource cts = new(ExpectSuccess)) { @@ -81,7 +81,7 @@ public void WaitForChanged_Timeout_ShouldReturnTimedOut(string path, { // Ignore any ObjectDisposedException } - }); + }, TestContext.Current.CancellationToken); IWaitForChangedResult result = callback(fileSystemWatcher); fileSystemWatcher.EnableRaisingEvents.Should().BeTrue(); From a141dceddbf4be6c16e54aa95d339dfa4febdf0e Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 24 Jan 2025 14:29:08 +0100 Subject: [PATCH 4/9] Fix further sonar issues --- .../FileSystem/FileSystemWatcherMockTests.cs | 6 +++--- .../NotificationTests.cs | 6 +++--- .../TimeSystem/TimerMockTests.cs | 2 +- .../FileSystem/File/AppendAllLinesAsyncTests.cs | 8 ++++---- .../FileSystem/File/AppendAllTextAsyncTests.cs | 4 ++-- .../FileSystem/File/OpenReadTests.cs | 2 +- .../FileSystem/File/ReadLinesAsyncTests.cs | 2 +- .../File/TestDataGetEncodingDifference.cs | 17 ++++++++--------- .../FileSystem/File/WriteAllBytesAsyncTests.cs | 4 ++-- .../FileSystem/File/WriteAllLinesAsyncTests.cs | 4 ++-- .../FileSystem/File/WriteAllTextAsyncTests.cs | 6 +++--- .../FileSystem/FileStream/CopyToTests.cs | 14 +++++++------- .../FileSystem/FileStream/DisposeTests.cs | 4 ++-- .../TimeSystem/TaskTests.cs | 4 ++-- 14 files changed, 41 insertions(+), 42 deletions(-) diff --git a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs index 74c5909d8..9925a5787 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/FileSystem/FileSystemWatcherMockTests.cs @@ -64,7 +64,7 @@ public void Error_DefaultTo64Messages_ShouldBeTriggeredWhenBufferOverflows( // ReSharper disable once AccessToDisposedClosure try { - block1.Wait(10000); + block1.Wait(10000, TestContext.Current.CancellationToken); } catch (ObjectDisposedException) { @@ -121,7 +121,7 @@ public void Error_ShouldBeTriggeredWhenBufferOverflows( // ReSharper disable once AccessToDisposedClosure try { - block1.Wait(5000); + block1.Wait(5000, TestContext.Current.CancellationToken); } catch (ObjectDisposedException) { @@ -200,7 +200,7 @@ public void InternalBufferSize_ShouldResetQueue(string path1, string path2) // ReSharper disable once AccessToDisposedClosure try { - block1.Wait(100); + block1.Wait(100, TestContext.Current.CancellationToken); } catch (ObjectDisposedException) { diff --git a/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs b/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs index 5745ff965..a366937b2 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs @@ -188,7 +188,7 @@ public void AwaitableCallback_TimeoutExpired_ShouldThrowTimeoutException() try { // Delay larger than timeout of 10ms - ms.Wait(); + ms.Wait(TestContext.Current.CancellationToken); timeSystem.Thread.Sleep(1); } catch (ObjectDisposedException) @@ -258,7 +258,7 @@ public void AwaitableCallback_WaitedPreviously_ShouldWaitAgainForCallbackExecuti // ReSharper disable once AccessToDisposedClosure try { - listening.Wait(1000); + listening.Wait(1000, TestContext.Current.CancellationToken); timeSystem.Thread.Sleep(firstThreadMilliseconds); } catch (ObjectDisposedException) @@ -274,7 +274,7 @@ public void AwaitableCallback_WaitedPreviously_ShouldWaitAgainForCallbackExecuti // ReSharper disable once AccessToDisposedClosure try { - listening.Wait(1000); + listening.Wait(1000, TestContext.Current.CancellationToken); // ReSharper disable once AccessToDisposedClosure if (!ms.IsSet) { diff --git a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs index 7ec9a4d66..13a983016 100644 --- a/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs +++ b/Tests/Testably.Abstractions.Testing.Tests/TimeSystem/TimerMockTests.cs @@ -287,7 +287,7 @@ public void Wait_TimeoutExpired_ShouldThrowTimeoutException() try { count++; - ms.Wait(); + ms.Wait(TestContext.Current.CancellationToken); } catch (ObjectDisposedException) { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs index bfbf71958..94e35278a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs @@ -67,7 +67,7 @@ public async Task AppendAllLinesAsync_MissingDirectory_ShouldThrowDirectoryNotFo async Task Act() { - await FileSystem.File.AppendAllLinesAsync(filePath, contents); + await FileSystem.File.AppendAllLinesAsync(filePath, contents, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -96,7 +96,7 @@ public async Task AppendAllLinesAsync_NullContent_ShouldThrowArgumentNullExcepti { async Task Act() { - await FileSystem.File.AppendAllLinesAsync(path, null!); + await FileSystem.File.AppendAllLinesAsync(path, null!, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -113,7 +113,7 @@ public async Task AppendAllLinesAsync_NullEncoding_ShouldThrowArgumentNullExcept { async Task Act() { - await FileSystem.File.AppendAllLinesAsync(path, new List(), null!); + await FileSystem.File.AppendAllLinesAsync(path, new List(), null!, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -146,7 +146,7 @@ public async Task async Task Act() { - await FileSystem.File.AppendAllLinesAsync(path, contents); + await FileSystem.File.AppendAllLinesAsync(path, contents, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs index 3f773529e..df8f1b0cd 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs @@ -62,7 +62,7 @@ public async Task AppendAllTextAsync_MissingDirectory_ShouldThrowDirectoryNotFou async Task Act() { - await FileSystem.File.AppendAllTextAsync(filePath, contents); + await FileSystem.File.AppendAllTextAsync(filePath, contents, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -103,7 +103,7 @@ public async Task async Task Act() { - await FileSystem.File.AppendAllTextAsync(path, contents); + await FileSystem.File.AppendAllTextAsync(path, contents, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs index e45bfc90a..7a49f1a2f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs @@ -80,7 +80,7 @@ async Task Act() // ReSharper disable once UseAwaitUsing using FileSystemStream stream = FileSystem.File.OpenRead(path); #pragma warning disable CA1835 - await stream.WriteAsync(bytes, 0, bytes.Length); + await stream.WriteAsync(bytes, 0, bytes.Length, TestContext.Current.CancellationToken); #pragma warning restore CA1835 } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs index 66bc5b54a..7aa78fb18 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs @@ -64,7 +64,7 @@ public async Task ReadLinesAsync_MissingFile_ShouldThrowFileNotFoundException( { async Task Act() { - await foreach (string _ in FileSystem.File.ReadLinesAsync(path)) + await foreach (string _ in FileSystem.File.ReadLinesAsync(path, TestContext.Current.CancellationToken)) { // do nothing } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/TestDataGetEncodingDifference.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/TestDataGetEncodingDifference.cs index 0c2edb074..e6f2c6b57 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/TestDataGetEncodingDifference.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/TestDataGetEncodingDifference.cs @@ -4,21 +4,20 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -public class TestDataGetEncodingDifference : IEnumerable +public class TestDataGetEncodingDifference : IEnumerable> { private const string SpecialCharactersContent = "_€_Ä_Ö_Ü"; - #region IEnumerable Members + #region IEnumerable> Members - public IEnumerator GetEnumerator() + public IEnumerator> GetEnumerator() { - yield return - [ - SpecialCharactersContent, Encoding.ASCII, Encoding.UTF8, - ]; + yield return new(SpecialCharactersContent, Encoding.ASCII, Encoding.UTF8); } - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - #endregion + + /// + IEnumerator IEnumerable.GetEnumerator() + => GetEnumerator(); } diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs index 489195118..ac0ecb5c3 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs @@ -55,7 +55,7 @@ public async Task WriteAllBytesAsync_WhenBytesAreNull_ShouldThrowArgumentNullExc { async Task Act() { - await FileSystem.File.WriteAllBytesAsync(path, null!); + await FileSystem.File.WriteAllBytesAsync(path, null!, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -73,7 +73,7 @@ public async Task async Task Act() { - await FileSystem.File.WriteAllBytesAsync(path, bytes); + await FileSystem.File.WriteAllBytesAsync(path, bytes, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs index 6f012dc1a..6b7bb9bd5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs @@ -129,7 +129,7 @@ public async Task async Task Act() { - await FileSystem.File.WriteAllLinesAsync(path, contents); + await FileSystem.File.WriteAllLinesAsync(path, contents, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -153,7 +153,7 @@ public async Task async Task Act() { - await FileSystem.File.WriteAllLinesAsync(path, contents); + await FileSystem.File.WriteAllLinesAsync(path, contents, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs index 12d6411c0..456fe1a86 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs @@ -95,7 +95,7 @@ public async Task WriteAllTextAsync_WhenContentIsNull_ShouldNotThrowException(st { async Task Act() { - await FileSystem.File.WriteAllTextAsync(path, null); + await FileSystem.File.WriteAllTextAsync(path, null, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -112,7 +112,7 @@ public async Task async Task Act() { - await FileSystem.File.WriteAllTextAsync(path, contents); + await FileSystem.File.WriteAllTextAsync(path, contents, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -136,7 +136,7 @@ public async Task async Task Act() { - await FileSystem.File.WriteAllTextAsync(path, contents); + await FileSystem.File.WriteAllTextAsync(path, contents, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs index fa3785f1a..71c0a2202 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs @@ -56,7 +56,7 @@ async Task Act() { await using FileSystemStream stream = FileSystem.File.OpenRead(path); using MemoryStream destination = new(buffer); - await stream.CopyToAsync(destination, 0); + await stream.CopyToAsync(destination, 0, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -98,7 +98,7 @@ public async Task CopyToAsync_WhenBufferSizeIsNotPositive_ShouldThrowArgumentNul async Task Act() { - await source.CopyToAsync(destination, bufferSize); + await source.CopyToAsync(destination, bufferSize, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -118,7 +118,7 @@ public async Task CopyToAsync_WhenDestinationIsClosed_ShouldThrowObjectDisposedE async Task Act() { - await source.CopyToAsync(destination); + await source.CopyToAsync(destination, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -137,7 +137,7 @@ public async Task CopyToAsync_WhenDestinationIsNull_ShouldThrowArgumentNullExcep async Task Act() { - await source.CopyToAsync(null!); + await source.CopyToAsync(null!, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -158,7 +158,7 @@ public async Task CopyToAsync_WhenDestinationIsReadOnly_ShouldThrowNotSupportedE async Task Act() { - await source.CopyToAsync(destination); + await source.CopyToAsync(destination, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -180,7 +180,7 @@ public async Task CopyToAsync_WhenSourceIsClosed_ShouldThrowObjectDisposedExcept async Task Act() { - await source.CopyToAsync(destination); + await source.CopyToAsync(destination, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); @@ -201,7 +201,7 @@ public async Task CopyToAsync_WhenSourceIsWriteOnly_ShouldThrowNotSupportedExcep async Task Act() { - await source.CopyToAsync(destination); + await source.CopyToAsync(destination, TestContext.Current.CancellationToken); } Exception? exception = await Record.ExceptionAsync(Act); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs index 35550440e..cb436b038 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs @@ -92,13 +92,13 @@ private static IEnumerable>> // ReSharper disable once MustUseReturnValue yield return fileStream => fileStream.Read(Array.Empty(), 0, 0); #pragma warning restore MA0060 - yield return fileStream => fileStream.ReadAsync(Array.Empty(), 0, 0) + yield return fileStream => fileStream.ReadAsync(Array.Empty(), 0, 0, TestContext.Current.CancellationToken) .GetAwaiter().GetResult(); yield return fileStream => fileStream.ReadByte(); yield return fileStream => fileStream.Seek(0, SeekOrigin.Begin); yield return fileStream => fileStream.SetLength(0); yield return fileStream => fileStream.Write(Array.Empty(), 0, 0); - yield return fileStream => fileStream.WriteAsync(Array.Empty(), 0, 0) + yield return fileStream => fileStream.WriteAsync(Array.Empty(), 0, 0, TestContext.Current.CancellationToken) .GetAwaiter().GetResult(); yield return fileStream => fileStream.WriteByte(0x42); } diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs index 6416c277c..f3b9aea65 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs @@ -28,7 +28,7 @@ public async Task Delay_Milliseconds_LessThanNegativeOne_ShouldThrowArgumentOutOfRangeException() { async Task Act() - => await TimeSystem.Task.Delay(-2); + => await TimeSystem.Task.Delay(-2, TestContext.Current.CancellationToken); Exception? exception = await Record.ExceptionAsync(Act); @@ -70,7 +70,7 @@ public async Task Delay_Timespan_LessThanNegativeOne_ShouldThrowArgumentOutOfRangeException() { async Task Act() - => await TimeSystem.Task.Delay(TimeSpan.FromMilliseconds(-2)); + => await TimeSystem.Task.Delay(TimeSpan.FromMilliseconds(-2), TestContext.Current.CancellationToken); Exception? exception = await Record.ExceptionAsync(Act); From b7e5dfe97379f07a5e6f24086b48f67c297e3065 Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 24 Jan 2025 15:05:22 +0100 Subject: [PATCH 5/9] Disable parallelization --- Tests/Testably.Abstractions.Tests/xunit.runner.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/Testably.Abstractions.Tests/xunit.runner.json b/Tests/Testably.Abstractions.Tests/xunit.runner.json index 7b6e73292..5240d9162 100644 --- a/Tests/Testably.Abstractions.Tests/xunit.runner.json +++ b/Tests/Testably.Abstractions.Tests/xunit.runner.json @@ -1,4 +1,5 @@ { "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", - "culture": "en-US" + "culture": "en-US", + "parallelizeTestCollections": false } From bc61af30e723262a0cc4d8b492f899dcbd0b32f4 Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 24 Jan 2025 16:35:22 +0100 Subject: [PATCH 6/9] Skip brittle test --- .../FileSystem/Directory/Tests.Times.cs | 2 ++ .../FileSystem/FileSystemWatcher/WaitForChangedTests.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs index 7b997f6ec..b8ae398ff 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs @@ -75,6 +75,8 @@ public void GetLastWriteTimeUtc_PathNotFound_ShouldReturnNullTime(string path) public void LastAccessTime_CreateSubDirectory_ShouldUpdateLastAccessAndLastWriteTime( string path, string subPath) { + SkipIfBrittleTestsShouldBeSkipped(); + DateTime start = TimeSystem.DateTime.Now; IDirectoryInfo result = FileSystem.Directory.CreateDirectory(path); TimeSystem.Thread.Sleep(100); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs index 4e4d2af57..c4983e11b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs @@ -11,6 +11,8 @@ public partial class WaitForChangedTests [AutoData] public void WaitForChanged_ShouldBlockUntilEventHappens(string path) { + SkipIfBrittleTestsShouldBeSkipped(); + using ManualResetEventSlim ms = new(); using IFileSystemWatcher fileSystemWatcher = FileSystem.FileSystemWatcher.New(BasePath); From 93111497da1753be97d9b468d00a38fd9a19e8d3 Mon Sep 17 00:00:00 2001 From: Valentin Date: Sat, 25 Jan 2025 06:40:43 +0100 Subject: [PATCH 7/9] Fix pipeline as xunit3 produces executables --- .nuke/build.schema.json | 1 - Pipeline/Build.Compile.cs | 2 +- Pipeline/Build.UnitTest.cs | 50 ++++---------------------------------- Pipeline/Build.cs | 2 -- 4 files changed, 6 insertions(+), 49 deletions(-) diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 7c65b84d8..acf52403f 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -32,7 +32,6 @@ "CodeAnalysisEnd", "CodeCoverage", "Compile", - "DotNetFrameworkUnitTests", "DotNetUnitTests", "MutationComment", "MutationTestPreparation", diff --git a/Pipeline/Build.Compile.cs b/Pipeline/Build.Compile.cs index 7b600bde4..af38cd94c 100644 --- a/Pipeline/Build.Compile.cs +++ b/Pipeline/Build.Compile.cs @@ -22,7 +22,7 @@ partial class Build { SemVer = GitVersion?.SemVer; - if (GitHubActions.IsPullRequest && GitVersion != null) + if (GitHubActions?.IsPullRequest == true && GitVersion != null) { string buildNumber = GitHubActions.RunNumber.ToString(); Console.WriteLine( diff --git a/Pipeline/Build.UnitTest.cs b/Pipeline/Build.UnitTest.cs index 48e503ebe..02f96edb0 100644 --- a/Pipeline/Build.UnitTest.cs +++ b/Pipeline/Build.UnitTest.cs @@ -1,13 +1,10 @@ using Nuke.Common; -using Nuke.Common.IO; using Nuke.Common.ProjectModel; using Nuke.Common.Tooling; using Nuke.Common.Tools.DotNet; -using Nuke.Common.Tools.Xunit; using Serilog; using System; using System.Linq; -using static Nuke.Common.Tools.Xunit.XunitTasks; using static Nuke.Common.Tools.DotNet.DotNetTasks; // ReSharper disable AllUnderscoreLocalParameterName @@ -18,51 +15,15 @@ partial class Build { const int MaxRetries = 1; - Target DotNetFrameworkUnitTests => _ => _ - .Unlisted() - .DependsOn(Compile) - .OnlyWhenDynamic(() => EnvironmentInfo.IsWin) - .Executes(() => - { - string[] testAssemblies = UnitTestProjects - .SelectMany(project => - project.Directory.GlobFiles( - $"bin/{(Configuration == Configuration.Debug ? "Debug" : "Release")}/net48/*.Tests.dll")) - .Select(p => p.ToString()) - .ToArray(); - - Assert.NotEmpty(testAssemblies.ToList()); - - string net48 = "net48"; - for (int retry = MaxRetries; retry >= 0; retry--) - { - try - { - Xunit2(s => s - .SetFramework(net48) - .AddTargetAssemblies(testAssemblies) - ); - } - catch (Exception ex) - { - if (retry == 0) - { - Log.Error($"All {MaxRetries + 1} tries failed: {ex}"); - throw; - } - - Log.Error($"Error during unit tests: {ex}"); - Log.Information($"Retry {MaxRetries - retry + 1} of {MaxRetries} times:"); - } - } - }); - Target DotNetUnitTests => _ => _ .Unlisted() .DependsOn(Compile) .Executes(() => { - string net48 = "net48"; + string[] excludedFrameworks = + EnvironmentInfo.IsWin + ? [] + : ["net48"]; for (int retry = MaxRetries; retry >= 0; retry--) { try @@ -78,7 +39,7 @@ partial class Build (settings, project) => settings .SetProjectFile(project) .CombineWith( - project.GetTargetFrameworks()?.Except([net48]), + project.GetTargetFrameworks()?.Except(excludedFrameworks), (frameworkSettings, framework) => frameworkSettings .SetFramework(framework) .AddLoggers( @@ -111,6 +72,5 @@ partial class Build ]; Target UnitTests => _ => _ - .DependsOn(DotNetFrameworkUnitTests) .DependsOn(DotNetUnitTests); } diff --git a/Pipeline/Build.cs b/Pipeline/Build.cs index 4372f921a..d6cefeb80 100644 --- a/Pipeline/Build.cs +++ b/Pipeline/Build.cs @@ -28,8 +28,6 @@ partial class Build : NukeBuild GitHubActions GitHubActions => GitHubActions.Instance; public static int Main() => Execute([ - x => x.ApiChecks, x => x.UnitTests, - x => x.MutationTests, ]); } From c44c83d82f5c2a36a9592753af70077634d8f203 Mon Sep 17 00:00:00 2001 From: Valentin Date: Sat, 25 Jan 2025 07:02:50 +0100 Subject: [PATCH 8/9] Remove .NET Stryker mutation badge, because [Stryker.NET doesn't handle xUnit v3 properly](https://github.com/stryker-mutator/stryker-net/issues/3117) --- .github/workflows/build.yml | 44 ------------------------------------- README.md | 1 - 2 files changed, 45 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a3767d9f..d8f548d1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,50 +69,6 @@ jobs: ./Artifacts/* ./TestResults/*.trx - mutation-tests-linux: - name: "Mutation tests (Linux)" - if: ${{ github.actor != 'dependabot[bot]' }} - runs-on: ubuntu-latest - env: - STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} - DOTNET_NOLOGO: true - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup .NET SDKs - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 6.0.x - 7.0.x - 8.0.x - 9.0.x - - name: Run mutation tests - run: ./build.sh MutationTestsLinux - - mutation-tests-windows: - name: "Mutation tests (Windows)" - if: ${{ github.actor != 'dependabot[bot]' }} - runs-on: windows-latest - env: - STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} - DOTNET_NOLOGO: true - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup .NET SDKs - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 6.0.x - 7.0.x - 8.0.x - 9.0.x - - name: Run mutation tests - run: ./build.ps1 MutationTestsWindows - static-code-analysis: name: "Static code analysis" runs-on: ubuntu-latest diff --git a/README.md b/README.md index 65cd1f5c1..d668937b6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Build](https://github.com/Testably/Testably.Abstractions/actions/workflows/build.yml/badge.svg)](https://github.com/Testably/Testably.Abstractions/actions/workflows/build.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Testably_Testably.Abstractions&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Testably_Testably.Abstractions) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Testably_Testably.Abstractions&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Testably_Testably.Abstractions) -[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FTestably%2FTestably.Abstractions%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/Testably/Testably.Abstractions/main) This library is a feature complete testing helper for the [IFileSystem abstractions for I/O-related functionality](https://github.com/TestableIO/System.IO.Abstractions) from the `System.IO` namespace. It uses an in-memory file system that behaves exactly like the real file system and can be used in unit tests for dependency injection. The testing helper also supports advanced scenarios like From 6b08953cbc8b5043ef8ea6323ed796db2796cd4f Mon Sep 17 00:00:00 2001 From: Valentin Date: Sat, 25 Jan 2025 08:09:41 +0100 Subject: [PATCH 9/9] Review issue --- Pipeline/Build.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Pipeline/Build.cs b/Pipeline/Build.cs index d6cefeb80..4372f921a 100644 --- a/Pipeline/Build.cs +++ b/Pipeline/Build.cs @@ -28,6 +28,8 @@ partial class Build : NukeBuild GitHubActions GitHubActions => GitHubActions.Instance; public static int Main() => Execute([ + x => x.ApiChecks, x => x.UnitTests, + x => x.MutationTests, ]); }