diff --git a/Directory.Packages.props b/Directory.Packages.props index bd66094b8..5685049dc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -23,7 +23,7 @@ - + diff --git a/Tests/Helpers/Testably.Abstractions.TestHelpers/FileSystemTestBase.cs b/Tests/Helpers/Testably.Abstractions.TestHelpers/FileSystemTestBase.cs deleted file mode 100644 index 2a8210c30..000000000 --- a/Tests/Helpers/Testably.Abstractions.TestHelpers/FileSystemTestBase.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.IO.Abstractions; - -namespace Testably.Abstractions.TestHelpers; - -/// -/// If referencing this base class, the source generator will automatically create two classes implementing your class: -///
-/// - one will provide a `RealFileSystem`
-/// - one will provide a `MockFileSystem`
-/// Thus your tests run on both systems identically. -///
-/// -/// Important: You have to mark your class as ´partial`! -/// -public abstract class FileSystemTestBase : TestBase - where TFileSystem : IFileSystem -{ - public abstract string BasePath { get; } - public TFileSystem FileSystem { get; } - public Test Test { get; } - public ITimeSystem TimeSystem { get; } - - // ReSharper disable once UnusedMember.Global - protected FileSystemTestBase( - Test test, - TFileSystem fileSystem, - ITimeSystem timeSystem) - { - Test = test; - FileSystem = fileSystem; - TimeSystem = timeSystem; - } - - protected FileSystemTestBase() - { - throw new NotSupportedException( - "The SourceGenerator didn't create the corresponding files!"); - } - - /// - /// Specifies, if brittle tests should be skipped on the real file system. - /// - /// - /// (optional) A condition that must be for the test to be skipped on the - /// real file system. - /// - public abstract void SkipIfBrittleTestsShouldBeSkipped(bool condition = true); - - /// - /// Specifies, if long-running tests should be skipped on the real file system. - /// - public abstract void SkipIfLongRunningTestsShouldBeSkipped(); -} diff --git a/Tests/Helpers/Testably.Abstractions.TestHelpers/RandomSystemTestBase.cs b/Tests/Helpers/Testably.Abstractions.TestHelpers/RandomSystemTestBase.cs deleted file mode 100644 index ec3b95070..000000000 --- a/Tests/Helpers/Testably.Abstractions.TestHelpers/RandomSystemTestBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -namespace Testably.Abstractions.TestHelpers; - -/// -/// If referencing this base class, the source generator will automatically create two classes implementing your class: -///
-/// - one will provide a `RealRandomSystem`
-/// - one will provide a `MockRandomSystem`
-/// Thus your tests run on both systems identically. -///
-/// -/// Important: You have to mark your class as ´partial`! -/// -public abstract class RandomSystemTestBase : TestBase - where TRandomSystem : IRandomSystem -{ - public TRandomSystem RandomSystem { get; } - - // ReSharper disable once UnusedMember.Global - protected RandomSystemTestBase(TRandomSystem randomSystem) - { - RandomSystem = randomSystem; - } - - protected RandomSystemTestBase() - { - throw new NotSupportedException( - "The SourceGenerator didn't create the corresponding files!"); - } -} diff --git a/Tests/Helpers/Testably.Abstractions.TestHelpers/TestBase.cs b/Tests/Helpers/Testably.Abstractions.TestHelpers/TestBase.cs deleted file mode 100644 index 96d0d3425..000000000 --- a/Tests/Helpers/Testably.Abstractions.TestHelpers/TestBase.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Testably.Abstractions.TestHelpers; - -/// -/// Base class for generated tests. -/// -public abstract class TestBase -{ - /// - /// The delay in milliseconds when wanting to ensure a timeout in the test. - /// - public const int EnsureTimeout = 500; - - /// - /// The delay in milliseconds when expecting a success in the test. - /// - public const int ExpectSuccess = 30000; - - /// - /// The delay in milliseconds when expecting a timeout in the test. - /// - public const int ExpectTimeout = 30; -} diff --git a/Tests/Helpers/Testably.Abstractions.TestHelpers/TimeSystemTestBase.cs b/Tests/Helpers/Testably.Abstractions.TestHelpers/TimeSystemTestBase.cs deleted file mode 100644 index ad4bf588f..000000000 --- a/Tests/Helpers/Testably.Abstractions.TestHelpers/TimeSystemTestBase.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; - -namespace Testably.Abstractions.TestHelpers; - -/// -/// If referencing this base class, the source generator will automatically create two classes implementing your class: -///
-/// - one will provide a `RealTimeSystem`
-/// - one will provide a `MockTimeSystem`
-/// Thus your tests run on both systems identically. -///
-/// -/// Important: You have to mark your class as ´partial`! -/// -public abstract class TimeSystemTestBase : TestBase - where TTimeSystem : ITimeSystem -{ - public TTimeSystem TimeSystem { get; } - - // ReSharper disable once UnusedMember.Global - protected TimeSystemTestBase(TTimeSystem timeSystem) - { - TimeSystem = timeSystem; - } - - protected TimeSystemTestBase() - { - throw new NotSupportedException( - "The SourceGenerator didn't create the corresponding files!"); - } - - /// - /// Specifies, if brittle tests should be skipped on the real time system. - /// - /// - /// (optional) A condition that must be for the test to be skipped on the - /// real time system. - /// - public abstract void SkipIfBrittleTestsShouldBeSkipped(bool condition = true); -} diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGeneratorBase.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGeneratorBase.cs deleted file mode 100644 index c48467e38..000000000 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGeneratorBase.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Testably.Abstractions.Tests.SourceGenerator.Model; - -namespace Testably.Abstractions.Tests.SourceGenerator; - -internal abstract class ClassGeneratorBase -{ - /// - /// The marker of the base class to trigger generation of concrete test classes. - /// - public abstract string Marker { get; } - - public void GenerateClass(GeneratorExecutionContext context, - ClassModel @class) - { - StringBuilder sourceBuilder = GetSourceBuilder(); - GenerateSource(sourceBuilder, @class); - string fileName = CreateFileName(@class); - context.AddSource(fileName, - SourceText.From(sourceBuilder.ToString(), Encoding.UTF8)); - } - - private string CreateFileName(ClassModel classToGenerate) - { - string? fileNamePrefix = ExtractFileNamePrefixFromMarker(Marker); - List namespacePrefixes = - [ - "Testably.Abstractions.Tests.FileSystem.", - "Testably.Abstractions.", - ]; - - string? namespacePrefix = namespacePrefixes - .FirstOrDefault(classToGenerate.Namespace.StartsWith); - if (namespacePrefix != null) - { - string? @namespace = classToGenerate.Namespace - .Substring(namespacePrefix.Length); - return $"{fileNamePrefix}{@namespace}.{classToGenerate.Name}.cs"; - } - - return $"{fileNamePrefix}{classToGenerate.Name}.cs"; - } - - /// - /// Heuristic to generate a filename prefix depending on the from the class generator. - /// - private static string ExtractFileNamePrefixFromMarker(string marker) - { - int genericIndex = marker.IndexOf("<", StringComparison.OrdinalIgnoreCase); - if (genericIndex > 0) - { - marker = marker.Substring(0, genericIndex); - } - - if (marker.EndsWith("TestBase", StringComparison.Ordinal)) - { - marker = marker.Substring(0, marker.Length - "TestBase".Length); - } - - return $"{marker}."; - } - - /// - /// Append the source necessary for the to the . - /// - protected abstract void GenerateSource( - StringBuilder sourceBuilder, ClassModel @class); - - private static StringBuilder GetSourceBuilder() - => new( - @"//------------------------------------------------------------------------------ -// -// This code was generated by ""Testably.Abstractions.Tests.SourceGenerator"". -// -// Changes to this file may cause incorrect behavior -// and will be lost if the code is regenerated. -// -//------------------------------------------------------------------------------ -"); -} diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGenerators/FileSystemClassGenerator.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGenerators/FileSystemClassGenerator.cs deleted file mode 100644 index 75bc2cb62..000000000 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGenerators/FileSystemClassGenerator.cs +++ /dev/null @@ -1,272 +0,0 @@ -using System; -using System.Text; -using Testably.Abstractions.Tests.SourceGenerator.Model; - -namespace Testably.Abstractions.Tests.SourceGenerator.ClassGenerators; - -// ReSharper disable StringLiteralTypo -internal sealed class FileSystemClassGenerator : ClassGeneratorBase -{ - /// - public override string Marker - => "FileSystemTestBase"; - - /// - protected override void GenerateSource(StringBuilder sourceBuilder, ClassModel @class) - { - #pragma warning disable MA0028 - sourceBuilder.Append($$""" - using System.Runtime.InteropServices; - using Testably.Abstractions.Testing.Initializer; - using Testably.Abstractions.TestHelpers; - using Testably.Abstractions.TestHelpers.Settings; - using Xunit.Abstractions; - - namespace {{@class.Namespace}} - { - public abstract partial class {{@class.Name}} - { - protected {{@class.Name}}(Test test, TFileSystem fileSystem, ITimeSystem timeSystem) - : base(test, fileSystem, timeSystem) - { - } - } - } - - namespace {{@class.Namespace}}.{{@class.Name}} - { - // ReSharper disable once UnusedMember.Global - public sealed class MockFileSystemTests : {{@class.Name}}, IDisposable - { - /// - public override string BasePath => _directoryCleaner.BasePath; - - private readonly IDirectoryCleaner _directoryCleaner; - - public MockFileSystemTests() : this(new MockFileSystem()) - { - } - - private MockFileSystemTests(MockFileSystem mockFileSystem) : base( - new Test(), - mockFileSystem, - mockFileSystem.TimeSystem) - { - _directoryCleaner = FileSystem - .SetCurrentDirectoryToEmptyTemporaryDirectory(); - } - - /// - public void Dispose() - => _directoryCleaner.Dispose(); - - /// - public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - { - // Brittle tests are never skipped against the mock file system! - } - - /// - public override void SkipIfLongRunningTestsShouldBeSkipped() - { - // Long-running tests are never skipped against the mock file system! - } - } - } - - namespace {{@class.Namespace}}.{{@class.Name}} - { - // ReSharper disable once UnusedMember.Global - [Collection(nameof(RealFileSystemTests))] - public sealed class RealFileSystemTests : {{@class.Name}}, IDisposable - { - /// - public override string BasePath => _directoryCleaner.BasePath; - - private readonly IDirectoryCleaner _directoryCleaner; - private readonly TestSettingsFixture _fixture; - - public RealFileSystemTests(ITestOutputHelper testOutputHelper, TestSettingsFixture fixture) - : base(new Test(), new RealFileSystem(), new RealTimeSystem()) - { - #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."); - } - #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."); - } - #endif - _fixture = fixture; - _directoryCleaner = FileSystem - .SetCurrentDirectoryToEmptyTemporaryDirectory($"{{@class.Namespace}}{FileSystem.Path.DirectorySeparatorChar}{{@class.Name}}-", testOutputHelper.WriteLine); - } - - /// - public void Dispose() - => _directoryCleaner.Dispose(); - - #if DEBUG - /// - public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - => Xunit.Skip.If(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, - $"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, - $"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, - $"Long-running tests are {_fixture.LongRunningTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.LongRunningTests."); - #endif - } - } - """); - if (IncludeSimulatedTests(@class)) - { - sourceBuilder.Append($$""" - - #if !NETFRAMEWORK - namespace {{@class.Namespace}}.{{@class.Name}} - { - // ReSharper disable once UnusedMember.Global - public sealed class LinuxFileSystemTests : {{@class.Name}}, IDisposable - { - /// - public override string BasePath => _directoryCleaner.BasePath; - - private readonly IDirectoryCleaner _directoryCleaner; - - public LinuxFileSystemTests() : this(new MockFileSystem(o => - o.SimulatingOperatingSystem(SimulationMode.Linux))) - { - } - - private LinuxFileSystemTests(MockFileSystem mockFileSystem) : base( - new Test(OSPlatform.Linux), - mockFileSystem, - mockFileSystem.TimeSystem) - { - _directoryCleaner = FileSystem - .SetCurrentDirectoryToEmptyTemporaryDirectory(); - } - - /// - public void Dispose() - => _directoryCleaner.Dispose(); - - /// - public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - { - // Brittle tests are never skipped against the mock file system! - } - /// - public override void SkipIfLongRunningTestsShouldBeSkipped() - { - // Long-running tests are never skipped against the mock file system! - } - } - #endif - - #if !NETFRAMEWORK - // ReSharper disable once UnusedMember.Global - public sealed class MacFileSystemTests : {{@class.Name}}, IDisposable - { - /// - public override string BasePath => _directoryCleaner.BasePath; - - private readonly IDirectoryCleaner _directoryCleaner; - - public MacFileSystemTests() : this(new MockFileSystem(o => - o.SimulatingOperatingSystem(SimulationMode.MacOS))) - { - } - private MacFileSystemTests(MockFileSystem mockFileSystem) : base( - new Test(OSPlatform.OSX), - mockFileSystem, - mockFileSystem.TimeSystem) - { - _directoryCleaner = FileSystem - .SetCurrentDirectoryToEmptyTemporaryDirectory(); - } - - /// - public void Dispose() - => _directoryCleaner.Dispose(); - - /// - public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - { - // Brittle tests are never skipped against the mock file system! - } - /// - public override void SkipIfLongRunningTestsShouldBeSkipped() - { - // Long-running tests are never skipped against the mock file system! - } - } - #endif - - #if !NETFRAMEWORK - // ReSharper disable once UnusedMember.Global - public sealed class WindowsFileSystemTests : {{@class.Name}}, IDisposable - { - /// - public override string BasePath => _directoryCleaner.BasePath; - - private readonly IDirectoryCleaner _directoryCleaner; - - public WindowsFileSystemTests() : this(new MockFileSystem(o => - o.SimulatingOperatingSystem(SimulationMode.Windows))) - { - } - private WindowsFileSystemTests(MockFileSystem mockFileSystem) : base( - new Test(OSPlatform.Windows), - mockFileSystem, - mockFileSystem.TimeSystem) - { - _directoryCleaner = FileSystem - .SetCurrentDirectoryToEmptyTemporaryDirectory(); - } - - /// - public void Dispose() - => _directoryCleaner.Dispose(); - - /// - public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - { - // Brittle tests are never skipped against the mock file system! - } - /// - public override void SkipIfLongRunningTestsShouldBeSkipped() - { - // Long-running tests are never skipped against the mock file system! - } - } - } - #endif - """); - #pragma warning restore MA0028 - } - } - - private static bool IncludeSimulatedTests(ClassModel @class) - { - return !@class.Namespace.Equals( - "Testably.Abstractions.AccessControl.Tests", StringComparison.Ordinal); - } -} diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGenerators/RandomSystemClassGenerator.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGenerators/RandomSystemClassGenerator.cs deleted file mode 100644 index 25ae0f35d..000000000 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGenerators/RandomSystemClassGenerator.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Text; -using Testably.Abstractions.Tests.SourceGenerator.Model; -// ReSharper disable StringLiteralTypo - -namespace Testably.Abstractions.Tests.SourceGenerator.ClassGenerators; - -internal sealed class RandomSystemClassGenerator : ClassGeneratorBase -{ - /// - public override string Marker - => "RandomSystemTestBase"; - - /// - protected override void GenerateSource(StringBuilder sourceBuilder, ClassModel @class) - #pragma warning disable MA0028 - => sourceBuilder.Append($$""" - using Testably.Abstractions.TestHelpers; - using Xunit.Abstractions; - - namespace {{@class.Namespace}} - { - public abstract partial class {{@class.Name}} - { - protected {{@class.Name}}(TRandomSystem randomSystem) - : base(randomSystem) - { - } - } - } - - namespace {{@class.Namespace}}.{{@class.Name}} - { - // ReSharper disable once UnusedMember.Global - public sealed class MockRandomSystemTests : {{@class.Name}} - { - public MockRandomSystemTests() : base(new MockRandomSystem()) - { - } - } - - // ReSharper disable once UnusedMember.Global - public sealed class RealRandomSystemTests : {{@class.Name}} - { - public RealRandomSystemTests() : base(new RealRandomSystem()) - { - } - } - } - """); - #pragma warning restore MA0028 -} diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGenerators/TimeSystemClassGenerator.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGenerators/TimeSystemClassGenerator.cs deleted file mode 100644 index 28da672fa..000000000 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassGenerators/TimeSystemClassGenerator.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.Text; -using Testably.Abstractions.Tests.SourceGenerator.Model; -// ReSharper disable StringLiteralTypo - -namespace Testably.Abstractions.Tests.SourceGenerator.ClassGenerators; - -internal sealed class TimeSystemClassGenerator : ClassGeneratorBase -{ - /// - public override string Marker - => "TimeSystemTestBase"; - - /// - protected override void GenerateSource(StringBuilder sourceBuilder, ClassModel @class) - #pragma warning disable MA0028 - => sourceBuilder.Append($$""" - using Testably.Abstractions.TestHelpers; - using Testably.Abstractions.TestHelpers.Settings; - using Xunit.Abstractions; - - namespace {{@class.Namespace}} - { - public abstract partial class {{@class.Name}} - { - protected {{@class.Name}}(TTimeSystem timeSystem) - : base(timeSystem) - { - } - } - } - - namespace {{@class.Namespace}}.{{@class.Name}} - { - // ReSharper disable once UnusedMember.Global - public sealed class MockTimeSystemTests : {{@class.Name}} - { - public MockTimeSystemTests() : base(new MockTimeSystem(Testing.TimeProvider.Now())) - { - } - - /// - public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - { - // Brittle tests are never skipped against the mock time system! - } - } - - // ReSharper disable once UnusedMember.Global - [Collection(nameof(RealTimeSystemTests))] - public sealed class RealTimeSystemTests : {{@class.Name}} - { - private readonly TestSettingsFixture _fixture; - - public RealTimeSystemTests(TestSettingsFixture fixture) : base(new RealTimeSystem()) - { - _fixture = fixture; - } - - #if DEBUG - /// - public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) - => Xunit.Skip.If(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, - $"Brittle tests are {_fixture.BrittleTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.BrittleTests."); - #endif - } - } - """); - #pragma warning restore MA0028 -} diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassModel.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassModel.cs new file mode 100644 index 000000000..2a40f6aa0 --- /dev/null +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassModel.cs @@ -0,0 +1,15 @@ +namespace Testably.Abstractions.Tests.SourceGenerator; + +internal readonly record struct ClassModel +{ + public string Name { get; } + public string Namespace { get; } + public ClassModelType Type { get; } + + internal ClassModel(ClassModelType type, string @namespace, string name) + { + Type = type; + Namespace = @namespace; + Name = name; + } +} diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassModelType.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassModelType.cs new file mode 100644 index 000000000..b2a1ac56c --- /dev/null +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/ClassModelType.cs @@ -0,0 +1,8 @@ +namespace Testably.Abstractions.Tests.SourceGenerator; + +internal enum ClassModelType +{ + FileSystem, + RandomSystem, + TimeSystem, +} diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Generator.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Generator.cs index 692224d46..0d645cc42 100644 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Generator.cs +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Generator.cs @@ -1,7 +1,9 @@ using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; +using System; using System.Collections.Generic; -using Testably.Abstractions.Tests.SourceGenerator.ClassGenerators; -using Testably.Abstractions.Tests.SourceGenerator.Model; +using System.Text; namespace Testably.Abstractions.Tests.SourceGenerator; @@ -13,44 +15,172 @@ namespace Testably.Abstractions.Tests.SourceGenerator; /// - `ITimeSystem` /// [Generator] -public sealed class Generator : ISourceGenerator +public sealed class Generator : IIncrementalGenerator { - private readonly List _classGenerators = - [ - new FileSystemClassGenerator(), - new RandomSystemClassGenerator(), - new TimeSystemClassGenerator(), - ]; + #region IIncrementalGenerator Members - private SyntaxReceiver? _syntaxReceiver; + /// + public void Initialize(IncrementalGeneratorInitializationContext context) + { + // Add the marker attribute to the compilation + context.RegisterPostInitializationOutput(ctx => ctx.AddSource( + "MarkerAttributes.g.cs", + SourceText.From(SourceGenerationHelper.GenerateMarkerAttributes(), Encoding.UTF8))); + + // Add the marker attribute to the compilation + context.RegisterPostInitializationOutput(ctx => ctx.AddSource( + "CollectionFixtures.g.cs", + SourceText.From(SourceGenerationHelper.GenerateCollectionFixtures(), Encoding.UTF8))); + + // Do a simple filter for enums + IncrementalValuesProvider classesToGenerate = context.SyntaxProvider + .CreateSyntaxProvider( + predicate: static (s, _) + => IsSyntaxTargetForGeneration(s), // select enums with attributes + transform: static (ctx, _) + => GetSemanticTargetForGeneration( + ctx)) // select enums with the [EnumExtensions] attribute and extract details + .Where(static m => m is not null); // Filter out errors that we don't care about - #region ISourceGenerator Members + context.RegisterSourceOutput(classesToGenerate, + static (context, source) => Execute(source, context)); + } + + #endregion - /// - public void Execute(GeneratorExecutionContext context) + private static string CreateFileName(ClassModel model) { - if (_syntaxReceiver == null) + string? prefix = model.Namespace + "."; + string[] exclusions = + [ + "Testably.Abstractions.Tests.", + "Testably.Abstractions.", + ]; + foreach (string? exclusion in exclusions) { - return; + if (prefix.StartsWith(exclusion, StringComparison.Ordinal)) + { + prefix = prefix.Substring(exclusion.Length); + } } - GlobalGenerator.GenerateClass(context); - foreach (ClassGeneratorBase classGenerator in _classGenerators) + return $"{prefix}{model.Name}.g.cs"; + } + + private static void Execute(ClassModel? model, SourceProductionContext context) + { + if (model is not null) { - foreach (ClassModel classModel in _syntaxReceiver - .GetClassModels(classGenerator.Marker)) + string? fileName = CreateFileName(model.Value); + // generate the source code and add it to the output + string result = SourceGenerationHelper.GenerateTestClasses(model.Value); + // Create a separate partial class file for each test class + context.AddSource(fileName, SourceText.From(result, Encoding.UTF8)); + } + } + + private static ClassModel? GetClassModelToGenerate(ClassModelType type, + SemanticModel semanticModel, ClassDeclarationSyntax classDeclarationSyntax) + { + // Get the semantic representation of the enum syntax + if (semanticModel.GetDeclaredSymbol(classDeclarationSyntax) is not INamedTypeSymbol + classSymbol) + { + // something went wrong + return null; + } + + return new ClassModel(type, GetNamespace(classDeclarationSyntax), classSymbol.Name); + } + + /// + /// Determine the namespace the class/enum/struct is declared in, if any + /// + private static string GetNamespace(BaseTypeDeclarationSyntax syntax) + { + // If we don't have a namespace at all we'll return an empty string + // This accounts for the "default namespace" case + string @namespace = string.Empty; + + // Get the containing syntax node for the type declaration + // (could be a nested type, for example) + SyntaxNode? potentialNamespaceParent = syntax.Parent; + + // Keep moving "out" of nested classes etc until we get to a namespace + // or until we run out of parents + while (potentialNamespaceParent != null && + potentialNamespaceParent is not NamespaceDeclarationSyntax + && potentialNamespaceParent is not FileScopedNamespaceDeclarationSyntax) + { + potentialNamespaceParent = potentialNamespaceParent.Parent; + } + + // Build up the final namespace by looping until we no longer have a namespace declaration + if (potentialNamespaceParent is BaseNamespaceDeclarationSyntax namespaceParent) + { + // We have a namespace. Use that as the type + @namespace = namespaceParent.Name.ToString(); + + // Keep moving "out" of the namespace declarations until we + // run out of nested namespace declarations + while (true) { - classGenerator.GenerateClass(context, classModel); + if (namespaceParent.Parent is not NamespaceDeclarationSyntax parent) + { + break; + } + + // Add the outer namespace as a prefix to the final namespace + @namespace = $"{namespaceParent.Name}.{@namespace}"; + namespaceParent = parent; } } + + // return the final namespace + return @namespace; } - /// - public void Initialize(GeneratorInitializationContext context) + private static ClassModel? GetSemanticTargetForGeneration(GeneratorSyntaxContext context) { - _syntaxReceiver = new SyntaxReceiver(_classGenerators); - context.RegisterForSyntaxNotifications(() => _syntaxReceiver); + // we know the node is a ClassDeclarationSyntax thanks to IsSyntaxTargetForGeneration + ClassDeclarationSyntax? classDeclarationSyntax = (ClassDeclarationSyntax)context.Node; + + // loop through all the attributes on the method + foreach (AttributeListSyntax attributeListSyntax in classDeclarationSyntax.AttributeLists) + { + foreach (AttributeSyntax attributeSyntax in attributeListSyntax.Attributes) + { + if (context.SemanticModel.GetSymbolInfo(attributeSyntax).Symbol is not IMethodSymbol + attributeSymbol) + { + // weird, we couldn't get the symbol, ignore it + continue; + } + + INamedTypeSymbol attributeContainingTypeSymbol = attributeSymbol.ContainingType; + string fullName = attributeContainingTypeSymbol.ToDisplayString(); + + return fullName switch + { + "Testably.Abstractions.TestHelpers.FileSystemTestsAttribute" => + GetClassModelToGenerate(ClassModelType.FileSystem, + context.SemanticModel, classDeclarationSyntax), + "Testably.Abstractions.TestHelpers.TimeSystemTestsAttribute" => + GetClassModelToGenerate(ClassModelType.TimeSystem, + context.SemanticModel, classDeclarationSyntax), + "Testably.Abstractions.TestHelpers.RandomSystemTestsAttribute" => + GetClassModelToGenerate(ClassModelType.RandomSystem, + context.SemanticModel, classDeclarationSyntax), + _ => null, + }; + } + } + + return null; } - #endregion + private static bool IsSyntaxTargetForGeneration(SyntaxNode syntaxNode) + { + return syntaxNode is ClassDeclarationSyntax { AttributeLists.Count: > 0 }; + } } diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/GlobalGenerator.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/GlobalGenerator.cs deleted file mode 100644 index c90d0c3c1..000000000 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/GlobalGenerator.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; -using System.Text; - -namespace Testably.Abstractions.Tests.SourceGenerator; - -public static class GlobalGenerator -{ - public static void GenerateClass(GeneratorExecutionContext context) - { - StringBuilder sourceBuilder = GetSourceBuilder(); - GenerateSource(sourceBuilder); - string fileName = "XunitCollectionFixtures.cs"; - context.AddSource(fileName, - SourceText.From(sourceBuilder.ToString(), Encoding.UTF8)); - } - - private static void GenerateSource(StringBuilder sourceBuilder) - => sourceBuilder.Append(@" -using Xunit; - -namespace Testably.Abstractions.TestHelpers.Settings; - -[CollectionDefinition(""RealFileSystemTests"")] -public class FileSystemTestSettingsFixture : ICollectionFixture -{ - // This class has no code, and is never created. Its purpose is simply - // to be the place to apply [CollectionDefinition] and all the - // ICollectionFixture<> interfaces. -} - -[CollectionDefinition(""RealTimeSystemTests"")] -public class TimeSystemTestSettingsFixture : ICollectionFixture -{ - // This class has no code, and is never created. Its purpose is simply - // to be the place to apply [CollectionDefinition] and all the - // ICollectionFixture<> interfaces. -}"); - - private static StringBuilder GetSourceBuilder() - => new( - @"//------------------------------------------------------------------------------ -// -// This code was generated by ""Testably.Abstractions.Tests.SourceGenerator"". -// -// Changes to this file may cause incorrect behavior -// and will be lost if the code is regenerated. -// -//------------------------------------------------------------------------------ -"); -} diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Model/ClassModel.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Model/ClassModel.cs deleted file mode 100644 index f31d2e50b..000000000 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/Model/ClassModel.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -namespace Testably.Abstractions.Tests.SourceGenerator.Model; - -internal sealed class ClassModel -{ - public string Name { get; } - public string Namespace { get; } - - private ClassModel(string @namespace, string name) - { - Namespace = @namespace; - Name = name; - } - - internal static ClassModel FromClassDeclarationSyntax( - ClassDeclarationSyntax classDeclarationSyntax) - { - string @namespace = GetNamespace(classDeclarationSyntax); - string name = classDeclarationSyntax.Identifier.ToString(); - return new ClassModel(@namespace, name); - } - - /// - /// Get the namespace of a . - /// - /// - /// see - /// - /// - private static string GetNamespace(SyntaxNode syntaxNode) - { - // If we don't have a namespace at all we'll return an empty string - // This accounts for the "default namespace" case - string nameSpace = string.Empty; - - // Get the containing syntax node for the type declaration - // (could be a nested type, for example) - SyntaxNode? potentialNamespaceParent = syntaxNode.Parent; - - // Keep moving "out" of nested classes until we get to a namespace - // or until we run out of parents - while (potentialNamespaceParent != null && - potentialNamespaceParent is not NamespaceDeclarationSyntax - && potentialNamespaceParent is not FileScopedNamespaceDeclarationSyntax) - { - potentialNamespaceParent = potentialNamespaceParent.Parent; - } - - // Build up the final namespace by looping until we no longer have a namespace declaration - if (potentialNamespaceParent is BaseNamespaceDeclarationSyntax namespaceParent) - { - // We have a namespace. Use that as the type - nameSpace = namespaceParent.Name.ToString(); - - // Keep moving "out" of the namespace declarations until we - // run out of nested namespace declarations - while (true) - { - if (namespaceParent.Parent is not NamespaceDeclarationSyntax parent) - { - break; - } - - // Add the outer namespace as a prefix to the final namespace - nameSpace = $"{namespaceParent.Name}.{nameSpace}"; - namespaceParent = parent; - } - } - - // return the final namespace - return nameSpace; - } -} diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.FileSystem.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.FileSystem.cs new file mode 100644 index 000000000..783b8af91 --- /dev/null +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.FileSystem.cs @@ -0,0 +1,297 @@ +using System; +using System.Text; + +namespace Testably.Abstractions.Tests.SourceGenerator; + +#pragma warning disable MA0051 +#pragma warning disable MA0028 +internal static partial class SourceGenerationHelper +{ + public static string GenerateFileSystemTestClasses(ClassModel model) + { + StringBuilder? sb = GetSourceBuilder(); + sb.AppendLine($$""" + using System.Runtime.InteropServices; + using Testably.Abstractions.Testing.Initializer; + using Testably.Abstractions.TestHelpers; + using Testably.Abstractions.TestHelpers.Settings; + using Xunit.Abstractions; + + namespace {{model.Namespace}} + { + public abstract partial class {{model.Name}} + { + /// + /// The delay in milliseconds when wanting to ensure a timeout in the test. + /// + public const int EnsureTimeout = 500; + + /// + /// The delay in milliseconds when expecting a success in the test. + /// + public const int ExpectSuccess = 30000; + + /// + /// The delay in milliseconds when expecting a timeout in the test. + /// + public const int ExpectTimeout = 30; + + public abstract string BasePath { get; } + public IFileSystem FileSystem { get; } + public Test Test { get; } + public ITimeSystem TimeSystem { get; } + + protected {{model.Name}}(Test test, IFileSystem fileSystem, ITimeSystem timeSystem) + { + Test = test; + FileSystem = fileSystem; + TimeSystem = timeSystem; + } + + /// + /// Specifies, if brittle tests should be skipped on the real file system. + /// + /// + /// (optional) A condition that must be for the test to be skipped on the + /// real file system. + /// + public abstract void SkipIfBrittleTestsShouldBeSkipped(bool condition = true); + + /// + /// Specifies, if long-running tests should be skipped on the real file system. + /// + public abstract void SkipIfLongRunningTestsShouldBeSkipped(); + + + // ReSharper disable once UnusedMember.Global + public sealed class MockFileSystemTests : {{model.Name}}, IDisposable + { + /// + public override string BasePath => _directoryCleaner.BasePath; + + private readonly IDirectoryCleaner _directoryCleaner; + + public MockFileSystemTests() : this(new MockFileSystem()) + { + } + + private MockFileSystemTests(MockFileSystem mockFileSystem) : base( + new Test(), + mockFileSystem, + mockFileSystem.TimeSystem) + { + _directoryCleaner = FileSystem + .SetCurrentDirectoryToEmptyTemporaryDirectory(); + } + + /// + public void Dispose() + => _directoryCleaner.Dispose(); + + /// + public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) + { + // Brittle tests are never skipped against the mock file system! + } + + /// + public override void SkipIfLongRunningTestsShouldBeSkipped() + { + // Long-running tests are never skipped against the mock file system! + } + } + // ReSharper disable once UnusedMember.Global + [Collection("RealFileSystemTests")] + public sealed class RealFileSystemTests : {{model.Name}}, IDisposable + { + /// + public override string BasePath => _directoryCleaner.BasePath; + + private readonly IDirectoryCleaner _directoryCleaner; + private readonly TestSettingsFixture _fixture; + + public RealFileSystemTests(ITestOutputHelper testOutputHelper, TestSettingsFixture fixture) + : base(new Test(), new RealFileSystem(), new RealTimeSystem()) + { + #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."); + } + #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."); + } + #endif + _fixture = fixture; + _directoryCleaner = FileSystem + .SetCurrentDirectoryToEmptyTemporaryDirectory($"{{model.Namespace}}{FileSystem.Path.DirectorySeparatorChar}{{model.Name}}-", testOutputHelper.WriteLine); + } + + /// + public void Dispose() + => _directoryCleaner.Dispose(); + + #if DEBUG + /// + public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) + => Xunit.Skip.If(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, + $"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, + $"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, + $"Long-running tests are {_fixture.LongRunningTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.LongRunningTests."); + #endif + } + """); + if (IncludeSimulatedTests(model)) + { + sb.AppendLine($$""" + + #if !NETFRAMEWORK + // ReSharper disable once UnusedMember.Global + public sealed class LinuxFileSystemTests : {{model.Name}}, IDisposable + { + /// + public override string BasePath => _directoryCleaner.BasePath; + + private readonly IDirectoryCleaner _directoryCleaner; + + public LinuxFileSystemTests() : this(new MockFileSystem(o => + o.SimulatingOperatingSystem(SimulationMode.Linux))) + { + } + + private LinuxFileSystemTests(MockFileSystem mockFileSystem) : base( + new Test(OSPlatform.Linux), + mockFileSystem, + mockFileSystem.TimeSystem) + { + _directoryCleaner = FileSystem + .SetCurrentDirectoryToEmptyTemporaryDirectory(); + } + + /// + public void Dispose() + => _directoryCleaner.Dispose(); + + /// + public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) + { + // Brittle tests are never skipped against the mock file system! + } + /// + public override void SkipIfLongRunningTestsShouldBeSkipped() + { + // Long-running tests are never skipped against the mock file system! + } + } + #endif + + #if !NETFRAMEWORK + // ReSharper disable once UnusedMember.Global + public sealed class MacFileSystemTests : {{model.Name}}, IDisposable + { + /// + public override string BasePath => _directoryCleaner.BasePath; + + private readonly IDirectoryCleaner _directoryCleaner; + + public MacFileSystemTests() : this(new MockFileSystem(o => + o.SimulatingOperatingSystem(SimulationMode.MacOS))) + { + } + private MacFileSystemTests(MockFileSystem mockFileSystem) : base( + new Test(OSPlatform.OSX), + mockFileSystem, + mockFileSystem.TimeSystem) + { + _directoryCleaner = FileSystem + .SetCurrentDirectoryToEmptyTemporaryDirectory(); + } + + /// + public void Dispose() + => _directoryCleaner.Dispose(); + + /// + public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) + { + // Brittle tests are never skipped against the mock file system! + } + /// + public override void SkipIfLongRunningTestsShouldBeSkipped() + { + // Long-running tests are never skipped against the mock file system! + } + } + #endif + + #if !NETFRAMEWORK + // ReSharper disable once UnusedMember.Global + public sealed class WindowsFileSystemTests : {{model.Name}}, IDisposable + { + /// + public override string BasePath => _directoryCleaner.BasePath; + + private readonly IDirectoryCleaner _directoryCleaner; + + public WindowsFileSystemTests() : this(new MockFileSystem(o => + o.SimulatingOperatingSystem(SimulationMode.Windows))) + { + } + private WindowsFileSystemTests(MockFileSystem mockFileSystem) : base( + new Test(OSPlatform.Windows), + mockFileSystem, + mockFileSystem.TimeSystem) + { + _directoryCleaner = FileSystem + .SetCurrentDirectoryToEmptyTemporaryDirectory(); + } + + /// + public void Dispose() + => _directoryCleaner.Dispose(); + + /// + public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) + { + // Brittle tests are never skipped against the mock file system! + } + /// + public override void SkipIfLongRunningTestsShouldBeSkipped() + { + // Long-running tests are never skipped against the mock file system! + } + } + #endif + """); + } + + sb.AppendLine(""" + } + } + """); + return sb.ToString(); + + static bool IncludeSimulatedTests(ClassModel model) + => !model.Namespace.Equals( + "Testably.Abstractions.AccessControl.Tests", StringComparison.Ordinal); + } +} +#pragma warning restore MA0028 +#pragma warning restore MA0051 diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.RandomSystem.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.RandomSystem.cs new file mode 100644 index 000000000..ab3482b66 --- /dev/null +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.RandomSystem.cs @@ -0,0 +1,50 @@ +using System.Text; + +namespace Testably.Abstractions.Tests.SourceGenerator; + +#pragma warning disable MA0051 +#pragma warning disable MA0028 +internal static partial class SourceGenerationHelper +{ + public static string GenerateRandomSystemTestClasses(ClassModel model) + { + StringBuilder? sb = GetSourceBuilder(); + sb.AppendLine($$""" + using Testably.Abstractions.TestHelpers; + using Xunit.Abstractions; + + namespace {{model.Namespace}} + { + public abstract partial class {{model.Name}} + { + public IRandomSystem RandomSystem { get; } + + protected {{model.Name}}(IRandomSystem randomSystem) + { + RandomSystem = randomSystem; + } + + // ReSharper disable once UnusedMember.Global + public sealed class MockRandomSystemTests : {{model.Name}} + { + public MockRandomSystemTests() : base(new MockRandomSystem()) + { + } + } + + // ReSharper disable once UnusedMember.Global + public sealed class RealRandomSystemTests : {{model.Name}} + { + public RealRandomSystemTests() : base(new RealRandomSystem()) + { + } + } + } + } + """); + + return sb.ToString(); + } +} +#pragma warning restore MA0028 +#pragma warning restore MA0051 diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.TimeSystem.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.TimeSystem.cs new file mode 100644 index 000000000..90320cbd1 --- /dev/null +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.TimeSystem.cs @@ -0,0 +1,97 @@ +using System.Text; + +namespace Testably.Abstractions.Tests.SourceGenerator; + +#pragma warning disable MA0051 +#pragma warning disable MA0028 +internal static partial class SourceGenerationHelper +{ + public static string GenerateTimeSystemTestClasses(ClassModel model) + { + StringBuilder? sb = GetSourceBuilder(); + sb.AppendLine($$""" + using Testably.Abstractions.TestHelpers; + using Testably.Abstractions.TestHelpers.Settings; + using Xunit.Abstractions; + + namespace {{model.Namespace}} + { + public abstract partial class {{model.Name}} + { + /// + /// The delay in milliseconds when wanting to ensure a timeout in the test. + /// + public const int EnsureTimeout = 500; + + /// + /// The delay in milliseconds when expecting a success in the test. + /// + public const int ExpectSuccess = 30000; + + /// + /// The delay in milliseconds when expecting a timeout in the test. + /// + public const int ExpectTimeout = 30; + + public ITimeSystem TimeSystem { get; } + + protected {{model.Name}}(ITimeSystem timeSystem) + { + TimeSystem = timeSystem; + } + + /// + /// Specifies, if brittle tests should be skipped on the real time system. + /// + /// + /// (optional) A condition that must be for the test to be skipped on the + /// real time system. + /// + public abstract void SkipIfBrittleTestsShouldBeSkipped(bool condition = true); + + // ReSharper disable once UnusedMember.Global + public sealed class MockTimeSystemTests : {{model.Name}} + { + public MockTimeSystemTests() : base(new MockTimeSystem(Testing.TimeProvider.Now())) + { + } + + /// + public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) + { + // Brittle tests are never skipped against the mock time system! + } + } + + // ReSharper disable once UnusedMember.Global + [Collection("RealTimeSystemTests")] + public sealed class RealTimeSystemTests : {{model.Name}} + { + private readonly TestSettingsFixture _fixture; + + public RealTimeSystemTests(TestSettingsFixture fixture) : base(new RealTimeSystem()) + { + _fixture = fixture; + } + + #if DEBUG + /// + public override void SkipIfBrittleTestsShouldBeSkipped(bool condition = true) + => Xunit.Skip.If(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, + $"Brittle tests are {_fixture.BrittleTests}. You can enable them by executing the corresponding tests in Testably.Abstractions.TestSettings.BrittleTests."); + #endif + } + } + } + """); + + return sb.ToString(); + } +} +#pragma warning restore MA0028 +#pragma warning restore MA0051 diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.cs new file mode 100644 index 000000000..eb6fc9e9d --- /dev/null +++ b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SourceGenerationHelper.cs @@ -0,0 +1,99 @@ +using System; +using System.Text; + +namespace Testably.Abstractions.Tests.SourceGenerator; + +#pragma warning disable MA0051 +internal static partial class SourceGenerationHelper +{ + public static string GenerateCollectionFixtures() + { + StringBuilder? sb = GetSourceBuilder(); + sb.Append(""" + using Xunit; + + namespace Testably.Abstractions.TestHelpers.Settings; + + [CollectionDefinition("RealFileSystemTests")] + public class FileSystemTestSettingsFixture : ICollectionFixture + { + // This class has no code, and is never created. Its purpose is simply + // to be the place to apply [CollectionDefinition] and all the + // ICollectionFixture<> interfaces. + } + + [CollectionDefinition("RealTimeSystemTests")] + public class TimeSystemTestSettingsFixture : ICollectionFixture + { + // This class has no code, and is never created. Its purpose is simply + // to be the place to apply [CollectionDefinition] and all the + // ICollectionFixture<> interfaces. + } + """); + return sb.ToString(); + } + public static string GenerateMarkerAttributes() + { + StringBuilder? sb = GetSourceBuilder(); + sb.Append(""" + namespace Testably.Abstractions.TestHelpers + { + /// + /// Marks a class to contain tests for the that runs against mock and real implementations. + /// + /// + /// The class must be abstract and partial and will get an `IFileSystem FileSystem` property injected + /// + [System.AttributeUsage(System.AttributeTargets.Class)] + public class FileSystemTestsAttribute : System.Attribute + { + } + + /// + /// Marks a class to contain tests for the that runs against mock and real implementations. + /// + /// + /// The class must be abstract and partial and will get an `ITimeSystem TimeSystem` property injected + /// + [System.AttributeUsage(System.AttributeTargets.Class)] + public class TimeSystemTestsAttribute : System.Attribute + { + } + + /// + /// Marks a class to contain tests for the that runs against mock and real implementations. + /// + /// + /// The class must be abstract and partial and will get an `IRandomSystem RandomSystem` property injected + /// + [System.AttributeUsage(System.AttributeTargets.Class)] + public class RandomSystemTestsAttribute : System.Attribute + { + } + } + """); + return sb.ToString(); + } + + public static string GenerateTestClasses(ClassModel model) + => model.Type switch + { + ClassModelType.FileSystem => GenerateFileSystemTestClasses(model), + ClassModelType.TimeSystem => GenerateTimeSystemTestClasses(model), + ClassModelType.RandomSystem => GenerateRandomSystemTestClasses(model), + _ => throw new NotSupportedException(), + }; + + private static StringBuilder GetSourceBuilder() + => new( + @"//------------------------------------------------------------------------------ +// +// This code was generated by ""Testably.Abstractions.Tests.SourceGenerator"". +// +// Changes to this file may cause incorrect behavior +// and will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ +"); +} +#pragma warning restore MA0051 diff --git a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SyntaxReceiver.cs b/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SyntaxReceiver.cs deleted file mode 100644 index 3666ebb17..000000000 --- a/Tests/Helpers/Testably.Abstractions.Tests.SourceGenerator/SyntaxReceiver.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using System; -using System.Collections.Generic; -using Testably.Abstractions.Tests.SourceGenerator.Model; - -namespace Testably.Abstractions.Tests.SourceGenerator; - -internal sealed class SyntaxReceiver : ISyntaxReceiver -{ - private readonly Dictionary> - _classModels = new(StringComparer.Ordinal); - - public SyntaxReceiver(IEnumerable classGenerators) - { - foreach (ClassGeneratorBase classGenerator in classGenerators) - { - _classModels.Add(classGenerator.Marker, []); - } - } - - #region ISyntaxReceiver Members - - /// - public void OnVisitSyntaxNode(SyntaxNode syntaxNode) - { - if (syntaxNode is ClassDeclarationSyntax classDeclarationSyntax) - { - string? marker = classDeclarationSyntax.BaseList?.Types.FirstOrDefault() - ?.ToString(); - - if (marker != null && - _classModels.TryGetValue(marker, out List? models)) - { - models!.Add( - ClassModel.FromClassDeclarationSyntax(classDeclarationSyntax)); - } - } - } - - #endregion - - public List GetClassModels(string marker) - { - if (_classModels.TryGetValue(marker, out List? classModels)) - { - return classModels!; - } - - return []; - } -} 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 5f539b4d7..2fd8416ca 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 @@ -2,6 +2,7 @@ netstandard2.0 + false latest true diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/AccessControlHelperTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/AccessControlHelperTests.cs index 0709aebb7..f1d7d9d91 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/AccessControlHelperTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/AccessControlHelperTests.cs @@ -1,13 +1,9 @@ -using aweXpect; -using System.IO; -using System.Threading.Tasks; +using System.IO; namespace Testably.Abstractions.AccessControl.Tests; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AccessControlHelperTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AccessControlHelperTests { [SkippableFact] public async Task GetExtensibilityOrThrow_DirectoryInfo_ShouldNotThrow() diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs index ff04f28ca..b868d49fa 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryAclExtensionsTests.cs @@ -1,15 +1,11 @@ -using aweXpect; using System.Security.AccessControl; -using System.Threading.Tasks; using Testably.Abstractions.AccessControl.Tests.TestHelpers; using Skip = Xunit.Skip; namespace Testably.Abstractions.AccessControl.Tests; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class DirectoryAclExtensionsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class DirectoryAclExtensionsTests { [SkippableFact] public async Task CreateDirectory_NullDirectorySecurity_ShouldThrowArgumentNullException() diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs index f74811fcc..b2f0f5f1d 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/DirectoryInfoAclExtensionsTests.cs @@ -6,10 +6,8 @@ namespace Testably.Abstractions.AccessControl.Tests; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class DirectoryInfoAclExtensionsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class DirectoryInfoAclExtensionsTests { [SkippableFact] public async Task Create_NullDirectorySecurity_ShouldThrowArgumentNullException() diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionMissingFileTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionMissingFileTests.cs index ec97e8c3c..637ccbd2a 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionMissingFileTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionMissingFileTests.cs @@ -6,10 +6,8 @@ namespace Testably.Abstractions.AccessControl.Tests; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionMissingFileTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionMissingFileTests { [SkippableTheory] [MemberData(nameof(GetFileCallbacks), diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionTests.cs index 30049b334..ac61265a6 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/ExceptionTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.AccessControl.Tests; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetFileCallbacks), diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/FileAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/FileAclExtensionsTests.cs index 74b448e53..7fd5c60da 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/FileAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/FileAclExtensionsTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.AccessControl.Tests; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class FileAclExtensionsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class FileAclExtensionsTests { [SkippableFact] public async Task GetAccessControl_MissingFile_ShouldThrowFileNotFoundException() diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/FileInfoAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/FileInfoAclExtensionsTests.cs index fee514bf9..56e16b09d 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/FileInfoAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/FileInfoAclExtensionsTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.AccessControl.Tests; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class FileInfoAclExtensionsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class FileInfoAclExtensionsTests { [SkippableFact] public async Task GetAccessControl_MissingFile_ShouldThrowFileNotFoundException() diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/FileStreamAclExtensionsTests.cs b/Tests/Testably.Abstractions.AccessControl.Tests/FileStreamAclExtensionsTests.cs index 88302c9f7..a625d8e7e 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/FileStreamAclExtensionsTests.cs +++ b/Tests/Testably.Abstractions.AccessControl.Tests/FileStreamAclExtensionsTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.AccessControl.Tests; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class FileStreamAclExtensionsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class FileStreamAclExtensionsTests { [SkippableFact] public async Task GetAccessControl_ShouldBeInitializedWithNotNullValue() diff --git a/Tests/Testably.Abstractions.AccessControl.Tests/Testably.Abstractions.AccessControl.Tests.csproj b/Tests/Testably.Abstractions.AccessControl.Tests/Testably.Abstractions.AccessControl.Tests.csproj index 3791356a6..66fbf4ab7 100644 --- a/Tests/Testably.Abstractions.AccessControl.Tests/Testably.Abstractions.AccessControl.Tests.csproj +++ b/Tests/Testably.Abstractions.AccessControl.Tests/Testably.Abstractions.AccessControl.Tests.csproj @@ -17,12 +17,13 @@ true - Generated + Generated + $(GeneratedFolder)\$(TargetFramework) - - + + diff --git a/Tests/Testably.Abstractions.Compression.Tests/Testably.Abstractions.Compression.Tests.csproj b/Tests/Testably.Abstractions.Compression.Tests/Testably.Abstractions.Compression.Tests.csproj index 2fcc4e1be..fedd6d0d2 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/Testably.Abstractions.Compression.Tests.csproj +++ b/Tests/Testably.Abstractions.Compression.Tests/Testably.Abstractions.Compression.Tests.csproj @@ -17,16 +17,13 @@ true - Generated + Generated + $(GeneratedFolder)\$(TargetFramework) - - - - - - + + diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/ExtensionTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/ExtensionTests.cs index c85b818d1..b6327a9f4 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/ExtensionTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/ExtensionTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Compression.Tests.ZipArchive; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExtensionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExtensionTests { [SkippableTheory] [InlineData("2000-01-01T12:14:15")] diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/Tests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/Tests.cs index 55a649eac..c61f11b52 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/Tests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchive/Tests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Compression.Tests.ZipArchive; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { #if FEATURE_ZIPFILE_NET7 [SkippableFact] diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/ExtensionTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/ExtensionTests.cs index 74821bd6c..b3d651492 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/ExtensionTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/ExtensionTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Compression.Tests.ZipArchiveEntry; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExtensionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExtensionTests { [SkippableFact] public async Task diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/Tests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/Tests.cs index 6af129ac3..c9a64484a 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/Tests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveEntry/Tests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Compression.Tests.ZipArchiveEntry; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableFact] public async Task Archive_ShouldBeSetToArchive() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveFactory/Tests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveFactory/Tests.cs index e0b8d1d7f..1e5db95c7 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipArchiveFactory/Tests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Compression.Tests.ZipArchiveFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableFact] public async Task New_ShouldOpenWithReadMode() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/CreateFromDirectoryTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/CreateFromDirectoryTests.cs index 2cc1ffe67..abff61661 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/CreateFromDirectoryTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/CreateFromDirectoryTests.cs @@ -1,5 +1,4 @@ -using FluentAssertions; -using System.IO.Compression; +using System.IO.Compression; using System.Text; #if FEATURE_COMPRESSION_STREAM using System.IO; @@ -8,10 +7,8 @@ namespace Testably.Abstractions.Compression.Tests.ZipFile; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateFromDirectoryTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateFromDirectoryTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/ExtractToDirectoryTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/ExtractToDirectoryTests.cs index 65e6619cb..6ff42456e 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/ExtractToDirectoryTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/ExtractToDirectoryTests.cs @@ -7,10 +7,8 @@ namespace Testably.Abstractions.Compression.Tests.ZipFile; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExtractToDirectoryTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExtractToDirectoryTests { [SkippableFact] public async Task ExtractToDirectory_MissingDestinationDirectory_ShouldCreateDirectory() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/OpenTests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/OpenTests.cs index 174e93913..3ff6ca258 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/OpenTests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/OpenTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Compression.Tests.ZipFile; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OpenTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OpenTests { [SkippableFact] public async Task Open_CreateMode_ShouldInitializeEmptyArchive() diff --git a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/Tests.cs b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/Tests.cs index 10533afc4..f11814e23 100644 --- a/Tests/Testably.Abstractions.Compression.Tests/ZipFile/Tests.cs +++ b/Tests/Testably.Abstractions.Compression.Tests/ZipFile/Tests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Compression.Tests.ZipFile; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableFact] public async Task FileSystemExtension_ShouldBeSet() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateDirectoryTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateDirectoryTests.cs index e86d5c254..37f954cbb 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateDirectoryTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateDirectoryTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateDirectoryTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateDirectoryTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateSymbolicLinkTests.cs index 9fb55bcdb..ea3704eb0 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/CreateSymbolicLinkTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateSymbolicLinkTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateSymbolicLinkTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs index 6fc4937c2..4f25f7695 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class DeleteTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class DeleteTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs index 11fd36da4..335de9e63 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateDirectoriesTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class EnumerateDirectoriesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EnumerateDirectoriesTests { [SkippableFact] public void EnumerateDirectories_AbsolutePath_ShouldNotIncludeTrailingSlash() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFileSystemInfosTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFileSystemInfosTests.cs index 5cb88b977..d58e39da9 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFileSystemInfosTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFileSystemInfosTests.cs @@ -8,10 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class EnumerateFileSystemInfosTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EnumerateFileSystemInfosTests { [SkippableTheory] [AutoData] @@ -36,7 +34,7 @@ public void EnumerateFileSystemEntries_SearchOptionAllDirectories_FullPath_ShouldReturnAllFileSystemEntriesWithFullPath( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -61,7 +59,7 @@ public void EnumerateFileSystemEntries_SearchOptionAllDirectories_ShouldReturnAllFileSystemEntries( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -119,7 +117,7 @@ public void EnumerateFileSystemEntries_WithEnumerationOptions_ShouldConsiderSetOptions( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -183,7 +181,7 @@ public void EnumerateFileSystemEntries_WithoutSearchString_ShouldReturnAllFileSystemEntriesInDirectSubdirectories( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithAFile() @@ -208,7 +206,7 @@ public void EnumerateFileSystemEntries_WithSearchPattern_ShouldReturnMatchingFileSystemEntries( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithAFile() @@ -229,7 +227,7 @@ public void public void EnumerateFileSystemEntries_WithSearchPatternInSubdirectory_ShouldReturnMatchingFileSystemEntriesInSubdirectories() { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithASubdirectory().Initialized(s => s .WithAFile("foobar")) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFilesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFilesTests.cs index 1a4b96d42..3c819783d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFilesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/EnumerateFilesTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class EnumerateFilesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EnumerateFilesTests { [SkippableTheory] [AutoData] @@ -33,7 +31,7 @@ public void EnumerateFiles_SearchOptionAllDirectories_FullPath_ShouldReturnAllFilesWithFullPath( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -54,7 +52,7 @@ public void public void EnumerateFiles_SearchOptionAllDirectories_ShouldReturnAllFiles( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -361,7 +359,7 @@ public void EnumerateFiles_WithoutSearchString_ShouldReturnAllFilesInDirectSubdirectories( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithAFile() @@ -383,7 +381,7 @@ public void public void EnumerateFiles_WithSearchPattern_ShouldReturnMatchingFiles( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithAFile() @@ -404,7 +402,7 @@ public void EnumerateFiles_WithSearchPattern_ShouldReturnMatchingFiles( public void EnumerateFiles_WithSearchPatternInSubdirectory_ShouldReturnMatchingFilesInSubdirectories() { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithASubdirectory().Initialized(s => s .WithAFile("foobar")) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExceptionTests.cs index 1d62bec45..c40a3536e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExceptionTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetDirectoryCallbacks), parameters: "Illegal\tCharacter?InPath")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExistsTests.cs index ec791f094..3c4abddb3 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ExistsTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExistsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExistsTests { [SkippableTheory] [InlineData("foo")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoriesTests.cs index 4ad8047dd..91be93b89 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoriesTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetDirectoriesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetDirectoriesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoryRootTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoryRootTests.cs index ef6ae78c7..104402571 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoryRootTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetDirectoryRootTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetDirectoryRootTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetDirectoryRootTests { [SkippableFact] public void GetDirectoryRoot_Empty_ShouldThrowArgumentException() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFileSystemInfosTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFileSystemInfosTests.cs index 48c3edaac..161421572 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFileSystemInfosTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFileSystemInfosTests.cs @@ -8,10 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetFileSystemInfosTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetFileSystemInfosTests { [SkippableTheory] [AutoData] @@ -35,7 +33,7 @@ public void GetFileSystemEntries_SearchOptionAllDirectories_FullPath_ShouldReturnAllFileSystemEntriesWithFullPath( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -60,7 +58,7 @@ public void GetFileSystemEntries_SearchOptionAllDirectories_ShouldReturnAllFileSystemEntries( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -118,7 +116,7 @@ public void GetFileSystemEntries_WithEnumerationOptions_ShouldConsiderSetOptions( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -165,7 +163,7 @@ public void GetFileSystemEntries_WithoutSearchString_ShouldReturnAllFileSystemEntriesInDirectSubdirectories( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithAFile() @@ -190,7 +188,7 @@ public void GetFileSystemEntries_WithSearchPattern_ShouldReturnMatchingFileSystemEntries( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithAFile() @@ -211,7 +209,7 @@ public void public void GetFileSystemEntries_WithSearchPatternInSubdirectory_ShouldReturnMatchingFileSystemEntriesInSubdirectories() { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithASubdirectory().Initialized(s => s .WithAFile("foobar")) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFilesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFilesTests.cs index 10f97879b..a8b273b00 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFilesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/GetFilesTests.cs @@ -8,10 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetFilesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetFilesTests { [SkippableTheory] [AutoData] @@ -70,7 +68,7 @@ public void GetFiles_SearchOptionAllDirectories_FullPath_ShouldReturnAllFilesWithFullPath( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -91,7 +89,7 @@ public void public void GetFiles_SearchOptionAllDirectories_ShouldReturnAllFiles( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -197,7 +195,7 @@ public void GetFiles_WithEnumerationOptions_ShouldConsiderSetOptions( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithASubdirectory().Initialized(s => s @@ -244,7 +242,7 @@ public void GetFiles_WithoutSearchString_ShouldReturnAllFilesInDirectSubdirectories( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithAFile() @@ -288,7 +286,7 @@ public void GetFiles_WithRelativePathAndSubfolders_ShouldReturnRelativeFilePath( public void GetFiles_WithSearchPattern_ShouldReturnMatchingFiles( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.InitializeIn(path) .WithAFile() .WithAFile() @@ -309,7 +307,7 @@ public void GetFiles_WithSearchPattern_ShouldReturnMatchingFiles( public void GetFiles_WithSearchPatternInSubdirectory_ShouldReturnMatchingFilesInSubdirectories() { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithASubdirectory().Initialized(s => s .WithAFile("foobar")) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/MoveTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/MoveTests.cs index 4c9232fa6..b03ad0af3 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/MoveTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/MoveTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class MoveTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class MoveTests { [SkippableTheory] [AutoData] @@ -16,7 +14,7 @@ public void Move_CaseOnlyChange_ShouldMoveDirectoryWithContent(string path) string source = path.ToLowerInvariant(); string destination = path.ToUpperInvariant(); - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(source).Initialized(s => s .WithAFile() @@ -98,7 +96,7 @@ public void Move_ShouldMoveAttributes(string source, string destination) [AutoData] public void Move_ShouldMoveDirectoryWithContent(string source, string destination) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(source).Initialized(s => s .WithAFile() @@ -178,7 +176,7 @@ public void Move_WithLockedFile_ShouldStillMoveDirectory_NotOnWindows( { Skip.If(Test.RunsOnWindows); - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(source).Initialized(s => s .WithAFile() @@ -219,7 +217,7 @@ public void Move_WithLockedFile_ShouldThrowIOException_AndNotMoveDirectoryAtAll_ { Skip.IfNot(Test.RunsOnWindows); - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(source).Initialized(s => s .WithAFile() @@ -257,7 +255,7 @@ public void Move_WithLockedFile_ShouldThrowIOException_AndNotMoveDirectoryAtAll_ public void Move_WithReadOnlyFile_ShouldMoveDirectoryWithContent( string source, string destination) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(source).Initialized(s => s .WithAFile() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ResolveLinkTargetTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ResolveLinkTargetTests.cs index 557d545f6..a38cd6fb1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ResolveLinkTargetTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/ResolveLinkTargetTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ResolveLinkTargetTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ResolveLinkTargetTests { #region Test Setup diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/SearchFilterTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/SearchFilterTests.cs index 4cbcb05cb..66cfe2748 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/SearchFilterTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/SearchFilterTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class SearchFilterTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class SearchFilterTests { [SkippableTheory] [InlineAutoData("../", 4)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.AdjustTimes.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.AdjustTimes.cs index c46d23416..471c5069d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.AdjustTimes.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.AdjustTimes.cs @@ -1,7 +1,6 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -public abstract partial class Tests - where TFileSystem : IFileSystem +public partial class Tests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs index f7e074b7d..ea4079145 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.Times.cs @@ -2,8 +2,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -public abstract partial class Tests - where TFileSystem : IFileSystem +public partial class Tests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.cs index be1854de6..f6d57b3e3 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Directory/Tests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Directory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { #if FEATURE_FILESYSTEM_NET7 [SkippableFact] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/AttributesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/AttributesTests.cs index 3ccdedd89..8b26e81d5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/AttributesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/AttributesTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AttributesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AttributesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateAsSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateAsSymbolicLinkTests.cs index c6d7c0aba..6f9e1744d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateAsSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateAsSymbolicLinkTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateAsSymbolicLinkTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateAsSymbolicLinkTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateSubdirectoryTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateSubdirectoryTests.cs index a0b0fdac9..9e92fc712 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateSubdirectoryTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateSubdirectoryTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateSubdirectoryTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateSubdirectoryTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateTests.cs index ecf78d3a6..039a610dc 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/CreateTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs index d2474d701..e9a45ad06 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class DeleteTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class DeleteTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateDirectoriesTests.cs index 9ad3ff224..85976971c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateDirectoriesTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class EnumerateDirectoriesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EnumerateDirectoriesTests { [SkippableTheory] [AutoData] @@ -16,7 +14,7 @@ public void EnumerateDirectories_SearchOptionAllDirectories_ShouldReturnAllSubdirectories( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(path).Initialized(s => s .WithSubdirectory("foo/xyz") diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFileSystemInfosTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFileSystemInfosTests.cs index be96253f0..aaa4ff5c5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFileSystemInfosTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFileSystemInfosTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class EnumerateFileSystemInfosTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EnumerateFileSystemInfosTests { [SkippableTheory] [AutoData] @@ -16,7 +14,7 @@ public void EnumerateFileSystemInfos_SearchOptionAllFiles_ShouldReturnAllFiles( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(path).Initialized(s => s .WithASubdirectory().Initialized(d => d @@ -80,7 +78,7 @@ public void EnumerateFileSystemInfos_SearchPattern_ShouldReturnExpectedValue( public void EnumerateFileSystemInfos_ShouldMatchTypes(string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(path).Initialized(s => s .WithASubdirectory() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFilesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFilesTests.cs index 1b3ece48e..9501978f2 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFilesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/EnumerateFilesTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class EnumerateFilesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EnumerateFilesTests { [SkippableTheory] [AutoData] @@ -16,7 +14,7 @@ public void EnumerateFiles_SearchOptionAllFiles_ShouldReturnAllFiles( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(path).Initialized(s => s .WithASubdirectory().Initialized(d => d diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExceptionTests.cs index 7b5e8bcf9..499fdb331 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExceptionTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetDirectoryInfoCallbacks), diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExistsTests.cs index 92ed6cee7..9b45becd3 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/ExistsTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExistsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExistsTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetDirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetDirectoriesTests.cs index 7be1bc52d..e939b450f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetDirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetDirectoriesTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetDirectoriesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetDirectoriesTests { [SkippableTheory] [AutoData] @@ -16,7 +14,7 @@ public void GetDirectories_SearchOptionAllDirectories_ShouldReturnAllSubdirectories( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(path).Initialized(s => s .WithSubdirectory("foo/xyz") diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFileSystemInfosTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFileSystemInfosTests.cs index 0c4962f5e..6f09211a5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFileSystemInfosTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFileSystemInfosTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetFileSystemInfosTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetFileSystemInfosTests { [SkippableTheory] [AutoData] @@ -16,7 +14,7 @@ public void GetFileSystemInfos_SearchOptionAllFiles_ShouldReturnAllFiles( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(path).Initialized(s => s .WithASubdirectory().Initialized(d => d @@ -80,7 +78,7 @@ public void GetFileSystemInfos_SearchPattern_ShouldReturnExpectedValue( public void GetFileSystemInfos_ShouldMatchTypes(string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(path).Initialized(s => s .WithASubdirectory() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFilesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFilesTests.cs index c52059cf9..d7cea7846 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFilesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/GetFilesTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetFilesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetFilesTests { [SkippableTheory] [AutoData] @@ -16,7 +14,7 @@ public void GetFiles_SearchOptionAllFiles_ShouldReturnAllFiles( string path) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(path).Initialized(s => s .WithASubdirectory().Initialized(d => d diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/MoveToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/MoveToTests.cs index 24614b122..38b138af1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/MoveToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/MoveToTests.cs @@ -3,16 +3,14 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class MoveToTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class MoveToTests { [SkippableTheory] [AutoData] public void MoveTo_ShouldMoveDirectoryWithContent(string source, string destination) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(source).Initialized(s => s .WithAFile() @@ -63,7 +61,7 @@ public void MoveTo_WithLockedFile_ShouldMoveDirectory_NotOnWindows( { Skip.If(Test.RunsOnWindows); - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(source).Initialized(s => s .WithAFile() @@ -105,7 +103,7 @@ public void MoveTo_WithLockedFile_ShouldThrowIOException_AndNotMoveDirectory_OnW { Skip.IfNot(Test.RunsOnWindows); - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(source).Initialized(s => s .WithAFile() @@ -154,7 +152,7 @@ public void MoveTo_WithLockedFile_ShouldThrowIOException_AndNotMoveDirectory_OnW public void MoveTo_WithReadOnlyFile_ShouldMoveDirectoryWithContent( string source, string destination) { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithSubdirectory(source).Initialized(s => s .WithAFile() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs index 92904a533..340a927e1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/Tests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [InlineData("foo")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/ExceptionTests.cs index cb293dc10..c9bbb7745 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/ExceptionTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfoFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetDirectoryInfoFactoryCallbacks), diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/Tests.cs index 47fe359d5..297d0130d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfoFactory/Tests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DirectoryInfoFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [InlineData("\0foo")] @@ -65,7 +63,7 @@ public void Wrap_ShouldWrapFromDirectoryInfo(string path) Skip.If(FileSystem is MockFileSystem mockFileSystem && mockFileSystem.SimulationMode != SimulationMode.Native); - System.IO.DirectoryInfo directoryInfo = new("S:\\" + path); + System.IO.DirectoryInfo directoryInfo = new(path); IDirectoryInfo result = FileSystem.DirectoryInfo.Wrap(directoryInfo); @@ -80,7 +78,7 @@ public void Wrap_WithSimulatedMockFileSystem_ShouldThrowNotSupportedException(st Skip.IfNot(FileSystem is MockFileSystem mockFileSystem && mockFileSystem.SimulationMode != SimulationMode.Native); - System.IO.DirectoryInfo directoryInfo = new("S:\\" + path); + System.IO.DirectoryInfo directoryInfo = new(path); Exception? exception = Record.Exception(() => { diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfo/Tests.cs index ae7dc5ca2..e2a3bbec6 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfo/Tests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.DriveInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableFact] public void ToString_ShouldReturnDriveName() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/ExceptionTests.cs index ee4e5015a..c8b5d7c64 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/ExceptionTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DriveInfoFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [InlineData("?invalid-drive-name")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs index a4a8d67c0..8bd75e29d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.DriveInfoFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableFact] public void GetDrives_ShouldNotBeEmpty() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs index 9be1c795c..88a8f60b8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs @@ -10,10 +10,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; // ReSharper disable MethodHasAsyncOverload -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AppendAllLinesAsyncTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AppendAllLinesAsyncTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesTests.cs index aa05ed9ca..6f4667072 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AppendAllLinesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AppendAllLinesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs index 61fb7a996..4c7d9437a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextAsyncTests.cs @@ -8,10 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; // ReSharper disable MethodHasAsyncOverload -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AppendAllTextAsyncTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AppendAllTextAsyncTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextTests.cs index ec663c33b..90b65351e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AppendAllTextTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AppendAllTextTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendTextTests.cs index 9b36bfef0..66138d948 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/AppendTextTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AppendTextTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AppendTextTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/CopyTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/CopyTests.cs index e33297339..68d8d9d93 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/CopyTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/CopyTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CopyTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CopyTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateSymbolicLinkTests.cs index ca0e3ffc7..cacca201f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateSymbolicLinkTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateSymbolicLinkTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateSymbolicLinkTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTests.cs index 669549a74..6f5b1ab8b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTextTests.cs index 9c5a700bb..622fc8c37 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/CreateTextTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateTextTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateTextTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/DeleteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/DeleteTests.cs index 2d2ef41a6..2c1b2a933 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/DeleteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/DeleteTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class DeleteTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class DeleteTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/EncryptDecryptTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/EncryptDecryptTests.cs index 27d41e3f1..0baf5189f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/EncryptDecryptTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/EncryptDecryptTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class EncryptDecryptTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EncryptDecryptTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionMissingFileTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionMissingFileTests.cs index 789cd648d..d97a3ad92 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionMissingFileTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionMissingFileTests.cs @@ -9,10 +9,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionMissingFileTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionMissingFileTests { [SkippableTheory] [MemberData(nameof(GetFileCallbacks), parameters: (int)MissingFileTestCases.DirectoryMissing)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionTests.cs index cd09f2ec1..ab2298489 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExceptionTests.cs @@ -9,10 +9,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetFileCallbacks), parameters: "Illegal\tCharacter?InPath")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExistsTests.cs index 3f70c03d1..6ceaaf530 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ExistsTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExistsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExistsTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/GetAttributesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/GetAttributesTests.cs index e2567d08c..a1ab630eb 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/GetAttributesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/GetAttributesTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetAttributesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetAttributesTests { [SkippableTheory] [InlineAutoData(FileAttributes.ReadOnly)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/MoveTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/MoveTests.cs index 9dd733a27..7ccacdbda 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/MoveTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/MoveTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class MoveTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class MoveTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs index 0d24cfd1e..4ccd0f93d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenReadTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OpenReadTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OpenReadTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTests.cs index d56b928f2..2b31e0269 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OpenTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OpenTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTextTests.cs index 33344bbfd..53452ab83 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenTextTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OpenTextTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OpenTextTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenWriteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenWriteTests.cs index faa240376..42150914c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenWriteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/OpenWriteTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OpenWriteTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OpenWriteTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs index f2fc3b5f8..6a1767c5c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesAsyncTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReadAllBytesAsyncTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReadAllBytesAsyncTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesTests.cs index 94347830d..6eb4ca1ce 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllBytesTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReadAllBytesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReadAllBytesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs index e9346901d..3697679aa 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesAsyncTests.cs @@ -7,10 +7,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReadAllLinesAsyncTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReadAllLinesAsyncTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesTests.cs index 5a946ca04..c1eea8d87 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReadAllLinesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReadAllLinesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs index 930ef73d4..9a7d7deb6 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextAsyncTests.cs @@ -7,10 +7,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReadAllTextAsyncTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReadAllTextAsyncTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextTests.cs index 4e2090d8d..51237f2be 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllTextTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReadAllTextTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReadAllTextTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs index 74d1d8371..b40563168 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesAsyncTests.cs @@ -8,10 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReadLinesAsyncTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReadLinesAsyncTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesTests.cs index e38560495..307965584 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReadLinesTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReadLinesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReadLinesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReplaceTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReplaceTests.cs index d0ca89906..7004dc329 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ReplaceTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ReplaceTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReplaceTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReplaceTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/ResolveLinkTargetTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/ResolveLinkTargetTests.cs index f74eda445..d78bb59d4 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/ResolveLinkTargetTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/ResolveLinkTargetTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ResolveLinkTargetTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ResolveLinkTargetTests { #region Test Setup diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/SetAttributesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/SetAttributesTests.cs index 782c2790c..5a5436922 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/SetAttributesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/SetAttributesTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class SetAttributesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class SetAttributesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/Tests.cs index 2aea5b3a9..95e59d246 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/Tests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/UnixFileModeTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/UnixFileModeTests.cs index ea2370ac3..dffc9538b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/UnixFileModeTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/UnixFileModeTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class UnixFileModeTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class UnixFileModeTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs index e08270274..84ec0066e 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesAsyncTests.cs @@ -7,10 +7,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; // ReSharper disable MethodHasAsyncOverload -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class WriteAllBytesAsyncTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class WriteAllBytesAsyncTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesTests.cs index 3f76e6a59..3075e8972 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllBytesTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class WriteAllBytesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class WriteAllBytesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs index 7d9ca6d20..7b930d2c1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesAsyncTests.cs @@ -7,10 +7,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class WriteAllLinesAsyncTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class WriteAllLinesAsyncTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesTests.cs index 5ef3cfa5b..0629d9a6a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllLinesTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class WriteAllLinesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class WriteAllLinesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs index 5682540ba..db8781db6 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs @@ -6,10 +6,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class WriteAllTextAsyncTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class WriteAllTextAsyncTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextTests.cs index 3550cd2b9..9eb24c7bf 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.File; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class WriteAllTextTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class WriteAllTextTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AppendTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AppendTextTests.cs index ff7df041c..663bf5869 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AppendTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AppendTextTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AppendTextTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AppendTextTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AttributesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AttributesTests.cs index 5f9538547..fcc4c1e33 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AttributesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/AttributesTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AttributesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AttributesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CopyToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CopyToTests.cs index e2c9e6eb7..e3b9c2073 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CopyToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CopyToTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CopyToTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CopyToTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateAsSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateAsSymbolicLinkTests.cs index 52c648a86..d291d4ff8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateAsSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateAsSymbolicLinkTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateAsSymbolicLinkTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateAsSymbolicLinkTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTests.cs index 65ae12900..ce5dbc1c8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTextTests.cs index 56a51ec52..45545ff2a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/CreateTextTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateTextTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateTextTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/DeleteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/DeleteTests.cs index e4e0fe28d..dc4687903 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/DeleteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/DeleteTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class DeleteTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class DeleteTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/EncryptDecryptTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/EncryptDecryptTests.cs index ff707823b..3aadf7a6b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/EncryptDecryptTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/EncryptDecryptTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class EncryptDecryptTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EncryptDecryptTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExceptionTests.cs index 3d17d524e..509cba84f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExceptionTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetFileInfoCallbacks), parameters: "Illegal\tCharacter?InPath")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExistsTests.cs index 7d23415bc..6e23d4a93 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ExistsTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExistsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExistsTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/LengthTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/LengthTests.cs index 3d0970a93..0171a8187 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/LengthTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/LengthTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class LengthTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class LengthTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/MoveToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/MoveToTests.cs index f2ee9de3c..d4f75fbd8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/MoveToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/MoveToTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class MoveToTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class MoveToTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenReadTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenReadTests.cs index a2b17e86a..8ef114e82 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenReadTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenReadTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OpenReadTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OpenReadTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTests.cs index 0d430b0be..7c132b24d 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OpenTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OpenTests { #if NETFRAMEWORK [SkippableTheory] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTextTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTextTests.cs index c5bdd63a6..b0e7b0c6a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTextTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenTextTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OpenTextTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OpenTextTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenWriteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenWriteTests.cs index 719a211c2..fdabf97ea 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenWriteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/OpenWriteTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OpenWriteTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OpenWriteTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ReplaceTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ReplaceTests.cs index 189550c3e..353a3635c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ReplaceTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/ReplaceTests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ReplaceTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReplaceTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/Tests.cs index f7a378b94..a39c730ee 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfo/Tests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [AutoData] @@ -36,7 +34,7 @@ public void Attributes_WhenFileIsMissing_ShouldReturnMinusOne(string path) [SkippableFact] public void Directory_ShouldReturnParentDirectory() { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithASubdirectory().Initialized(s => s .WithAFile()); @@ -49,7 +47,7 @@ public void Directory_ShouldReturnParentDirectory() [SkippableFact] public void DirectoryName_ShouldReturnNameOfParentDirectory() { - IFileSystemDirectoryInitializer initialized = + IFileSystemDirectoryInitializer initialized = FileSystem.Initialize() .WithASubdirectory().Initialized(s => s .WithAFile()); diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/ExceptionTests.cs index 53d9baa25..a18a87f1a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/ExceptionTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfoFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetFileInfoFactoryCallbacks), diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/Tests.cs index 8d6acd183..e746fe8eb 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileInfoFactory/Tests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileInfoFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [InlineData(259)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs index a34a981b1..6f738d062 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/AdjustTimesTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class AdjustTimesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class AdjustTimesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs index 6d05f0a24..e907f8dad 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/CopyToTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CopyToTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CopyToTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs index 6f4260bf8..9149af33b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/DisposeTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class DisposeTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class DisposeTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs index 03a03ee22..8a117c5b7 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/FileAccessTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class FileAccessTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class FileAccessTests { [SkippableTheory] [InlineAutoData(FileAccess.Read, FileShare.Read, diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/OptionsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/OptionsTests.cs index ddd992c38..848fc6965 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/OptionsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/OptionsTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class OptionsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class OptionsTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs index 5a4fdc2e5..9a2ddfabc 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/ReadTests.cs @@ -9,11 +9,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; -// ReSharper disable once PartialTypeWithSinglePart -[Collection("RealFileSystemTests")] -public abstract partial class ReadTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ReadTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs index e1e619ecc..e3f629eb1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/Tests.cs @@ -8,10 +8,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs index ea7720dee..e34c8f1e7 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStream/WriteTests.cs @@ -6,11 +6,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStream; -// ReSharper disable once PartialTypeWithSinglePart -[Collection("RealFileSystemTests")] -public abstract partial class WriteTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class WriteTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/ExceptionTests.cs index d6fbdca6d..bfe30a2b1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/ExceptionTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStreamFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetFileStreamFactoryCallbacks), diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/SafeFileHandleTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/SafeFileHandleTests.cs index e155ae4eb..d1b5fb613 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/SafeFileHandleTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/SafeFileHandleTests.cs @@ -6,10 +6,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStreamFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class SafeFileHandleTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class SafeFileHandleTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/Tests.cs index 0bcb0bfae..d00a6ece4 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileStreamFactory/Tests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileStreamFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/CreateAsSymbolicLinkTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/CreateAsSymbolicLinkTests.cs index ff1317a90..f113fbcb8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/CreateAsSymbolicLinkTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/CreateAsSymbolicLinkTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CreateAsSymbolicLinkTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CreateAsSymbolicLinkTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ExceptionTests.cs index feb7100ab..d71d8887f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ExceptionTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetFileSystemInfoCallbacks), parameters: "")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ResolveLinkTargetTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ResolveLinkTargetTests.cs index 868fe9e7c..c2583516c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ResolveLinkTargetTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/ResolveLinkTargetTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ResolveLinkTargetTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ResolveLinkTargetTests { #region Test Setup diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/Tests.cs index 5a8709dcd..01105689b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/Tests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/UnixFileModeTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/UnixFileModeTests.cs index 1269bfa6e..dee2b29e2 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/UnixFileModeTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemInfo/UnixFileModeTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class UnixFileModeTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class UnixFileModeTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.Extensibility.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.Extensibility.cs index 1731a848c..e27468ac1 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.Extensibility.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.Extensibility.cs @@ -2,8 +2,7 @@ namespace Testably.Abstractions.Tests.FileSystem; -public abstract partial class FileSystemTests - where TFileSystem : IFileSystem +public partial class FileSystemTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.cs index 5e11440bf..d27348f3c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class FileSystemTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class FileSystemTests { [SkippableFact] public void Paths_UnderWindows_ShouldUseNormalSlashAndBackslashInterchangeable() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs index 8cd95589b..f4ddbf562 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EnableRaisingEventsTests.cs @@ -2,11 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; -// ReSharper disable once PartialTypeWithSinglePart -[Collection("RealFileSystemTests")] -public abstract partial class EnableRaisingEventsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EnableRaisingEventsTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs index ac035e0b8..076447717 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/EventTests.cs @@ -7,11 +7,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; -// ReSharper disable once PartialTypeWithSinglePart -[Collection("RealFileSystemTests")] -public abstract partial class EventTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EventTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs index 8223ae43e..8aee08df9 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/FilterTests.cs @@ -7,11 +7,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; -// ReSharper disable once PartialTypeWithSinglePart -[Collection("RealFileSystemTests")] -public abstract partial class FilterTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class FilterTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs index c851c60b0..2be05d146 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/IncludeSubdirectoriesTests.cs @@ -3,11 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; -// ReSharper disable once PartialTypeWithSinglePart -[Collection("RealFileSystemTests")] -public abstract partial class IncludeSubdirectoriesTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class IncludeSubdirectoriesTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs index 583216b6d..88a3f4fa7 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/NotifyFiltersTests.cs @@ -3,11 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; -// ReSharper disable once PartialTypeWithSinglePart -[Collection("RealFileSystemTests")] -public abstract partial class NotifyFiltersTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class NotifyFiltersTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/PathTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/PathTests.cs index 948af9698..eb4e81db7 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/PathTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/PathTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class PathTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class PathTests { [SkippableFact] public void Path_Empty_ShouldNotThrowException() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs index ec36cdca4..4b766c484 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/Tests.cs @@ -5,11 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; -// ReSharper disable once PartialTypeWithSinglePart -[Collection("RealFileSystemTests")] -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs index 5203f2713..809405a09 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcher/WaitForChangedTests.cs @@ -4,11 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcher; -// ReSharper disable once PartialTypeWithSinglePart -[Collection("RealFileSystemTests")] -public abstract partial class WaitForChangedTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class WaitForChangedTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/ExceptionTests.cs index 1dcca6b02..5b2c9b1c5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/ExceptionTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcherFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetFileSystemWatcherFactoryCallbacks), diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/Tests.cs index 9988b72de..06d183e14 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileSystemWatcherFactory/Tests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileSystemWatcherFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableFact] public void New_ShouldInitializeWithDefaultValues() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfo/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfo/Tests.cs index 0b2a4b13f..2a73fd059 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfo/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfo/Tests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.FileVersionInfo; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/ExceptionTests.cs index 3be96c80e..7d9a2ca45 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/ExceptionTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileVersionInfoFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetFileVersionInfoFactoryCallbacks), parameters: "")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/Tests.cs index 0b6011fa5..2f7bb65f8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/FileVersionInfoFactory/Tests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.FileVersionInfoFactory; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ChangeExtensionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ChangeExtensionTests.cs index b405331a2..84f65d065 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ChangeExtensionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ChangeExtensionTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ChangeExtensionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ChangeExtensionTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/CombineTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/CombineTests.cs index 86f7dafef..1c5a576bb 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/CombineTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/CombineTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class CombineTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class CombineTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/EndsInDirectorySeparatorTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/EndsInDirectorySeparatorTests.cs index 9e98bd468..3c521dec3 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/EndsInDirectorySeparatorTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/EndsInDirectorySeparatorTests.cs @@ -1,10 +1,8 @@ #if FEATURE_PATH_ADVANCED namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class EndsInDirectorySeparatorTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class EndsInDirectorySeparatorTests { [SkippableFact] public void EndsInDirectorySeparator_Empty_ShouldReturnExpectedResult() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExceptionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExceptionTests.cs index 08f674115..a69e94fda 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExceptionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExceptionTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExceptionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExceptionTests { [SkippableTheory] [MemberData(nameof(GetPathCallbacks), parameters: "")] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExistsTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExistsTests.cs index c6f4e67ee..107765ad8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExistsTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/ExistsTests.cs @@ -1,10 +1,8 @@ #if FEATURE_FILESYSTEM_NET7 namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ExistsTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class ExistsTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetDirectoryNameTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetDirectoryNameTests.cs index 45d652421..6b6dc386c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetDirectoryNameTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetDirectoryNameTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetDirectoryNameTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetDirectoryNameTests { [SkippableTheory] [InlineData((string?)null)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetExtensionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetExtensionTests.cs index bab9bbad7..fa6ebd13c 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetExtensionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetExtensionTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetExtensionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetExtensionTests { [SkippableFact] public void GetExtension_Empty_ShouldReturnEmpty() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameTests.cs index 0187e9b33..cc98b4e70 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetFileNameTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetFileNameTests { [SkippableFact] public void GetFileName_EmptyString_ShouldReturnEmptyString() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameWithoutExtensionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameWithoutExtensionTests.cs index 98b191d1b..14625201b 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameWithoutExtensionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFileNameWithoutExtensionTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetFileNameWithoutExtensionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetFileNameWithoutExtensionTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs index 38d65875e..550cc9d11 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetFullPathTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetFullPathTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetFullPathTests { [SkippableFact] public void GetFullPath_Dot_ShouldReturnToCurrentDirectory() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetPathRootTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetPathRootTests.cs index b8e589a30..9a4f87b58 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetPathRootTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetPathRootTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetPathRootTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetPathRootTests { [SkippableTheory] [InlineData(@"\\?\foo", @"\\?\foo", TestOS.Windows)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRandomFileNameTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRandomFileNameTests.cs index 1ad6465e2..02abddba5 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRandomFileNameTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRandomFileNameTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetRandomFileNameTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetRandomFileNameTests { [SkippableFact] public void GetRandomFileName_ShouldMatch8Dot3Pattern() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRelativePathTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRelativePathTests.cs index 2bcbfe164..a512cdd3a 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRelativePathTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetRelativePathTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetRelativePathTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetRelativePathTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempFileNameTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempFileNameTests.cs index c49cd568e..86f1caa58 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempFileNameTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempFileNameTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetTempFileNameTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetTempFileNameTests { [SkippableFact] public void GetTempFileName_ShouldBeInTempPath() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempPathTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempPathTests.cs index a71326e78..78cfa492f 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempPathTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/GetTempPathTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GetTempPathTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class GetTempPathTests { [SkippableFact] public void GetTempPath_Linux_ShouldBeTmp() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/HasExtensionTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/HasExtensionTests.cs index d5fa9eaf2..c083504d8 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/HasExtensionTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/HasExtensionTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class HasExtensionTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class HasExtensionTests { [SkippableFact] public void HasExtension_Null_ShouldReturnFalse() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathFullyQualifiedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathFullyQualifiedTests.cs index 0e8483e59..cb808a3a2 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathFullyQualifiedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathFullyQualifiedTests.cs @@ -1,10 +1,8 @@ #if FEATURE_PATH_RELATIVE namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class IsPathFullyQualifiedTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class IsPathFullyQualifiedTests { [SkippableTheory] [InlineData("C", false, TestOS.Windows)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathRootedTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathRootedTests.cs index d70701eb8..90e447d98 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathRootedTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/IsPathRootedTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class IsPathRootedTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class IsPathRootedTests { [SkippableTheory] [MemberData(nameof(TestData))] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/JoinTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/JoinTests.cs index 8f8eff37c..b39701abe 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/JoinTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/JoinTests.cs @@ -1,10 +1,8 @@ #if FEATURE_PATH_JOIN namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class JoinTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class JoinTests { [SkippableTheory] [InlineAutoData((string?)null)] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/Tests.cs index 515745312..ae8eb0eab 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/Tests.cs @@ -2,10 +2,8 @@ namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class Tests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class Tests { [SkippableFact] public void AltDirectorySeparatorChar_ShouldReturnSlash() diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/TrimEndingDirectorySeparatorTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/TrimEndingDirectorySeparatorTests.cs index 0821df576..5b759bb74 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/TrimEndingDirectorySeparatorTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/TrimEndingDirectorySeparatorTests.cs @@ -1,10 +1,8 @@ #if FEATURE_PATH_ADVANCED namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class TrimEndingDirectorySeparatorTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class TrimEndingDirectorySeparatorTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/Path/TryJoinTests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/Path/TryJoinTests.cs index 8dd934b0b..f0c9ec809 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/Path/TryJoinTests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/Path/TryJoinTests.cs @@ -1,10 +1,8 @@ #if FEATURE_PATH_JOIN namespace Testably.Abstractions.Tests.FileSystem.Path; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class TryJoinTests - : FileSystemTestBase - where TFileSystem : IFileSystem +[FileSystemTests] +public partial class TryJoinTests { [SkippableTheory] [AutoData] diff --git a/Tests/Testably.Abstractions.Tests/RandomSystem/GuidTests.cs b/Tests/Testably.Abstractions.Tests/RandomSystem/GuidTests.cs index 5bec1aff5..b030a9ec0 100644 --- a/Tests/Testably.Abstractions.Tests/RandomSystem/GuidTests.cs +++ b/Tests/Testably.Abstractions.Tests/RandomSystem/GuidTests.cs @@ -9,10 +9,8 @@ namespace Testably.Abstractions.Tests.RandomSystem; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class GuidTests - : RandomSystemTestBase - where TRandomSystem : IRandomSystem +[RandomSystemTests] +public partial class GuidTests { [SkippableFact] public void Empty_ShouldReturnEmptyGuid() diff --git a/Tests/Testably.Abstractions.Tests/RandomSystem/RandomFactoryTests.cs b/Tests/Testably.Abstractions.Tests/RandomSystem/RandomFactoryTests.cs index 84af2a519..e8c766739 100644 --- a/Tests/Testably.Abstractions.Tests/RandomSystem/RandomFactoryTests.cs +++ b/Tests/Testably.Abstractions.Tests/RandomSystem/RandomFactoryTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.RandomSystem; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class RandomFactoryTests - : RandomSystemTestBase - where TRandomSystem : IRandomSystem +[RandomSystemTests] +public partial class RandomFactoryTests { [SkippableFact] public void New_Next_ShouldReturnDifferentValues() diff --git a/Tests/Testably.Abstractions.Tests/RandomSystem/RandomTests.cs b/Tests/Testably.Abstractions.Tests/RandomSystem/RandomTests.cs index 49e7e59cc..a6e2abb50 100644 --- a/Tests/Testably.Abstractions.Tests/RandomSystem/RandomTests.cs +++ b/Tests/Testably.Abstractions.Tests/RandomSystem/RandomTests.cs @@ -6,10 +6,8 @@ namespace Testably.Abstractions.Tests.RandomSystem; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class RandomTests - : RandomSystemTestBase - where TRandomSystem : IRandomSystem +[RandomSystemTests] +public partial class RandomTests { #if FEATURE_RANDOM_ITEMS [Fact] diff --git a/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj b/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj index 7d8e6272c..90f45be0e 100644 --- a/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj +++ b/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj @@ -18,16 +18,13 @@ true - Generated + Generated + $(GeneratedFolder)\$(TargetFramework) - - - - - - + + diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/DateTimeTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/DateTimeTests.cs index 153d6e307..6492306c7 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/DateTimeTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/DateTimeTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.TimeSystem; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class DateTimeTests - : TimeSystemTestBase - where TTimeSystem : ITimeSystem +[TimeSystemTests] +public partial class DateTimeTests { [SkippableFact] public void MaxValue_ShouldReturnDefaultValue() diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs index 3f5e16ecc..80a86357d 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TaskTests.cs @@ -3,10 +3,8 @@ namespace Testably.Abstractions.Tests.TimeSystem; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class TaskTests - : TimeSystemTestBase - where TTimeSystem : ITimeSystem +[TimeSystemTests] +public partial class TaskTests { [SkippableFact] public async Task diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/ThreadTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/ThreadTests.cs index ee8384c8a..8c1a881a3 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/ThreadTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/ThreadTests.cs @@ -1,9 +1,7 @@ namespace Testably.Abstractions.Tests.TimeSystem; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class ThreadTests - : TimeSystemTestBase - where TTimeSystem : ITimeSystem +[TimeSystemTests] +public partial class ThreadTests { [SkippableFact] public void Sleep_LessThanNegativeOne_ShouldThrowArgumentOutOfRangeException() diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs index e16fc6474..a7f8c37a8 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerFactoryTests.cs @@ -4,10 +4,8 @@ namespace Testably.Abstractions.Tests.TimeSystem; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class TimerFactoryTests - : TimeSystemTestBase - where TTimeSystem : ITimeSystem +[TimeSystemTests] +public partial class TimeFactoryTests { #if FEATURE_TIMER_COUNT [SkippableFact] diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs index ba9cae9de..3c5501f45 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/TimerTests.cs @@ -5,10 +5,8 @@ namespace Testably.Abstractions.Tests.TimeSystem; -// ReSharper disable once PartialTypeWithSinglePart -public abstract partial class TimerTests - : TimeSystemTestBase - where TTimeSystem : ITimeSystem +[TimeSystemTests] +public partial class TimerTests { #region Test Setup