From 5179dda7331b1e201519adf76ce9ae69ffe2a0f6 Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Sat, 1 Oct 2016 16:20:58 -0700 Subject: [PATCH] Replace uses of Xunit.PlatformID with renamed TestPlatforms Replace uses of `Xunit.PlatformID` with renamed `TestPlatforms` because the old name conflicts with `System.PlatformID` and should be plural according to the design guidelines for flags enums. --- .../ECDsa/ECDsaTests.cs | 6 +- .../System/IO/PathInternal.Windows.Tests.cs | 18 +- .../System/IO/PathInternal_Unix_Tests.cs | 4 +- .../InteropServices/NativeBufferTests.cs | 2 +- .../tests/Win32Exception.cs | 2 +- src/System.Console/tests/CancelKeyPress.cs | 4 +- src/System.Console/tests/Color.cs | 4 +- src/System.Console/tests/TermInfo.cs | 8 +- .../tests/WindowAndCursorProps.cs | 24 +-- .../FunctionalTests/TcpDefaultForAzureTest.cs | 8 +- .../FileVersionInfoTest.cs | 6 +- .../tests/ProcessModuleTests.cs | 4 +- .../tests/ProcessStartInfoTests.cs | 10 +- .../tests/ProcessTests.cs | 22 +-- .../tests/ProcessThreadTests.cs | 4 +- .../TestsEventSourceLifetime.cs | 2 +- .../tests/Misc/Calendars.netstandard1.7.cs | 12 +- .../tests/Normalization/NormalizationAll.cs | 2 +- .../CompareInfoTests.netstandard1.7.cs | 10 +- .../tests/CultureInfo/CultureInfoAll.cs | 2 +- .../CultureInfo/CultureInfoCurrentCulture.cs | 4 +- .../CultureInfoTests.netstandard1.7.cs | 10 +- .../DateTimeFormatInfoTests.netstandard1.7.cs | 8 +- .../NumberFormatInfoTests.netstandard1.7.cs | 4 +- .../RegionInfoTests.netstandard1.7.cs | 4 +- .../SortVersionTests.netstandard1.7.cs | 4 +- .../TextInfo/TextInfoTests.netstandard1.7.cs | 6 +- .../tests/ZipFileInvalidFileTests.cs | 8 +- .../tests/DriveInfo.Unix.Tests.cs | 10 +- .../tests/DriveInfo.Windows.Tests.cs | 18 +- .../tests/FileSystemWatcher.Directory.Move.cs | 7 +- ...ileSystemWatcher.Directory.NotifyFilter.cs | 3 +- .../tests/FileSystemWatcher.File.Move.cs | 19 +- .../FileSystemWatcher.File.NotifyFilter.cs | 3 +- .../FileSystemWatcher.InternalBufferSize.cs | 3 +- .../tests/FileSystemWatcher.unit.cs | 9 +- .../tests/Directory/CreateDirectory.cs | 53 +++--- .../tests/Directory/Delete.cs | 19 +- .../tests/Directory/Delete_MountVolume.cs | 2 +- .../tests/Directory/Exists.cs | 33 ++-- .../tests/Directory/GetDirectoryRoot.cs | 2 +- .../Directory/GetFileSystemEntries_str.cs | 7 +- .../Directory/GetFileSystemEntries_str_str.cs | 19 +- .../GetFileSystemEntries_str_str_so.cs | 2 +- .../tests/Directory/GetLogicalDrives.cs | 5 +- .../tests/Directory/GetParent.cs | 2 +- .../tests/Directory/GetSetTimes.cs | 5 +- .../tests/Directory/Move.cs | 17 +- .../Directory/ReparsePoints_MountVolume.cs | 2 +- .../tests/DirectoryInfo/Create.cs | 9 +- .../tests/DirectoryInfo/CreateSubdirectory.cs | 13 +- .../tests/DirectoryInfo/Exists.cs | 2 +- .../tests/DirectoryInfo/GetSetAttributes.cs | 13 +- .../tests/DirectoryInfo/Root.cs | 2 +- .../tests/DirectoryInfo/ToString.cs | 2 +- src/System.IO.FileSystem/tests/File/Copy.cs | 5 +- src/System.IO.FileSystem/tests/File/Create.cs | 11 +- src/System.IO.FileSystem/tests/File/Delete.cs | 13 +- src/System.IO.FileSystem/tests/File/Exists.cs | 15 +- .../tests/File/GetSetAttributes.cs | 9 +- .../tests/File/GetSetTimes.cs | 5 +- src/System.IO.FileSystem/tests/File/Move.cs | 15 +- .../tests/FileInfo/Directory.cs | 2 +- .../tests/FileInfo/Exists.cs | 2 +- .../tests/FileInfo/Extension.cs | 7 +- .../tests/FileInfo/GetSetAttributes.cs | 9 +- .../tests/FileStream/CopyToAsync.cs | 5 +- .../tests/FileStream/LockUnlock.cs | 9 +- .../tests/FileStream/Pipes.cs | 7 +- .../FileStream/ctor_str_fm_fa_fs.delete.cs | 5 +- .../FileStream/ctor_str_fm_fa_fs.read.cs | 2 +- .../tests/FileSystemTest.cs | 5 +- .../MemoryMappedFile.CreateFromFile.Tests.cs | 16 +- .../tests/MemoryMappedFile.CreateNew.Tests.cs | 16 +- .../MemoryMappedFile.CreateOrOpen.Tests.cs | 16 +- .../MemoryMappedFile.OpenExisting.Tests.cs | 8 +- .../AnonymousPipeTest.Specific.cs | 6 +- .../NamedPipeTest.CreateClient.cs | 2 +- .../NamedPipeTest.CreateServer.cs | 14 +- .../NamedPipeTests/NamedPipeTest.Simple.cs | 18 +- .../NamedPipeTests/NamedPipeTest.Specific.cs | 22 +-- .../tests/FunctionalTests/CancellationTest.cs | 2 +- ...ttpClientHandlerTest.ClientCertificates.cs | 2 +- ...ientHandlerTest.DefaultProxyCredentials.cs | 2 +- ...ttpClientHandlerTest.ServerCertificates.cs | 6 +- .../HttpClientHandlerTest.SslProtocols.cs | 2 +- .../FunctionalTests/HttpClientHandlerTest.cs | 12 +- .../tests/FunctionalTests/PostScenarioTest.cs | 2 +- .../SchSendAuxRecordHttpTest.cs | 2 +- .../tests/FunctionalTests/GetHostEntryTest.cs | 2 +- .../tests/PalTests/NameResolutionPalTests.cs | 2 +- .../IPInterfacePropertiesTest_Linux.cs | 2 +- .../IPInterfacePropertiesTest_OSX.cs | 2 +- .../IPInterfacePropertiesTest_Windows.cs | 2 +- .../NetworkInterfaceBasicTest.cs | 20 +-- .../tests/FunctionalTests/PingTest.cs | 16 +- .../FunctionalTests/UnixPingUtilityTests.cs | 2 +- .../tests/FunctionalTests/IPAddressParsing.cs | 14 +- .../NegotiateStreamStreamToStreamTest.cs | 2 +- .../NegotiateStreamTestForUnix.cs | 34 ++-- .../SslStreamSchSendAuxRecordTest.cs | 2 +- .../tests/FunctionalTests/AcceptAsync.cs | 4 +- .../ArgumentValidationTests.cs | 26 +-- .../tests/FunctionalTests/DisconnectTest.cs | 12 +- .../tests/FunctionalTests/DnsEndPointTest.cs | 16 +- .../FunctionalTests/DualModeSocketTest.cs | 168 +++++++++--------- .../tests/FunctionalTests/Handle.cs | 2 +- .../tests/FunctionalTests/LingerStateTest.cs | 4 +- .../tests/FunctionalTests/SelectTest.cs | 8 +- .../tests/FunctionalTests/SendPacketsAsync.cs | 40 ++--- .../FunctionalTests/SocketOptionNameTest.cs | 4 +- .../tests/FunctionalTests/TcpClientTest.cs | 8 +- .../tests/FunctionalTests/UdpClientTest.cs | 4 +- .../FunctionalTests/UnixDomainSocketTest.cs | 12 +- .../SocketPerformanceAsyncTests.cs | 4 +- src/System.Reflection.Emit/tests/Utilities.cs | 2 +- .../PortableExecutable/DebugDirectoryTests.cs | 10 +- .../tests/PortableExecutable/PEReaderTests.cs | 4 +- .../Environment.GetEnvironmentVariable.cs | 2 +- .../tests/System/Environment.NewLine.cs | 4 +- .../System/Environment.ProcessorCount.cs | 4 +- .../tests/System/EnvironmentTests.cs | 16 +- .../tests/System/IO/Path.Combine.cs | 4 +- .../tests/System/IO/Path.GetRelativePath.cs | 12 +- .../tests/System/IO/PathTests.cs | 52 +++--- .../tests/CheckPlatformTests.cs | 8 +- .../tests/DescriptionNameTests.cs | 8 +- .../tests/ComplexTests.cs | 2 +- src/System.Runtime/tests/System/GCTests.cs | 2 +- .../tests/System/StringTests.cs | 8 +- .../tests/System/Threading/WaitHandleTests.cs | 2 +- .../WaitHandleTests.netstandard1.7.cs | 6 +- .../tests/System/TimeZoneInfoTests.cs | 8 +- .../tests/System/Uri.MethodsTests.cs | 2 +- .../tests/TimeZoneInfoTests.netstandard1.7.cs | 4 +- .../tests/Oid.cs | 8 +- .../tests/CollectionTests.cs | 24 +-- .../tests/CtorTests.cs | 4 +- .../tests/ExportTests.cs | 4 +- .../tests/InteropTests.cs | 4 +- .../tests/LoadFromFileTests.cs | 4 +- .../tests/PropsTests.cs | 8 +- .../tests/PublicKeyTests.cs | 8 +- .../tests/X500DistinguishedNameTests.cs | 2 +- .../tests/X509StoreTests.cs | 6 +- .../tests/EventWaitHandleTests.cs | 20 +-- src/System.Threading/tests/MutexTests.cs | 4 +- src/System.Threading/tests/SemaphoreTests.cs | 20 +-- .../tests/ValueTupleTests.cs | 4 +- 149 files changed, 709 insertions(+), 740 deletions(-) diff --git a/src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs b/src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs index aceba18e93bb..0f147e367d8d 100644 --- a/src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs +++ b/src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs @@ -34,7 +34,7 @@ public void KeySizeProp() } } - [ActiveIssue(10206, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(10206, TestPlatforms.AnyUnix)] [Theory, MemberData(nameof(TestNewCurves))] public void TestRegenKeyExplicit(CurveDef curveDef) { @@ -135,7 +135,7 @@ public void TestRegenKeyExplicit(CurveDef curveDef) } } - [ActiveIssue(10206, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(10206, TestPlatforms.AnyUnix)] [Theory, MemberData(nameof(TestCurves))] public void TestRegenKeyNamed(CurveDef curveDef) { @@ -159,7 +159,7 @@ public void TestRegenKeyNamed(CurveDef curveDef) } } - [ActiveIssue(10206, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(10206, TestPlatforms.AnyUnix)] [ConditionalFact(nameof(ECExplicitCurvesSupported))] public void TestRegenKeyNistP256() { diff --git a/src/Common/tests/Tests/System/IO/PathInternal.Windows.Tests.cs b/src/Common/tests/Tests/System/IO/PathInternal.Windows.Tests.cs index ce1f99c9a7ba..303ccdb25d24 100644 --- a/src/Common/tests/Tests/System/IO/PathInternal.Windows.Tests.cs +++ b/src/Common/tests/Tests/System/IO/PathInternal.Windows.Tests.cs @@ -19,7 +19,7 @@ public class PathInternal_Windows_Tests InlineData(@"C:\<", true) InlineData("\"MyFile\"", true) ] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void HasWildcardCharacters(string path, bool expected) { Assert.Equal(expected, PathInternal.HasWildCardCharacters(path)); @@ -35,7 +35,7 @@ public void HasWildcardCharacters(string path, bool expected) InlineData(@"//?/Foo", @"//?/Foo") InlineData(@"\\Server\Share", PathInternal.UncExtendedPathPrefix + @"Server\Share") ] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void EnsureExtendedPrefixTest(string path, string expected) { Assert.Equal(expected, PathInternal.EnsureExtendedPrefix(path)); @@ -51,7 +51,7 @@ public void EnsureExtendedPrefixTest(string path, string expected) InlineData(@"//?/", false) InlineData(@"/??/", false) ] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void IsExtendedTest(string path, bool expected) { StringBuffer sb = new StringBuffer(); @@ -71,7 +71,7 @@ public void IsExtendedTest(string path, bool expected) InlineData(@"//?/", true) InlineData(@"/??/", false) ] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void IsDeviceTest(string path, bool expected) { StringBuffer sb = new StringBuffer(); @@ -104,7 +104,7 @@ public void IsDeviceTest(string path, bool expected) InlineData(@"Path", true) InlineData(@"X", true) ] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void IsPartiallyQualifiedTest(string path, bool expected) { StringBuffer sb = new StringBuffer(); @@ -126,7 +126,7 @@ public void IsPartiallyQualifiedTest(string path, bool expected) InlineData(@" \\", 4), InlineData(@"\\", 0), ] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void PathStartSkipTest(string path, int expected) { Assert.Equal(expected, PathInternal.PathStartSkip(path)); @@ -169,7 +169,7 @@ public void PathStartSkipTest(string path, int expected) InlineData(@" \\", @"\\"), InlineData(@" //", @"\\"), ] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void NormalizeDirectorySeparatorTests(string path, string expected) { string result = PathInternal.NormalizeDirectorySeparators(path); @@ -187,7 +187,7 @@ public void NormalizeDirectorySeparatorTests(string path, string expected) [InlineData(@"Foo\/\/\", 8)] [InlineData("Foo:Bar", 4)] [InlineData(@"C:\Users\Foobar\", 16)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void FindFileNameIndexTests(string path, int expected) { Assert.Equal(expected, PathInternal.FindFileNameIndex(path)); @@ -201,7 +201,7 @@ public void FindFileNameIndexTests(string path, int expected) InlineData(@"C:\", @"c:\", StringComparison.OrdinalIgnoreCase, true) InlineData(@"C:\", @"c:\", StringComparison.Ordinal, false) ] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void AreRootsEqual(string first, string second, StringComparison comparisonType, bool expected) { Assert.Equal(expected, PathInternal.AreRootsEqual(first, second, comparisonType)); diff --git a/src/Common/tests/Tests/System/IO/PathInternal_Unix_Tests.cs b/src/Common/tests/Tests/System/IO/PathInternal_Unix_Tests.cs index c81b15ea6897..0eb37e27b9c7 100644 --- a/src/Common/tests/Tests/System/IO/PathInternal_Unix_Tests.cs +++ b/src/Common/tests/Tests/System/IO/PathInternal_Unix_Tests.cs @@ -31,7 +31,7 @@ public class PathInternal_Unix_Tests InlineData(@"a//", @"a/"), InlineData(@"a\\", @"a\\"), ] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void NormalizeDirectorySeparatorTests(string path, string expected) { string result = PathInternal.NormalizeDirectorySeparators(path); @@ -50,7 +50,7 @@ public void NormalizeDirectorySeparatorTests(string path, string expected) [InlineData("Foo:Bar", 0)] [InlineData("/usr/foo/", 9)] [InlineData("/home/bar", 6)] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void FindFileNameIndexTests(string path, int expected) { Assert.Equal(expected, PathInternal.FindFileNameIndex(path)); diff --git a/src/Common/tests/Tests/System/Runtime/InteropServices/NativeBufferTests.cs b/src/Common/tests/Tests/System/Runtime/InteropServices/NativeBufferTests.cs index 06ed94b06081..b22a63ff57d8 100644 --- a/src/Common/tests/Tests/System/Runtime/InteropServices/NativeBufferTests.cs +++ b/src/Common/tests/Tests/System/Runtime/InteropServices/NativeBufferTests.cs @@ -50,7 +50,7 @@ public void CanGetSetBytes() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void NullSafePointerInTest() { using (var buffer = new NativeBuffer(0)) diff --git a/src/Microsoft.Win32.Primitives/tests/Win32Exception.cs b/src/Microsoft.Win32.Primitives/tests/Win32Exception.cs index 12bfc5a76562..f07930b2c9b5 100644 --- a/src/Microsoft.Win32.Primitives/tests/Win32Exception.cs +++ b/src/Microsoft.Win32.Primitives/tests/Win32Exception.cs @@ -80,7 +80,7 @@ public static void InstantiateException() private const int E_FAIL = unchecked((int)0x80004005); [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void InstantiateExceptionWithLongErrorString() { // This test checks that Win32Exception supports error strings greater than 256 characters. diff --git a/src/System.Console/tests/CancelKeyPress.cs b/src/System.Console/tests/CancelKeyPress.cs index 26292edf6a37..f90ba5e4b729 100644 --- a/src/System.Console/tests/CancelKeyPress.cs +++ b/src/System.Console/tests/CancelKeyPress.cs @@ -38,13 +38,13 @@ public void CanAddAndRemoveHandler_Remote() }).Dispose(); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void HandlerInvokedForSigInt() { HandlerInvokedForSignal(SIGINT); } - [PlatformSpecific(PlatformID.AnyUnix & ~PlatformID.OSX)] // Jenkins blocks SIGQUIT on OS X, causing the test to fail in CI + [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.OSX)] // Jenkins blocks SIGQUIT on OS X, causing the test to fail in CI public void HandlerInvokedForSigQuit() { HandlerInvokedForSignal(SIGQUIT); diff --git a/src/System.Console/tests/Color.cs b/src/System.Console/tests/Color.cs index e88c56889be0..de9c20bac546 100644 --- a/src/System.Console/tests/Color.cs +++ b/src/System.Console/tests/Color.cs @@ -31,7 +31,7 @@ public static void RoundtrippingColor() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void RedirectedOutputDoesNotUseAnsiSequences() { // Make sure that redirecting to a memory stream causes Console not to write out the ANSI sequences @@ -53,7 +53,7 @@ public static void RedirectedOutputDoesNotUseAnsiSequences() } //[Fact] // the CI system redirects stdout, so we can't easily test non-redirected behavior - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void NonRedirectedOutputDoesUseAnsiSequences() { // Make sure that when writing out to a UnixConsoleStream, the ANSI escape sequences are properly diff --git a/src/System.Console/tests/TermInfo.cs b/src/System.Console/tests/TermInfo.cs index 087b1783aa3e..29fc346af963 100644 --- a/src/System.Console/tests/TermInfo.cs +++ b/src/System.Console/tests/TermInfo.cs @@ -25,7 +25,7 @@ public class TermInfo private const string TerminfoLocationsField = "_terminfoLocations"; [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void VerifyInstalledTermInfosParse() { bool foundAtLeastOne = false; @@ -59,7 +59,7 @@ public void VerifyInstalledTermInfosParse() } [Theory] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [InlineData("xterm-256color", "\u001B\u005B\u00330m", "\u001B\u005B\u00340m", 0)] [InlineData("xterm-256color", "\u001B\u005B\u00331m", "\u001B\u005B\u00341m", 1)] [InlineData("xterm-256color", "\u001B\u005B90m", "\u001B\u005B100m", 8)] @@ -87,7 +87,7 @@ public void TermInfoVerification(string termToTest, string expectedForeground, s } [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void EmuTermInfoDoesntBreakParser() { // This file (available by default on OS X) is called out specifically since it contains a format where it has %i @@ -96,7 +96,7 @@ public void EmuTermInfoDoesntBreakParser() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void TryingToLoadTermThatDoesNotExistDoesNotThrow() { const string NonexistentTerm = "foobar____"; diff --git a/src/System.Console/tests/WindowAndCursorProps.cs b/src/System.Console/tests/WindowAndCursorProps.cs index badbb1d94286..9a41d606b5c8 100644 --- a/src/System.Console/tests/WindowAndCursorProps.cs +++ b/src/System.Console/tests/WindowAndCursorProps.cs @@ -12,7 +12,7 @@ public class WindowAndCursorProps : RemoteExecutorTestBase { [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void BufferSize_SettingNotSupported() { Assert.Throws(() => Console.BufferWidth = 1); @@ -20,7 +20,7 @@ public static void BufferSize_SettingNotSupported() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void BufferSize_GettingSameAsWindowSize() { Assert.Throws(() => Console.BufferWidth = 1); @@ -38,7 +38,7 @@ public static void WindowWidth_WindowHeight_InvalidSize() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void WindowWidth() { Assert.Throws(() => Console.WindowWidth = 100); @@ -49,7 +49,7 @@ public static void WindowWidth() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void WindowHeight() { Assert.Throws(() => Console.WindowHeight = 100); @@ -60,7 +60,7 @@ public static void WindowHeight() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void WindowLeftTop_AnyUnix() { Assert.Equal(0, Console.WindowLeft); @@ -70,7 +70,7 @@ public static void WindowLeftTop_AnyUnix() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void WindowLeftTop_Windows() { if (Console.IsOutputRedirected) @@ -86,7 +86,7 @@ public static void WindowLeftTop_Windows() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] //CI system makes it difficult to run things in a non-redirected environments. public static void NonRedirectedCursorVisible() { @@ -99,7 +99,7 @@ public static void NonRedirectedCursorVisible() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void CursorVisible() { Assert.Throws(() => { bool unused = Console.CursorVisible; }); @@ -110,7 +110,7 @@ public static void CursorVisible() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void Title_GetSet_Unix() { Assert.Throws(() => Console.Title); @@ -122,7 +122,7 @@ public static void Title_GetSet_Unix() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void Title_Get_Windows() { Assert.NotNull(Console.Title); @@ -132,7 +132,7 @@ public static void Title_Get_Windows() [InlineData(10)] [InlineData(256)] [InlineData(1024)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void Title_Set_Windows(int lengthOfTitle) { // Try to set the title to some other value. @@ -146,7 +146,7 @@ public static void Title_Set_Windows(int lengthOfTitle) } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void Title_Set_Windows_longlength() { RemoteInvoke(() => diff --git a/src/System.Data.SqlClient/tests/FunctionalTests/TcpDefaultForAzureTest.cs b/src/System.Data.SqlClient/tests/FunctionalTests/TcpDefaultForAzureTest.cs index b2a7be0d4eb1..e0090a946484 100644 --- a/src/System.Data.SqlClient/tests/FunctionalTests/TcpDefaultForAzureTest.cs +++ b/src/System.Data.SqlClient/tests/FunctionalTests/TcpDefaultForAzureTest.cs @@ -29,7 +29,7 @@ static TcpDefaultForAzureTest() [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void NonAzureNoProtocolConnectionTestOnWindows() { builder.DataSource = InvalidHostname; @@ -38,7 +38,7 @@ public static void NonAzureNoProtocolConnectionTestOnWindows() [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void NonAzureNoProtocolConnectionTestOnUnix() { builder.DataSource = InvalidHostname; @@ -55,7 +55,7 @@ public static void NonAzureTcpConnectionTest() [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void NonAzureNpConnectionTest() { builder.DataSource = "np:\\\\" + InvalidHostname + "\\pipe\\sql\\query"; @@ -86,7 +86,7 @@ public static void AzureTcpConnectionTest() [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void AzureNpConnectionTest() { foreach (string extension in AzureExtensions) diff --git a/src/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs b/src/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs index ad17041eddd3..0efc8ae42273 100644 --- a/src/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs +++ b/src/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs @@ -22,7 +22,7 @@ public class FileVersionInfoTest private const string TestNotFoundFileName = "notfound.dll"; [Fact] - [PlatformSpecific(PlatformID.Windows)] // native PE files only supported on Windows + [PlatformSpecific(TestPlatforms.Windows)] // native PE files only supported on Windows public void FileVersionInfo_Normal() { // NativeConsoleApp (English) @@ -59,7 +59,7 @@ public void FileVersionInfo_Normal() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // native PE files only supported on Windows + [PlatformSpecific(TestPlatforms.Windows)] // native PE files only supported on Windows public void FileVersionInfo_Chinese() { // NativeLibrary.dll (Chinese) @@ -97,7 +97,7 @@ public void FileVersionInfo_Chinese() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // native PE files only supported on Windows + [PlatformSpecific(TestPlatforms.Windows)] // native PE files only supported on Windows public void FileVersionInfo_DifferentFileVersionAndProductVersion() { // Mtxex.dll diff --git a/src/System.Diagnostics.Process/tests/ProcessModuleTests.cs b/src/System.Diagnostics.Process/tests/ProcessModuleTests.cs index ad8fd7dc569f..e1bb626b5611 100644 --- a/src/System.Diagnostics.Process/tests/ProcessModuleTests.cs +++ b/src/System.Diagnostics.Process/tests/ProcessModuleTests.cs @@ -29,7 +29,7 @@ public void TestModuleProperties() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void TestModulesContainsCorerun() { ProcessModuleCollection modules = Process.GetCurrentProcess().Modules; @@ -37,7 +37,7 @@ public void TestModulesContainsCorerun() } [Fact] - [PlatformSpecific(PlatformID.Linux)] // OSX only includes the main module + [PlatformSpecific(TestPlatforms.Linux)] // OSX only includes the main module public void TestModulesContainsUnixNativeLibs() { ProcessModuleCollection modules = Process.GetCurrentProcess().Modules; diff --git a/src/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs b/src/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs index 9a12a5b40706..d05f06885145 100644 --- a/src/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs +++ b/src/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs @@ -231,7 +231,7 @@ public void TestEnvironmentOfChildProcess() } } - [PlatformSpecific(PlatformID.Windows)] // UseShellExecute currently not supported on Windows + [PlatformSpecific(TestPlatforms.Windows)] // UseShellExecute currently not supported on Windows [Fact] public void TestUseShellExecuteProperty_SetAndGet_Windows() { @@ -246,7 +246,7 @@ public void TestUseShellExecuteProperty_SetAndGet_Windows() Assert.False(psi.UseShellExecute, "UseShellExecute=true is not supported on onecore."); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void TestUseShellExecuteProperty_SetAndGet_Unix() { @@ -260,7 +260,7 @@ public void TestUseShellExecuteProperty_SetAndGet_Unix() Assert.False(psi.UseShellExecute); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [InlineData(0)] [InlineData(1)] @@ -314,7 +314,7 @@ public void TestCreateNoWindowProperty(bool value) } - [Fact, PlatformSpecific(PlatformID.AnyUnix)] + [Fact, PlatformSpecific(TestPlatforms.AnyUnix)] public void TestUserCredentialsPropertiesOnUnix() { Assert.Throws(() => _process.StartInfo.Domain); @@ -346,7 +346,7 @@ public void TestWorkingDirectoryProperty() } } - [Fact, PlatformSpecific(PlatformID.Windows), OuterLoop] // Requires admin privileges + [Fact, PlatformSpecific(TestPlatforms.Windows), OuterLoop] // Requires admin privileges public void TestUserCredentialsPropertiesOnWindows() { string username = "test", password = "PassWord123!!"; diff --git a/src/System.Diagnostics.Process/tests/ProcessTests.cs b/src/System.Diagnostics.Process/tests/ProcessTests.cs index b9aa7e340508..ddb04c2e06ad 100644 --- a/src/System.Diagnostics.Process/tests/ProcessTests.cs +++ b/src/System.Diagnostics.Process/tests/ProcessTests.cs @@ -55,7 +55,7 @@ private void AssertNonZeroWindowsZeroUnix(long value) } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsNanoServer))] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void TestBasePriorityOnWindows() { ProcessPriorityClass originalPriority = _process.PriorityClass; @@ -80,7 +80,7 @@ public void TestBasePriorityOnWindows() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [OuterLoop] [Trait(XunitConstants.Category, XunitConstants.RequiresElevation)] public void TestBasePriorityOnUnix() @@ -149,7 +149,7 @@ public void TestExitCode() } } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void TestUseShellExecute_Unix_Succeeds() { @@ -418,7 +418,7 @@ public void TestProcessStartTime() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/968 - [PlatformSpecific(~PlatformID.OSX)] // getting/setting affinity not supported on OSX + [PlatformSpecific(~TestPlatforms.OSX)] // getting/setting affinity not supported on OSX public void TestProcessorAffinity() { IntPtr curProcessorAffinity = _process.ProcessorAffinity; @@ -453,7 +453,7 @@ public void TestPriorityBoostEnabled() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [OuterLoop] [Trait(XunitConstants.Category, XunitConstants.RequiresElevation)] public void TestPriorityClassUnix() @@ -473,7 +473,7 @@ public void TestPriorityClassUnix() } } - [Fact, PlatformSpecific(PlatformID.Windows)] + [Fact, PlatformSpecific(TestPlatforms.Windows)] public void TestPriorityClassWindows() { ProcessPriorityClass priorityClass = _process.PriorityClass; @@ -598,7 +598,7 @@ private static bool ProcessPeformanceCounterEnabled() return true; } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [ConditionalTheory(nameof(ProcessPeformanceCounterEnabled))] [MemberData(nameof(GetTestProcess))] public void TestProcessOnRemoteMachineWindows(Process currentProcess, Process remoteProcess) @@ -611,7 +611,7 @@ public void TestProcessOnRemoteMachineWindows(Process currentProcess, Process re Assert.Throws(() => remoteProcess.MainModule); } - [Fact, PlatformSpecific(PlatformID.AnyUnix)] + [Fact, PlatformSpecific(TestPlatforms.AnyUnix)] public void TestProcessOnRemoteMachineUnix() { Process currentProcess = Process.GetCurrentProcess(); @@ -726,7 +726,7 @@ public void TestStartWithMissingFile(bool fullPath) Assert.NotEqual(0, e.NativeErrorCode); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] // NativeErrorCode not 193 on Windows Nano for ERROR_BAD_EXE_FORMAT, issue #10290 [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsNanoServer))] public void TestStartOnWindowsWithBadFileFormat() @@ -738,7 +738,7 @@ public void TestStartOnWindowsWithBadFileFormat() Assert.NotEqual(0, e.NativeErrorCode); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void TestStartOnUnixWithBadPermissions() { @@ -750,7 +750,7 @@ public void TestStartOnUnixWithBadPermissions() Assert.NotEqual(0, e.NativeErrorCode); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void TestStartOnUnixWithBadFormat() { diff --git a/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs b/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs index 105d934b480c..396d927e8c72 100644 --- a/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs +++ b/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs @@ -61,7 +61,7 @@ public void TestThreadCount() } [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void TestStartTimeProperty_OSX() { using (Process p = Process.GetCurrentProcess()) @@ -78,7 +78,7 @@ public void TestStartTimeProperty_OSX() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/974 - [PlatformSpecific(~PlatformID.OSX)] // OSX throws PNSE from StartTime + [PlatformSpecific(~TestPlatforms.OSX)] // OSX throws PNSE from StartTime public async Task TestStartTimeProperty() { TimeSpan allowedWindow = TimeSpan.FromSeconds(1); diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsEventSourceLifetime.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsEventSourceLifetime.cs index dd7d2e36183b..f6a2e8958642 100644 --- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsEventSourceLifetime.cs +++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsEventSourceLifetime.cs @@ -20,7 +20,7 @@ public class TestsEventSourceLifetime /// alive. /// [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] // non-Windows EventSources don't have lifetime + [PlatformSpecific(TestPlatforms.Windows)] // non-Windows EventSources don't have lifetime public void Test_EventSource_Lifetime() { TestUtilities.CheckNoEventSourcesRunning("Start"); diff --git a/src/System.Globalization.Calendars/tests/Misc/Calendars.netstandard1.7.cs b/src/System.Globalization.Calendars/tests/Misc/Calendars.netstandard1.7.cs index ba4253dcde4d..a06825827a02 100644 --- a/src/System.Globalization.Calendars/tests/Misc/Calendars.netstandard1.7.cs +++ b/src/System.Globalization.Calendars/tests/Misc/Calendars.netstandard1.7.cs @@ -32,8 +32,8 @@ public static IEnumerable Calendars_TestData() [Theory] [MemberData(nameof(Calendars_TestData))] - [ActiveIssue(11605, Xunit.PlatformID.AnyUnix)] - [ActiveIssue(11605, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11605, TestPlatforms.AnyUnix)] + [ActiveIssue(11605, TestPlatforms.AnyUnix)] public static void CloningTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType) { Calendar cloned = (Calendar) calendar.Clone(); @@ -42,7 +42,7 @@ public static void CloningTest(Calendar calendar, int yearHasLeapMonth, Calendar [Theory] [MemberData(nameof(Calendars_TestData))] - [ActiveIssue(11605, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11605, TestPlatforms.AnyUnix)] public static void GetLeapMonthTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType) { if (yearHasLeapMonth > 0) @@ -57,7 +57,7 @@ public static void GetLeapMonthTest(Calendar calendar, int yearHasLeapMonth, Cal [Theory] [MemberData(nameof(Calendars_TestData))] - [ActiveIssue(11605, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11605, TestPlatforms.AnyUnix)] public static void ReadOnlyTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType) { Assert.False(calendar.IsReadOnly); @@ -69,14 +69,14 @@ public static void ReadOnlyTest(Calendar calendar, int yearHasLeapMonth, Calenda [Theory] [MemberData(nameof(Calendars_TestData))] - [ActiveIssue(11605, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11605, TestPlatforms.AnyUnix)] public static void AlgorithmTypeTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType) { Assert.Equal(calendar.AlgorithmType, algorithmType); } [Fact] - [ActiveIssue(11605, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11605, TestPlatforms.AnyUnix)] public static void CalendarErasTest() { Assert.Equal(1, ChineseLunisolarCalendar.ChineseEra); diff --git a/src/System.Globalization.Extensions/tests/Normalization/NormalizationAll.cs b/src/System.Globalization.Extensions/tests/Normalization/NormalizationAll.cs index afca337a7c8a..71e55b011fd1 100644 --- a/src/System.Globalization.Extensions/tests/Normalization/NormalizationAll.cs +++ b/src/System.Globalization.Extensions/tests/Normalization/NormalizationAll.cs @@ -23,7 +23,7 @@ private string ConvertToString(string codepoints) } [Fact] - [ActiveIssue(11803, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11803, TestPlatforms.AnyUnix)] public void Normalize() { // Windows 8 test data came from http://www.unicode.org/Public/UCD/latest/ucd/NormalizationTest.txt diff --git a/src/System.Globalization/tests/CompareInfo/CompareInfoTests.netstandard1.7.cs b/src/System.Globalization/tests/CompareInfo/CompareInfoTests.netstandard1.7.cs index bb6bc6e79269..68e4ba99f60d 100644 --- a/src/System.Globalization/tests/CompareInfo/CompareInfoTests.netstandard1.7.cs +++ b/src/System.Globalization/tests/CompareInfo/CompareInfoTests.netstandard1.7.cs @@ -240,7 +240,7 @@ public static IEnumerable IsSortable_TestData() [Theory] [MemberData(nameof(CompareInfo_TestData))] - [ActiveIssue(11608, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11608, TestPlatforms.AnyUnix)] public static void LcidTest(string cultureName, int lcid) { var ci = CompareInfo.GetCompareInfo(lcid); @@ -260,7 +260,7 @@ public static void LcidTest(string cultureName, int lcid) [Theory] [MemberData(nameof(SortKey_TestData))] - [ActiveIssue(11608, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11608, TestPlatforms.AnyUnix)] public void SortKeyTest(CompareInfo compareInfo, string string1, string string2, CompareOptions options, int expected) { SortKey sk1 = compareInfo.GetSortKey(string1, options); @@ -272,7 +272,7 @@ public void SortKeyTest(CompareInfo compareInfo, string string1, string string2, } [Fact] - [ActiveIssue(11608, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11608, TestPlatforms.AnyUnix)] public void SortKeyMiscTest() { CompareInfo ci = new CultureInfo("en-US").CompareInfo; @@ -307,7 +307,7 @@ public void SortKeyMiscTest() [Theory] [MemberData(nameof(IndexOf_TestData))] - [ActiveIssue(11608, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11608, TestPlatforms.AnyUnix)] public void IndexOfTest(CompareInfo compareInfo, string source, string value, int startIndex, int indexOfExpected, int lastIndexOfExpected) { Assert.Equal(indexOfExpected, compareInfo.IndexOf(source, value, startIndex)); @@ -325,7 +325,7 @@ public void IndexOfTest(CompareInfo compareInfo, string source, string value, in [Theory] [MemberData(nameof(IsSortable_TestData))] - [ActiveIssue(11608, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11608, TestPlatforms.AnyUnix)] public void IndexOfTest(string source, bool hasSurrogate, bool expected) { Assert.Equal(expected, CompareInfo.IsSortable(source)); diff --git a/src/System.Globalization/tests/CultureInfo/CultureInfoAll.cs b/src/System.Globalization/tests/CultureInfo/CultureInfoAll.cs index 3082d92a63ca..529671d29760 100644 --- a/src/System.Globalization/tests/CultureInfo/CultureInfoAll.cs +++ b/src/System.Globalization/tests/CultureInfo/CultureInfoAll.cs @@ -12,7 +12,7 @@ namespace System.Globalization.Tests public class CultureInfoAll { [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] // P/Invoke to Win32 function + [PlatformSpecific(TestPlatforms.Windows)] // P/Invoke to Win32 function public void TestAllCultures() { Assert.True(EnumSystemLocalesEx(EnumLocales, LOCALE_WINDOWS, IntPtr.Zero, IntPtr.Zero), "EnumSystemLocalesEx has failed"); diff --git a/src/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs b/src/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs index 4027f586c2b8..df00cc439e3a 100644 --- a/src/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs +++ b/src/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs @@ -100,7 +100,7 @@ public void CurrentUICulture_Set_Null_ThrowsArgumentNullException() Assert.Throws("value", () => CultureInfo.CurrentUICulture = null); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [InlineData("en-US.UTF-8", "en-US")] [InlineData("en-US", "en-US")] @@ -128,7 +128,7 @@ public void CurrentCulture_BasedOnLangEnvVar(string langEnvVar, string expectedC }, expectedCultureName, new RemoteInvokeOptions { StartInfo = psi }).Dispose(); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [InlineData("")] [InlineData(null)] diff --git a/src/System.Globalization/tests/CultureInfo/CultureInfoTests.netstandard1.7.cs b/src/System.Globalization/tests/CultureInfo/CultureInfoTests.netstandard1.7.cs index dc886fb070c4..3f6c29a1ddc9 100644 --- a/src/System.Globalization/tests/CultureInfo/CultureInfoTests.netstandard1.7.cs +++ b/src/System.Globalization/tests/CultureInfo/CultureInfoTests.netstandard1.7.cs @@ -24,7 +24,7 @@ public static IEnumerable CultureInfo_TestData() [Theory] [MemberData(nameof(CultureInfo_TestData))] - [ActiveIssue(11609, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11609, TestPlatforms.AnyUnix)] public void LcidTest(string cultureName, int lcid, string specificCultureName, string threeLetterISOLanguageName, string threeLetterWindowsLanguageName) { CultureInfo ci = new CultureInfo(lcid); @@ -75,7 +75,7 @@ public void LcidTest(string cultureName, int lcid, string specificCultureName, s } [Fact] - [ActiveIssue(11609, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11609, TestPlatforms.AnyUnix)] public void InstalledUICultureTest() { // as we didn't change current UI culture, Installed UI culture should match current UI culture @@ -83,7 +83,7 @@ public void InstalledUICultureTest() } [Fact] - [ActiveIssue(11609, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11609, TestPlatforms.AnyUnix)] public void GetCulturesTest() { foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.NeutralCultures)) @@ -94,7 +94,7 @@ public void GetCulturesTest() } [Fact] - [ActiveIssue(11609, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11609, TestPlatforms.AnyUnix)] public void ClearCachedDataTest() { CultureInfo ci = CultureInfo.GetCultureInfo("ja-JP"); @@ -104,7 +104,7 @@ public void ClearCachedDataTest() } [Fact] - [ActiveIssue(11609, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11609, TestPlatforms.AnyUnix)] public void CultureNotFoundExceptionTest() { Assert.Throws("name", () => new CultureInfo("!@#$%^&*()")); diff --git a/src/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoTests.netstandard1.7.cs b/src/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoTests.netstandard1.7.cs index 44123f96493d..33bedc73f398 100644 --- a/src/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoTests.netstandard1.7.cs +++ b/src/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoTests.netstandard1.7.cs @@ -34,7 +34,7 @@ public static IEnumerable CultureNames_TestData() } [Fact] - [ActiveIssue(11611, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11611, TestPlatforms.AnyUnix)] public void SeparatorsTest() { DateTimeFormatInfo dtfi = (DateTimeFormatInfo) CultureInfo.InvariantCulture.DateTimeFormat.Clone(); @@ -62,7 +62,7 @@ public void SeparatorsTest() } [Theory] - [ActiveIssue(11611, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11611, TestPlatforms.AnyUnix)] [MemberData(nameof(DateTimeFormatInfo_TestData))] public void NativeCalendarNameTest(DateTimeFormatInfo dtfi, Calendar calendar, string nativeCalendarName) { @@ -79,7 +79,7 @@ public void NativeCalendarNameTest(DateTimeFormatInfo dtfi, Calendar calendar, s } [Theory] - [ActiveIssue(11611, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11611, TestPlatforms.AnyUnix)] [MemberData(nameof(CultureNames_TestData))] public void AllDateTimePatternsTest(string cultureName) { @@ -117,7 +117,7 @@ public void AllDateTimePatternsTest(string cultureName) } [Theory] - [ActiveIssue(11611, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11611, TestPlatforms.AnyUnix)] [MemberData(nameof(CultureNames_TestData))] public void ShortestDayNamesTest(string cultureName) { diff --git a/src/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoTests.netstandard1.7.cs b/src/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoTests.netstandard1.7.cs index 196e9bd94716..96bbad6f403f 100644 --- a/src/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoTests.netstandard1.7.cs +++ b/src/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoTests.netstandard1.7.cs @@ -11,7 +11,7 @@ namespace System.Globalization.Tests public class NumberFormatInfoMiscTests { [Fact] - [ActiveIssue(11612, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11612, TestPlatforms.AnyUnix)] public void DigitSubstitutionTest() { // DigitSubstitution is not used in number formatting. @@ -19,7 +19,7 @@ public void DigitSubstitutionTest() } [Fact] - [ActiveIssue(11612, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11612, TestPlatforms.AnyUnix)] public void NativeDigitsTest() { string [] nativeDigits = CultureInfo.InvariantCulture.NumberFormat.NativeDigits; diff --git a/src/System.Globalization/tests/RegionInfo/RegionInfoTests.netstandard1.7.cs b/src/System.Globalization/tests/RegionInfo/RegionInfoTests.netstandard1.7.cs index 38b8b4158d03..78d522fea4cc 100644 --- a/src/System.Globalization/tests/RegionInfo/RegionInfoTests.netstandard1.7.cs +++ b/src/System.Globalization/tests/RegionInfo/RegionInfoTests.netstandard1.7.cs @@ -21,7 +21,7 @@ public static IEnumerable RegionInfo_TestData() } [Theory] - [ActiveIssue(11613, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11613, TestPlatforms.AnyUnix)] [MemberData(nameof(RegionInfo_TestData))] public void MiscTest(int lcid, int geoId, string currencyEnglishName, string alternativeCurrencyEnglishName, string currencyNativeName, string threeLetterISORegionName, string threeLetterWindowsRegionName) { @@ -35,7 +35,7 @@ public void MiscTest(int lcid, int geoId, string currencyEnglishName, string alt } [Fact] - [ActiveIssue(11613, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11613, TestPlatforms.AnyUnix)] public void NegativeTest() { Assert.Throws("name", () => new RegionInfo("")); diff --git a/src/System.Globalization/tests/SortVersion/SortVersionTests.netstandard1.7.cs b/src/System.Globalization/tests/SortVersion/SortVersionTests.netstandard1.7.cs index 9f4b9dc49a34..f27fe6d0ccae 100644 --- a/src/System.Globalization/tests/SortVersion/SortVersionTests.netstandard1.7.cs +++ b/src/System.Globalization/tests/SortVersion/SortVersionTests.netstandard1.7.cs @@ -9,7 +9,7 @@ namespace System.Globalization.Tests public class SortVersionMiscTests { [Fact] - [ActiveIssue(11614, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11614, TestPlatforms.AnyUnix)] public void ConstructionsTest() { string guidString = "00000001-57ee-1e5c-00b4-d0000bb1e11e"; @@ -19,7 +19,7 @@ public void ConstructionsTest() } [Fact] - [ActiveIssue(11614, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11614, TestPlatforms.AnyUnix)] public void EquaityTest() { SortVersion version1 = new SortVersion(393742, new Guid("00000001-57ee-1e5c-00b4-d0000bb1e11e")); diff --git a/src/System.Globalization/tests/TextInfo/TextInfoTests.netstandard1.7.cs b/src/System.Globalization/tests/TextInfo/TextInfoTests.netstandard1.7.cs index 17bb294fc271..17197b1a91a5 100644 --- a/src/System.Globalization/tests/TextInfo/TextInfoTests.netstandard1.7.cs +++ b/src/System.Globalization/tests/TextInfo/TextInfoTests.netstandard1.7.cs @@ -22,7 +22,7 @@ public static IEnumerable TextInfo_TestData() } [Theory] - [ActiveIssue(11616, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11616, TestPlatforms.AnyUnix)] [MemberData(nameof(TextInfo_TestData))] public void MiscTest(string cultureName, int lcid, int ansiCodePage, int ebcdiCCodePage, int macCodePage, int oemCodePage, bool isRightToLeft) { @@ -36,7 +36,7 @@ public void MiscTest(string cultureName, int lcid, int ansiCodePage, int ebcdiCC } [Fact] - [ActiveIssue(11616, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11616, TestPlatforms.AnyUnix)] public void ReadOnlyTest() { TextInfo ti = CultureInfo.GetCultureInfo("en-US").TextInfo; @@ -50,7 +50,7 @@ public void ReadOnlyTest() } [Fact] - [ActiveIssue(11616, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(11616, TestPlatforms.AnyUnix)] public void ToTitleCaseTest() { TextInfo ti = CultureInfo.GetCultureInfo("en-US").TextInfo; diff --git a/src/System.IO.Compression.ZipFile/tests/ZipFileInvalidFileTests.cs b/src/System.IO.Compression.ZipFile/tests/ZipFileInvalidFileTests.cs index 67ae6ad8957e..9ae0aa07a1d9 100644 --- a/src/System.IO.Compression.ZipFile/tests/ZipFileInvalidFileTests.cs +++ b/src/System.IO.Compression.ZipFile/tests/ZipFileInvalidFileTests.cs @@ -202,7 +202,7 @@ public void DirectoryEntryWithData() [Theory] [InlineData("NullCharFileName_FromWindows")] [InlineData("NullCharFileName_FromUnix")] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_ZipWithInvalidFileNames_ThrowsArgumentException(string zipName) { Assert.Throws(() => ZipFile.ExtractToDirectory(compat(zipName) + ".zip", GetTestFilePath())); @@ -213,7 +213,7 @@ public void Unix_ZipWithInvalidFileNames_ThrowsArgumentException(string zipName) [InlineData("backslashes_FromWindows", "aa\\bb\\cc\\dd")] [InlineData("WindowsInvalid_FromUnix", "aad")] [InlineData("WindowsInvalid_FromWindows", "aad")] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_ZipWithOSSpecificFileNames(string zipName, string fileName) { string tempDir = GetTestFilePath(); @@ -232,7 +232,7 @@ public void Unix_ZipWithOSSpecificFileNames(string zipName, string fileName) [InlineData("WindowsInvalid_FromWindows")] [InlineData("NullCharFileName_FromWindows")] [InlineData("NullCharFileName_FromUnix")] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_ZipWithInvalidFileNames_ThrowsArgumentException(string zipName) { Assert.Throws(() => ZipFile.ExtractToDirectory(compat(zipName) + ".zip", GetTestFilePath())); @@ -241,7 +241,7 @@ public void Windows_ZipWithInvalidFileNames_ThrowsArgumentException(string zipNa [Theory] [InlineData("backslashes_FromUnix", "dd")] [InlineData("backslashes_FromWindows", "dd")] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_ZipWithOSSpecificFileNames(string zipName, string fileName) { string tempDir = GetTestFilePath(); diff --git a/src/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs b/src/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs index eee3ed331acf..2ac34c579df9 100644 --- a/src/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs +++ b/src/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs @@ -10,7 +10,7 @@ namespace System.IO.FileSystem.DriveInfoTests public partial class DriveInfoUnixTests { [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void TestConstructor() { Assert.All( @@ -23,7 +23,7 @@ public void TestConstructor() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void TestGetDrives() { var drives = DriveInfo.GetDrives(); @@ -41,7 +41,7 @@ public void TestGetDrives() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void PropertiesOfInvalidDrive() { string invalidDriveName = "NonExistentDriveName"; @@ -60,7 +60,7 @@ public void PropertiesOfInvalidDrive() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/11570 - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void PropertiesOfValidDrive() { var root = new DriveInfo("/"); @@ -77,7 +77,7 @@ public void PropertiesOfValidDrive() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void SetVolumeLabel_Throws_PlatformNotSupportedException() { var root = new DriveInfo("/"); diff --git a/src/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Windows.Tests.cs b/src/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Windows.Tests.cs index 0fdd0b911a36..a49d23249053 100644 --- a/src/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Windows.Tests.cs +++ b/src/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Windows.Tests.cs @@ -17,7 +17,7 @@ namespace System.IO.FileSystem.DriveInfoTests public class DriveInfoWindowsTests { [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void TestConstructor() { string[] invalidInput = { ":\0", ":", "://", @":\", ":/", @":\\", "Az", "1", "a1", @"\\share", @"\\", "c ", string.Empty, " c" }; @@ -43,7 +43,7 @@ public void TestConstructor() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void TestGetDrives() { var validExpectedDrives = GetValidDriveLettersOnMachine(); @@ -60,7 +60,7 @@ public void TestGetDrives() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void TestDriveFormat() { var validDrive = DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.Fixed).First(); @@ -86,7 +86,7 @@ public void TestDriveFormat() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void TestDriveType() { var validDrive = DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.Fixed).First(); @@ -99,7 +99,7 @@ public void TestDriveType() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void TestValidDiskSpaceProperties() { bool win32Result; @@ -131,7 +131,7 @@ public void TestValidDiskSpaceProperties() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void TestInvalidDiskProperties() { string invalidDriveName = GetInvalidDriveLettersOnMachine().First().ToString(); @@ -151,7 +151,7 @@ public void TestInvalidDiskProperties() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void GetVolumeLabel_Returns_CorrectLabel() { int serialNumber, maxFileNameLen, fileSystemFlags; @@ -174,7 +174,7 @@ public void GetVolumeLabel_Returns_CorrectLabel() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SetVolumeLabel_Roundtrips() { DriveInfo drive = DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.Fixed).First(); @@ -188,7 +188,7 @@ public void SetVolumeLabel_Roundtrips() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void VolumeLabelOnNetworkOrCdRom_Throws() { // Test setting the volume label on a Network or CD-ROM diff --git a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.Move.cs b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.Move.cs index 17bcaab1ec09..2b07e7bfc335 100644 --- a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.Move.cs +++ b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.Move.cs @@ -3,14 +3,13 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { public class Directory_Move_Tests : FileSystemWatcherTest { [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Directory_Move_To_Same_Directory() { DirectoryMove_SameDirectory(WatcherChangeTypes.Renamed); @@ -23,14 +22,14 @@ public void Directory_Move_From_Watched_To_Unwatched() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_Directory_Move_To_Different_Watched_Directory() { DirectoryMove_DifferentWatchedDirectory(WatcherChangeTypes.Changed); } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_Directory_Move_To_Different_Watched_Directory() { DirectoryMove_DifferentWatchedDirectory(0); diff --git a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs index 61a8de745cf6..2536a13f6fd3 100644 --- a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs +++ b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -143,7 +142,7 @@ public void FileSystemWatcher_Directory_NotifyFilter_LastWriteTime(NotifyFilters [Theory] [MemberData(nameof(FilterTypes))] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void FileSystemWatcher_Directory_NotifyFilter_Security(NotifyFilters filter) { using (var testDirectory = new TempDirectory(GetTestFilePath())) diff --git a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs index a7d19ea6ee4c..e685399df807 100644 --- a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs +++ b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.Move.cs @@ -3,21 +3,20 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { public class File_Move_Tests : FileSystemWatcherTest { [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_File_Move_To_Same_Directory() { FileMove_SameDirectory(WatcherChangeTypes.Renamed); } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_File_Move_To_Same_Directory() { FileMove_SameDirectory(WatcherChangeTypes.Created | WatcherChangeTypes.Deleted); @@ -30,21 +29,21 @@ public void File_Move_From_Watched_To_Unwatched() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_File_Move_To_Different_Watched_Directory() { FileMove_DifferentWatchedDirectory(WatcherChangeTypes.Changed); } [Fact] - [PlatformSpecific(XunitPlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void OSX_File_Move_To_Different_Watched_Directory() { FileMove_DifferentWatchedDirectory(WatcherChangeTypes.Changed); } [Fact] - [PlatformSpecific(XunitPlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void Linux_File_Move_To_Different_Watched_Directory() { FileMove_DifferentWatchedDirectory(0); @@ -59,7 +58,7 @@ public void File_Move_From_Unwatched_To_Watched() [Theory] [InlineData(false)] [InlineData(true)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_File_Move_In_Nested_Directory(bool includeSubdirectories) { FileMove_NestedDirectory(includeSubdirectories ? WatcherChangeTypes.Renamed : 0, includeSubdirectories); @@ -68,21 +67,21 @@ public void Windows_File_Move_In_Nested_Directory(bool includeSubdirectories) [Theory] [InlineData(false)] [InlineData(true)] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_File_Move_In_Nested_Directory(bool includeSubdirectories) { FileMove_NestedDirectory(includeSubdirectories ? WatcherChangeTypes.Created | WatcherChangeTypes.Deleted : 0, includeSubdirectories); } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_File_Move_With_Set_NotifyFilter() { FileMove_WithNotifyFilter(WatcherChangeTypes.Renamed); } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_File_Move_With_Set_NotifyFilter() { FileMove_WithNotifyFilter(WatcherChangeTypes.Deleted); diff --git a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs index 30d14dafd7fe..33bbefead439 100644 --- a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs +++ b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs @@ -7,7 +7,6 @@ using System.Threading; using System.Threading.Tasks; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -170,7 +169,7 @@ public void FileSystemWatcher_File_NotifyFilter_Size(NotifyFilters filter) [Theory] [MemberData(nameof(FilterTypes))] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void FileSystemWatcher_File_NotifyFilter_Security(NotifyFilters filter) { using (var testDirectory = new TempDirectory(GetTestFilePath())) diff --git a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.InternalBufferSize.cs b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.InternalBufferSize.cs index b3748a3e3155..fb959bbd52b6 100644 --- a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.InternalBufferSize.cs +++ b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.InternalBufferSize.cs @@ -4,7 +4,6 @@ using System.Threading; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -42,7 +41,7 @@ public class InternalBufferSizeTests : FileSystemWatcherTest [Theory] [InlineData(true)] [InlineData(false)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void FileSystemWatcher_InternalBufferSize(bool setToHigherCapacity) { using (var testDirectory = new TempDirectory(GetTestFilePath())) diff --git a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs index a0779d5daf9a..c59e2815363a 100644 --- a/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs +++ b/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs @@ -9,7 +9,6 @@ using System.Runtime.InteropServices; using System.Threading; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -362,7 +361,7 @@ public void FileSystemWatcher_OnCreated() } [Fact] - [PlatformSpecific(XunitPlatformID.OSX | XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.OSX | TestPlatforms.Windows)] public void FileSystemWatcher_OnCreatedWithMismatchedCasingGivesExpectedFullPath() { using (var dir = new TempDirectory(GetTestFilePath())) @@ -455,7 +454,7 @@ public void FileSystemWatcher_OnRenamed() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // Unix FSW don't trigger on a file rename. + [PlatformSpecific(TestPlatforms.Windows)] // Unix FSW don't trigger on a file rename. public void FileSystemWatcher_Windows_OnRenameGivesExpectedFullPath() { using (var dir = new TempDirectory(GetTestFilePath())) @@ -544,7 +543,7 @@ public void FileSystemWatcher_Renamed() } [Fact] - [PlatformSpecific(XunitPlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] [OuterLoop("This test has high system resource demands and may cause failures in other concurrent tests")] public void FileSystemWatcher_CreateManyConcurrentInstances() { @@ -575,7 +574,7 @@ public void FileSystemWatcher_CreateManyConcurrentInstances() } [Fact] - [PlatformSpecific(XunitPlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] [OuterLoop("This test has high system resource demands and may cause failures in other concurrent tests")] public void FileSystemWatcher_CreateManyConcurrentWatches() { diff --git a/src/System.IO.FileSystem/tests/Directory/CreateDirectory.cs b/src/System.IO.FileSystem/tests/Directory/CreateDirectory.cs index 76ea53fe1371..d5db019feab2 100644 --- a/src/System.IO.FileSystem/tests/Directory/CreateDirectory.cs +++ b/src/System.IO.FileSystem/tests/Directory/CreateDirectory.cs @@ -4,7 +4,6 @@ using System.Linq; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -132,7 +131,7 @@ public void ValidPathWithTrailingSlash() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void ValidExtendedPathWithTrailingSlash() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -225,7 +224,7 @@ public void DirectoryWithComponentLongerThanMaxComponentAsPath_ThrowsPathTooLong #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void PathWithInvalidColons_ThrowsNotSupportedException() { var paths = IOInputs.GetPathsWithInvalidColons(); @@ -236,7 +235,7 @@ public void PathWithInvalidColons_ThrowsNotSupportedException() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DirectoryLongerThanMaxPath_Succeeds() { var paths = IOInputs.GetPathsLongerThanMaxPath(GetTestFilePath()); @@ -249,7 +248,7 @@ public void DirectoryLongerThanMaxPath_Succeeds() [Fact] [ActiveIssue(11687)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DirectoryLongerThanMaxLongPath_ThrowsPathTooLongException() { var paths = IOInputs.GetPathsLongerThanMaxLongPath(GetTestFilePath()); @@ -260,7 +259,7 @@ public void DirectoryLongerThanMaxLongPath_ThrowsPathTooLongException() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DirectoryLongerThanMaxLongPathWithExtendedSyntax_ThrowsPathTooLongException() { var paths = IOInputs.GetPathsLongerThanMaxLongPath(GetTestFilePath(), useExtendedSyntax: true); @@ -272,7 +271,7 @@ public void DirectoryLongerThanMaxLongPathWithExtendedSyntax_ThrowsPathTooLongEx [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void ExtendedDirectoryLongerThanLegacyMaxPath_Succeeds() { var paths = IOInputs.GetPathsLongerThanMaxPath(GetTestFilePath(), useExtendedSyntax: true); @@ -283,7 +282,7 @@ public void ExtendedDirectoryLongerThanLegacyMaxPath_Succeeds() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DirectoryLongerThanMaxDirectoryAsPath_Succeeds() { var paths = IOInputs.GetPathsLongerThanMaxDirectory(GetTestFilePath()); @@ -295,7 +294,7 @@ public void DirectoryLongerThanMaxDirectoryAsPath_Succeeds() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixPathLongerThan256_Allowed() { DirectoryInfo testDir = Create(GetTestFilePath()); @@ -306,7 +305,7 @@ public void UnixPathLongerThan256_Allowed() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixPathWithDeeplyNestedDirectories() { DirectoryInfo parent = Create(GetTestFilePath()); @@ -318,7 +317,7 @@ public void UnixPathWithDeeplyNestedDirectories() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsWhiteSpaceAsPath_ThrowsArgumentException() { var paths = IOInputs.GetWhiteSpace(); @@ -329,7 +328,7 @@ public void WindowsWhiteSpaceAsPath_ThrowsArgumentException() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixWhiteSpaceAsPath_Allowed() { var paths = IOInputs.GetWhiteSpace(); @@ -341,7 +340,7 @@ public void UnixWhiteSpaceAsPath_Allowed() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsTrailingWhiteSpace() { // Windows will remove all non-significant whitespace in a path @@ -359,7 +358,7 @@ public void WindowsTrailingWhiteSpace() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsExtendedSyntaxWhiteSpace() { var paths = IOInputs.GetSimpleWhiteSpace(); @@ -375,7 +374,7 @@ public void WindowsExtendedSyntaxWhiteSpace() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixNonSignificantTrailingWhiteSpace() { // Unix treats trailing/prename whitespace as significant and a part of the name. @@ -393,7 +392,7 @@ public void UnixNonSignificantTrailingWhiteSpace() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // alternate data streams + [PlatformSpecific(TestPlatforms.Windows)] // alternate data streams public void PathWithAlternateDataStreams_ThrowsNotSupportedException() { var paths = IOInputs.GetPathsWithAlternativeDataStreams(); @@ -404,7 +403,7 @@ public void PathWithAlternateDataStreams_ThrowsNotSupportedException() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // device name prefixes + [PlatformSpecific(TestPlatforms.Windows)] // device name prefixes public void PathWithReservedDeviceNameAsPath_ThrowsDirectoryNotFoundException() { // Throws DirectoryNotFoundException, when the behavior really should be an invalid path var paths = IOInputs.GetPathsWithReservedDeviceNames(); @@ -415,7 +414,7 @@ public void PathWithReservedDeviceNameAsPath_ThrowsDirectoryNotFoundException() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // device name prefixes + [PlatformSpecific(TestPlatforms.Windows)] // device name prefixes public void PathWithReservedDeviceNameAsExtendedPath() { var paths = IOInputs.GetReservedDeviceNames(); @@ -429,7 +428,7 @@ public void PathWithReservedDeviceNameAsExtendedPath() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // UNC shares + [PlatformSpecific(TestPlatforms.Windows)] // UNC shares public void UncPathWithoutShareNameAsPath_ThrowsArgumentException() { var paths = IOInputs.GetUncPathsWithoutShareName(); @@ -440,14 +439,14 @@ public void UncPathWithoutShareNameAsPath_ThrowsArgumentException() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // UNC shares + [PlatformSpecific(TestPlatforms.Windows)] // UNC shares public void UNCPathWithOnlySlashes() { Assert.Throws(() => Create("//")); } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // drive labels + [PlatformSpecific(TestPlatforms.Windows)] // drive labels public void CDriveCase() { DirectoryInfo dir = Create("c:\\"); @@ -456,7 +455,7 @@ public void CDriveCase() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DriveLetter_Windows() { // On Windows, DirectoryInfo will replace ":" with "." @@ -467,7 +466,7 @@ public void DriveLetter_Windows() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void DriveLetter_Unix() { // On Unix, there's no special casing for drive letters. These may or may not be valid names, depending @@ -496,7 +495,7 @@ public void DriveLetter_Unix() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // testing drive labels + [PlatformSpecific(TestPlatforms.Windows)] // testing drive labels public void NonExistentDriveAsPath_ThrowsDirectoryNotFoundException() { Assert.Throws(() => @@ -506,7 +505,7 @@ public void NonExistentDriveAsPath_ThrowsDirectoryNotFoundException() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // testing drive labels + [PlatformSpecific(TestPlatforms.Windows)] // testing drive labels public void SubdirectoryOnNonExistentDriveAsPath_ThrowsDirectoryNotFoundException() { Assert.Throws(() => @@ -517,7 +516,7 @@ public void SubdirectoryOnNonExistentDriveAsPath_ThrowsDirectoryNotFoundExceptio [Fact] [ActiveIssue(1221)] - [PlatformSpecific(XunitPlatformID.Windows)] // testing drive labels + [PlatformSpecific(TestPlatforms.Windows)] // testing drive labels public void NotReadyDriveAsPath_ThrowsDirectoryNotFoundException() { // Behavior is suspect, should really have thrown IOException similar to the SubDirectory case var drive = IOServices.GetNotReadyDrive(); @@ -534,7 +533,7 @@ public void NotReadyDriveAsPath_ThrowsDirectoryNotFoundException() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // testing drive labels + [PlatformSpecific(TestPlatforms.Windows)] // testing drive labels [ActiveIssue(1221)] public void SubdirectoryOnNotReadyDriveAsPath_ThrowsIOException() { diff --git a/src/System.IO.FileSystem/tests/Directory/Delete.cs b/src/System.IO.FileSystem/tests/Directory/Delete.cs index 35fdd3e3f715..1396f6be1059 100644 --- a/src/System.IO.FileSystem/tests/Directory/Delete.cs +++ b/src/System.IO.FileSystem/tests/Directory/Delete.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -114,7 +113,7 @@ public void DeletingSymLinkDoesntDeleteTarget() #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsExtendedDirectoryWithSubdirectories() { DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); @@ -124,7 +123,7 @@ public void WindowsExtendedDirectoryWithSubdirectories() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsLongPathExtendedDirectory() { DirectoryInfo testDir = Directory.CreateDirectory(IOServices.GetPath(IOInputs.ExtendedPrefix + TestDirectory, characterCount: 500).FullPath); @@ -133,7 +132,7 @@ public void WindowsLongPathExtendedDirectory() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsDeleteReadOnlyDirectory() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -144,7 +143,7 @@ public void WindowsDeleteReadOnlyDirectory() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsDeleteExtendedReadOnlyDirectory() { DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); @@ -155,7 +154,7 @@ public void WindowsDeleteExtendedReadOnlyDirectory() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixDeleteReadOnlyDirectory() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -165,7 +164,7 @@ public void UnixDeleteReadOnlyDirectory() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsShouldBeAbleToDeleteHiddenDirectory() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -175,7 +174,7 @@ public void WindowsShouldBeAbleToDeleteHiddenDirectory() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsShouldBeAbleToDeleteExtendedHiddenDirectory() { DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); @@ -185,7 +184,7 @@ public void WindowsShouldBeAbleToDeleteExtendedHiddenDirectory() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixShouldBeAbleToDeleteHiddenDirectory() { string testDir = "." + GetTestFileName(); @@ -233,7 +232,7 @@ public void RecursiveDeleteWithTrailingSlash() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void RecursiveDelete_ShouldThrowIOExceptionIfContainedFileInUse() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); diff --git a/src/System.IO.FileSystem/tests/Directory/Delete_MountVolume.cs b/src/System.IO.FileSystem/tests/Directory/Delete_MountVolume.cs index 7c1499c982e5..43702148fcd2 100644 --- a/src/System.IO.FileSystem/tests/Directory/Delete_MountVolume.cs +++ b/src/System.IO.FileSystem/tests/Directory/Delete_MountVolume.cs @@ -23,7 +23,7 @@ public class Directory_Delete_MountVolume [Fact] [ActiveIssue(1221)] - [PlatformSpecific(Xunit.PlatformID.Windows)] // testing volumes / mounts / drive letters + [PlatformSpecific(TestPlatforms.Windows)] // testing volumes / mounts / drive letters public static void RunTest() { try diff --git a/src/System.IO.FileSystem/tests/Directory/Exists.cs b/src/System.IO.FileSystem/tests/Directory/Exists.cs index ff49ef55f0b3..9e82e48d5b03 100644 --- a/src/System.IO.FileSystem/tests/Directory/Exists.cs +++ b/src/System.IO.FileSystem/tests/Directory/Exists.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Runtime.InteropServices; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -181,7 +180,7 @@ public void SymlinkToNewDirectory() #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void ValidExtendedPathExists_ReturnsTrue() { Assert.All((IOInputs.GetValidPathComponentNames()), (component) => @@ -193,7 +192,7 @@ public void ValidExtendedPathExists_ReturnsTrue() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void ExtendedPathAlreadyExistsAsFile() { string path = IOInputs.ExtendedPrefix + GetTestFilePath(); @@ -205,7 +204,7 @@ public void ExtendedPathAlreadyExistsAsFile() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void ExtendedPathAlreadyExistsAsDirectory() { string path = IOInputs.ExtendedPrefix + GetTestFilePath(); @@ -217,7 +216,7 @@ public void ExtendedPathAlreadyExistsAsDirectory() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DirectoryLongerThanMaxDirectoryAsPath_DoesntThrow() { Assert.All((IOInputs.GetPathsLongerThanMaxDirectory(GetTestFilePath())), (path) => @@ -227,7 +226,7 @@ public void DirectoryLongerThanMaxDirectoryAsPath_DoesntThrow() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // Unix equivalent tested already in CreateDirectory + [PlatformSpecific(TestPlatforms.Windows)] // Unix equivalent tested already in CreateDirectory public void WindowsWhiteSpaceAsPath_ReturnsFalse() { // Checks that errors aren't thrown when calling Exists() on impossible paths @@ -258,7 +257,7 @@ public void DoesCaseSensitiveComparisons() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // In Windows, trailing whitespace in a path is trimmed appropriately + [PlatformSpecific(TestPlatforms.Windows)] // In Windows, trailing whitespace in a path is trimmed appropriately public void TrailingWhitespaceExistence() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -279,7 +278,7 @@ public void TrailingWhitespaceExistence() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // alternate data stream + [PlatformSpecific(TestPlatforms.Windows)] // alternate data stream public void PathWithAlternateDataStreams_ReturnsFalse() { Assert.All(IOInputs.GetWhiteSpace(), (component) => @@ -290,7 +289,7 @@ public void PathWithAlternateDataStreams_ReturnsFalse() [Fact] [OuterLoop] - [PlatformSpecific(XunitPlatformID.Windows)] // device names + [PlatformSpecific(TestPlatforms.Windows)] // device names public void PathWithReservedDeviceNameAsPath_ReturnsFalse() { Assert.All((IOInputs.GetPathsWithReservedDeviceNames()), (component) => @@ -300,7 +299,7 @@ public void PathWithReservedDeviceNameAsPath_ReturnsFalse() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // UNC paths + [PlatformSpecific(TestPlatforms.Windows)] // UNC paths public void UncPathWithoutShareNameAsPath_ReturnsFalse() { Assert.All((IOInputs.GetUncPathsWithoutShareName()), (component) => @@ -310,7 +309,7 @@ public void UncPathWithoutShareNameAsPath_ReturnsFalse() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // max directory length not fixed on Unix + [PlatformSpecific(TestPlatforms.Windows)] // max directory length not fixed on Unix public void DirectoryEqualToMaxDirectory_ReturnsTrue() { // Creates directories up to the maximum directory length all at once @@ -321,7 +320,7 @@ public void DirectoryEqualToMaxDirectory_ReturnsTrue() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // max directory length not fixed on Unix + [PlatformSpecific(TestPlatforms.Windows)] // max directory length not fixed on Unix public void DirectoryWithComponentLongerThanMaxComponentAsPath_ReturnsFalse() { Assert.All((IOInputs.GetPathsWithComponentLongerThanMaxComponent()), (component) => @@ -332,7 +331,7 @@ public void DirectoryWithComponentLongerThanMaxComponentAsPath_ReturnsFalse() [Fact] [ActiveIssue(1221)] - [PlatformSpecific(XunitPlatformID.Windows)] // drive labels + [PlatformSpecific(TestPlatforms.Windows)] // drive labels public void NotReadyDriveAsPath_ReturnsFalse() { var drive = IOServices.GetNotReadyDrive(); @@ -349,7 +348,7 @@ public void NotReadyDriveAsPath_ReturnsFalse() [Fact] [ActiveIssue(1221)] - [PlatformSpecific(XunitPlatformID.Windows)] // drive labels + [PlatformSpecific(TestPlatforms.Windows)] // drive labels public void SubdirectoryOnNotReadyDriveAsPath_ReturnsFalse() { var drive = IOServices.GetNotReadyDrive(); @@ -365,21 +364,21 @@ public void SubdirectoryOnNotReadyDriveAsPath_ReturnsFalse() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // drive labels + [PlatformSpecific(TestPlatforms.Windows)] // drive labels public void NonExistentDriveAsPath_ReturnsFalse() { Assert.False(Exists(IOServices.GetNonExistentDrive())); } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // drive labels + [PlatformSpecific(TestPlatforms.Windows)] // drive labels public void SubdirectoryOnNonExistentDriveAsPath_ReturnsFalse() { Assert.False(Exists(Path.Combine(IOServices.GetNonExistentDrive(), "nonexistentsubdir"))); } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/Directory/GetDirectoryRoot.cs b/src/System.IO.FileSystem/tests/Directory/GetDirectoryRoot.cs index 7a233bdbc26e..e02a5d1675d8 100644 --- a/src/System.IO.FileSystem/tests/Directory/GetDirectoryRoot.cs +++ b/src/System.IO.FileSystem/tests/Directory/GetDirectoryRoot.cs @@ -50,7 +50,7 @@ public void WhitespacePaths() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void UNCShares() { string root = Directory.GetDirectoryRoot(new string(Path.DirectorySeparatorChar, 2) + Path.Combine("Test1", "test2", "test3")); diff --git a/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str.cs b/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str.cs index cfc1962501aa..ba8194cd7e4e 100644 --- a/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str.cs +++ b/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -183,7 +182,7 @@ public void InvalidPath() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsInvalidCharsPath() { Assert.All(WindowsInvalidUnixValid, invalid => @@ -191,7 +190,7 @@ public void WindowsInvalidCharsPath() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixValidCharsFilePath() { if (TestFiles) @@ -207,7 +206,7 @@ public void UnixValidCharsFilePath() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixValidCharsDirectoryPath() { if (TestDirectories) diff --git a/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs b/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs index 80ea22ab3dc3..0aef98ea24b5 100644 --- a/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs +++ b/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs @@ -4,7 +4,6 @@ using System.Runtime.InteropServices; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -210,7 +209,7 @@ public void SearchPatternIgnoreSubDirectories() #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsSearchPatternLongSegment() { // Create a path segment longer than the normal max of 255 @@ -243,7 +242,7 @@ public void SearchPatternLongPath() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsSearchPatternWithDoubleDots() { Assert.Throws(() => GetEntries(TestDirectory, Path.Combine("..ab ab.. .. abc..d", "abc.."))); @@ -253,7 +252,7 @@ public void WindowsSearchPatternWithDoubleDots() [ActiveIssue(11584)] [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsSearchPatternInvalid() { Assert.Throws(() => GetEntries(TestDirectory, "\0")); @@ -296,7 +295,7 @@ public void WindowsSearchPatternInvalid() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixSearchPatternInvalid() { Assert.Throws(() => GetEntries(TestDirectory, "\0")); @@ -304,7 +303,7 @@ public void UnixSearchPatternInvalid() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public virtual void WindowsSearchPatternQuestionMarks() { string testDir1Str = GetTestFileName(); @@ -323,7 +322,7 @@ public virtual void WindowsSearchPatternQuestionMarks() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsSearchPatternWhitespace() { Assert.Empty(GetEntries(TestDirectory, " ")); @@ -377,7 +376,7 @@ public void SearchPatternCaseInsensitive() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixSearchPatternFileValidChar() { if (TestFiles) @@ -392,7 +391,7 @@ public void UnixSearchPatternFileValidChar() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixSearchPatternDirectoryValidChar() { if (TestDirectories) @@ -407,7 +406,7 @@ public void UnixSearchPatternDirectoryValidChar() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixSearchPatternWithDoubleDots() { // search pattern is valid but directory doesn't exist diff --git a/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str_so.cs b/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str_so.cs index 8b093df07111..138c50a93bb7 100644 --- a/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str_so.cs +++ b/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str_so.cs @@ -28,7 +28,7 @@ public virtual string[] GetEntries(string dirName, string searchPattern, SearchO #endregion [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public override void WindowsSearchPatternQuestionMarks() { string testDir1Str = GetTestFileName(); diff --git a/src/System.IO.FileSystem/tests/Directory/GetLogicalDrives.cs b/src/System.IO.FileSystem/tests/Directory/GetLogicalDrives.cs index 95526dd98c42..fac75152de5f 100644 --- a/src/System.IO.FileSystem/tests/Directory/GetLogicalDrives.cs +++ b/src/System.IO.FileSystem/tests/Directory/GetLogicalDrives.cs @@ -5,14 +5,13 @@ using System.Linq; using System.Runtime.InteropServices; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { public class Directory_GetLogicalDrives { [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void GetsValidDriveStrings_Unix() { string[] drives = Directory.GetLogicalDrives(); @@ -22,7 +21,7 @@ public void GetsValidDriveStrings_Unix() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void GetsValidDriveStrings_Windows() { string[] drives = Directory.GetLogicalDrives(); diff --git a/src/System.IO.FileSystem/tests/Directory/GetParent.cs b/src/System.IO.FileSystem/tests/Directory/GetParent.cs index 5ea96ff11455..9f4cdbdfb33a 100644 --- a/src/System.IO.FileSystem/tests/Directory/GetParent.cs +++ b/src/System.IO.FileSystem/tests/Directory/GetParent.cs @@ -39,7 +39,7 @@ public void DotsInPathAreValid() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void UNCShares() { Assert.Null(GetParent(new string(Path.DirectorySeparatorChar, 2) + Path.Combine("Machine", "Test"))); diff --git a/src/System.IO.FileSystem/tests/Directory/GetSetTimes.cs b/src/System.IO.FileSystem/tests/Directory/GetSetTimes.cs index e3f21eaa9dc6..3ac8323f0bdd 100644 --- a/src/System.IO.FileSystem/tests/Directory/GetSetTimes.cs +++ b/src/System.IO.FileSystem/tests/Directory/GetSetTimes.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -121,7 +120,7 @@ public void CreationSetsAllTimes() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_DirectoryDoesntExist_ReturnDefaultValues() { string path = GetTestFilePath(); @@ -150,7 +149,7 @@ public void Windows_DirectoryDoesntExist_ReturnDefaultValues() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_DirectoryDoesntExist_Throws() { string path = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/Directory/Move.cs b/src/System.IO.FileSystem/tests/Directory/Move.cs index 25fe82c7f079..0bac0745972c 100644 --- a/src/System.IO.FileSystem/tests/Directory/Move.cs +++ b/src/System.IO.FileSystem/tests/Directory/Move.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -145,7 +144,7 @@ public void Path_Longer_Than_MaxLongPath_Throws_Exception() #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Path_With_Longer_Than_MaxDirectory_Succeeds() { string testDir = GetTestFilePath(); @@ -170,7 +169,7 @@ public void Path_With_Longer_Than_MaxDirectory_Succeeds() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsWildCharacterPath() { Assert.Throws(() => Move("*", GetTestFilePath())); @@ -180,7 +179,7 @@ public void WindowsWildCharacterPath() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/1008 - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixWildCharacterPath() { // Wildcards are allowed in paths for Unix move commands as literals as well as functional wildcards, @@ -206,7 +205,7 @@ public void UnixWildCharacterPath() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsWhitespacePath() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -220,7 +219,7 @@ public void WindowsWhitespacePath() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/1008 - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixWhitespacePath() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -235,7 +234,7 @@ public void UnixWhitespacePath() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsExistingDirectory() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -250,7 +249,7 @@ public void WindowsExistingDirectory() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BetweenDriveLabels() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -262,7 +261,7 @@ public void BetweenDriveLabels() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/1008 - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixExistingDirectory() { // Moving to an-empty directory is supported on Unix, but moving to a non-empty directory is not diff --git a/src/System.IO.FileSystem/tests/Directory/ReparsePoints_MountVolume.cs b/src/System.IO.FileSystem/tests/Directory/ReparsePoints_MountVolume.cs index 1beeb9011c4d..b9870ab5a040 100644 --- a/src/System.IO.FileSystem/tests/Directory/ReparsePoints_MountVolume.cs +++ b/src/System.IO.FileSystem/tests/Directory/ReparsePoints_MountVolume.cs @@ -20,7 +20,7 @@ public class Directory_ReparsePoints_MountVolume [Fact] [ActiveIssue(1221)] - [PlatformSpecific(Xunit.PlatformID.Windows)] // testing mounting volumes and reparse points + [PlatformSpecific(TestPlatforms.Windows)] // testing mounting volumes and reparse points public static void runTest() { try diff --git a/src/System.IO.FileSystem/tests/DirectoryInfo/Create.cs b/src/System.IO.FileSystem/tests/DirectoryInfo/Create.cs index 7311541eb7ca..f6415ead4678 100644 --- a/src/System.IO.FileSystem/tests/DirectoryInfo/Create.cs +++ b/src/System.IO.FileSystem/tests/DirectoryInfo/Create.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -21,7 +20,7 @@ public override DirectoryInfo Create(string path) #endregion [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // UNC shares for constructor + [PlatformSpecific(TestPlatforms.Windows)] // UNC shares for constructor public void NetworkShare() { string dirName = new string(Path.DirectorySeparatorChar, 2) + Path.Combine("contoso", "amusement", "device"); @@ -43,7 +42,7 @@ public void ValidExtensionsArePreserved(string extension) [Theory] [InlineData(".")] [InlineData("............")] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsInvalidExtensionsAreRemoved(string extension) { string testDir = GetTestFilePath(); @@ -54,7 +53,7 @@ public void WindowsInvalidExtensionsAreRemoved(string extension) [Theory] [InlineData(".s", ".")] [InlineData(".s", ".s....")] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsCurtailTrailingDots(string extension, string trailing) { string testDir = GetTestFilePath(); @@ -66,7 +65,7 @@ public void WindowsCurtailTrailingDots(string extension, string trailing) [Theory] [InlineData(".s", ".")] [InlineData(".s.s....", ".ls")] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixLastDotIsExtension(string extension, string trailing) { string testDir = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/DirectoryInfo/CreateSubdirectory.cs b/src/System.IO.FileSystem/tests/DirectoryInfo/CreateSubdirectory.cs index 4aecb69c87ff..ff7d14802bf8 100644 --- a/src/System.IO.FileSystem/tests/DirectoryInfo/CreateSubdirectory.cs +++ b/src/System.IO.FileSystem/tests/DirectoryInfo/CreateSubdirectory.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -145,7 +144,7 @@ public void AllowedSymbols() #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsControWhiteSpace() { // CreateSubdirectory will throw when passed a path with control whitespace e.g. "\t" @@ -158,7 +157,7 @@ public void WindowsControWhiteSpace() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsSimpleWhiteSpace() { // CreateSubdirectory trims all simple whitespace, returning us the parent directory @@ -176,7 +175,7 @@ public void WindowsSimpleWhiteSpace() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixWhiteSpaceAsPath_Allowed() { var paths = IOInputs.GetWhiteSpace(); @@ -188,7 +187,7 @@ public void UnixWhiteSpaceAsPath_Allowed() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixNonSignificantTrailingWhiteSpace() { // Unix treats trailing/prename whitespace as significant and a part of the name. @@ -206,7 +205,7 @@ public void UnixNonSignificantTrailingWhiteSpace() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void ExtendedPathSubdirectory() { DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); @@ -217,7 +216,7 @@ public void ExtendedPathSubdirectory() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // UNC shares + [PlatformSpecific(TestPlatforms.Windows)] // UNC shares public void UNCPathWithOnlySlashes() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); diff --git a/src/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs b/src/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs index 765de94df47a..d65becad5c5e 100644 --- a/src/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs +++ b/src/System.IO.FileSystem/tests/DirectoryInfo/Exists.cs @@ -98,7 +98,7 @@ public void FalseForFile() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/DirectoryInfo/GetSetAttributes.cs b/src/System.IO.FileSystem/tests/DirectoryInfo/GetSetAttributes.cs index 1d97dcc36a72..a827f0e1a2a1 100644 --- a/src/System.IO.FileSystem/tests/DirectoryInfo/GetSetAttributes.cs +++ b/src/System.IO.FileSystem/tests/DirectoryInfo/GetSetAttributes.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -49,7 +48,7 @@ public void NonExistentFile() [Theory] [InlineData(FileAttributes.ReadOnly)] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixAttributeSetting(FileAttributes attr) { var test = new DirectoryInfo(GetTestFilePath()); @@ -65,7 +64,7 @@ public void UnixAttributeSetting(FileAttributes attr) [InlineData(FileAttributes.System)] [InlineData(FileAttributes.Archive)] [InlineData(FileAttributes.ReadOnly | FileAttributes.Hidden)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsAttributeSetting(FileAttributes attr) { var test = new DirectoryInfo(GetTestFilePath()); @@ -82,7 +81,7 @@ public void WindowsAttributeSetting(FileAttributes attr) [InlineData(FileAttributes.SparseFile)] [InlineData(FileAttributes.ReparsePoint)] [InlineData(FileAttributes.Compressed)] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixInvalidAttributes(FileAttributes attr) { var path = GetTestFilePath(); @@ -97,7 +96,7 @@ public void UnixInvalidAttributes(FileAttributes attr) [InlineData(FileAttributes.SparseFile)] [InlineData(FileAttributes.ReparsePoint)] [InlineData(FileAttributes.Compressed)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsInvalidAttributes(FileAttributes attr) { var path = GetTestFilePath(); @@ -109,7 +108,7 @@ public void WindowsInvalidAttributes(FileAttributes attr) [Theory] [InlineData(~FileAttributes.ReadOnly)] [InlineData(-1)] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixInvalidAttributes_ThrowArgumentException(FileAttributes attr) { var test = new DirectoryInfo(GetTestFilePath()); @@ -121,7 +120,7 @@ public void UnixInvalidAttributes_ThrowArgumentException(FileAttributes attr) [InlineData(FileAttributes.Temporary)] [InlineData(~FileAttributes.ReadOnly)] [InlineData(-1)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsInvalidAttributes_ThrowArgumentException(FileAttributes attr) { var test = new DirectoryInfo(GetTestFilePath()); diff --git a/src/System.IO.FileSystem/tests/DirectoryInfo/Root.cs b/src/System.IO.FileSystem/tests/DirectoryInfo/Root.cs index 4355e371bcf3..cb8d6bef6f31 100644 --- a/src/System.IO.FileSystem/tests/DirectoryInfo/Root.cs +++ b/src/System.IO.FileSystem/tests/DirectoryInfo/Root.cs @@ -32,7 +32,7 @@ public void DotsInPathAreValid() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void UNCShares() { string root = Path.GetPathRoot(Directory.GetCurrentDirectory()); diff --git a/src/System.IO.FileSystem/tests/DirectoryInfo/ToString.cs b/src/System.IO.FileSystem/tests/DirectoryInfo/ToString.cs index f26404548d12..dd7b62e84be0 100644 --- a/src/System.IO.FileSystem/tests/DirectoryInfo/ToString.cs +++ b/src/System.IO.FileSystem/tests/DirectoryInfo/ToString.cs @@ -38,7 +38,7 @@ public void KeepsOriginalPath(string path) } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DriveOnlyReturnsPeriod_Windows() { string path = @"C:"; diff --git a/src/System.IO.FileSystem/tests/File/Copy.cs b/src/System.IO.FileSystem/tests/File/Copy.cs index ac58090217b0..f2ad612f7641 100644 --- a/src/System.IO.FileSystem/tests/File/Copy.cs +++ b/src/System.IO.FileSystem/tests/File/Copy.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Runtime.InteropServices; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -170,7 +169,7 @@ public void CopyFileWithData_MemberData(char[] data, bool readOnly) #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsWhitespacePath() { string testFile = GetTestFilePath(); @@ -183,7 +182,7 @@ public void WindowsWhitespacePath() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixWhitespacePath() { string testFile = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/File/Create.cs b/src/System.IO.FileSystem/tests/File/Create.cs index 4617fd21150c..3677713bfeb3 100644 --- a/src/System.IO.FileSystem/tests/File/Create.cs +++ b/src/System.IO.FileSystem/tests/File/Create.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -58,7 +57,7 @@ public void ValidCreation() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void ValidCreation_ExtendedSyntax() { DirectoryInfo testDir = Directory.CreateDirectory(IOInputs.ExtendedPrefix + GetTestFilePath()); @@ -73,7 +72,7 @@ public void ValidCreation_ExtendedSyntax() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void ValidCreation_LongPathExtendedSyntax() { DirectoryInfo testDir = Directory.CreateDirectory(IOServices.GetPath(IOInputs.ExtendedPrefix + TestDirectory, characterCount: 500).FullPath); @@ -196,7 +195,7 @@ public void CaseInsensitive() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsWildCharacterPath() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); @@ -207,7 +206,7 @@ public void WindowsWildCharacterPath() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsWhitespacePath() { Assert.Throws(() => Create(" ")); @@ -220,7 +219,7 @@ public void WindowsWhitespacePath() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixWhitespacePath() { DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath()); diff --git a/src/System.IO.FileSystem/tests/File/Delete.cs b/src/System.IO.FileSystem/tests/File/Delete.cs index f9cd98b07442..996fd3ddfb7d 100644 --- a/src/System.IO.FileSystem/tests/File/Delete.cs +++ b/src/System.IO.FileSystem/tests/File/Delete.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -109,21 +108,21 @@ public void DeletingSymLinkDoesntDeleteTarget() #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_NonExistentPath_Throws_DirectoryNotFoundException() { Assert.Throws(() => Delete(Path.Combine(TestDirectory, GetTestFileName(), "C"))); } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_NonExistentPath_Nop() { Delete(Path.Combine(TestDirectory, GetTestFileName(), "C")); } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_File_Already_Open_Throws_IOException() { string path = GetTestFilePath(); @@ -134,7 +133,7 @@ public void Windows_File_Already_Open_Throws_IOException() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_File_Already_Open_Allowed() { string path = GetTestFilePath(); @@ -147,7 +146,7 @@ public void Unix_File_Already_Open_Allowed() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsDeleteReadOnlyFile() { string path = GetTestFilePath(); @@ -159,7 +158,7 @@ public void WindowsDeleteReadOnlyFile() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixDeleteReadOnlyFile() { FileInfo testFile = Create(GetTestFilePath()); diff --git a/src/System.IO.FileSystem/tests/File/Exists.cs b/src/System.IO.FileSystem/tests/File/Exists.cs index 86595a0f48e1..69e42a977601 100644 --- a/src/System.IO.FileSystem/tests/File/Exists.cs +++ b/src/System.IO.FileSystem/tests/File/Exists.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -141,7 +140,7 @@ public void SymLinksMayExistIndependentlyOfTarget() #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // Unix equivalent tested already in CreateDirectory + [PlatformSpecific(TestPlatforms.Windows)] // Unix equivalent tested already in CreateDirectory public void WindowsNonSignificantWhiteSpaceAsPath_ReturnsFalse() { // Checks that errors aren't thrown when calling Exists() on impossible paths @@ -174,7 +173,7 @@ public void DoesCaseSensitiveComparions() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // In Windows, trailing whitespace in a path is trimmed + [PlatformSpecific(TestPlatforms.Windows)] // In Windows, trailing whitespace in a path is trimmed public void TrimTrailingWhitespacePath() { FileInfo testFile = new FileInfo(GetTestFilePath()); @@ -186,7 +185,7 @@ public void TrimTrailingWhitespacePath() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // alternate data stream + [PlatformSpecific(TestPlatforms.Windows)] // alternate data stream public void PathWithAlternateDataStreams_ReturnsFalse() { Assert.All((IOInputs.GetPathsWithAlternativeDataStreams()), (component) => @@ -197,7 +196,7 @@ public void PathWithAlternateDataStreams_ReturnsFalse() [Fact] [OuterLoop] - [PlatformSpecific(XunitPlatformID.Windows)] // device names + [PlatformSpecific(TestPlatforms.Windows)] // device names public void PathWithReservedDeviceNameAsPath_ReturnsFalse() { Assert.All((IOInputs.GetPathsWithReservedDeviceNames()), (component) => @@ -207,7 +206,7 @@ public void PathWithReservedDeviceNameAsPath_ReturnsFalse() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // UNC paths + [PlatformSpecific(TestPlatforms.Windows)] // UNC paths public void UncPathWithoutShareNameAsPath_ReturnsFalse() { Assert.All((IOInputs.GetUncPathsWithoutShareName()), (component) => @@ -217,7 +216,7 @@ public void UncPathWithoutShareNameAsPath_ReturnsFalse() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // max directory length not fixed on Unix + [PlatformSpecific(TestPlatforms.Windows)] // max directory length not fixed on Unix public void DirectoryWithComponentLongerThanMaxComponentAsPath_ReturnsFalse() { Assert.All((IOInputs.GetPathsWithComponentLongerThanMaxComponent()), (component) => @@ -227,7 +226,7 @@ public void DirectoryWithComponentLongerThanMaxComponentAsPath_ReturnsFalse() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void FalseForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/File/GetSetAttributes.cs b/src/System.IO.FileSystem/tests/File/GetSetAttributes.cs index bc196ea7cfbb..b86843eb0bf9 100644 --- a/src/System.IO.FileSystem/tests/File/GetSetAttributes.cs +++ b/src/System.IO.FileSystem/tests/File/GetSetAttributes.cs @@ -4,7 +4,6 @@ using System.Runtime.InteropServices; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -47,7 +46,7 @@ public void NonExistentFile() [Theory] [InlineData(FileAttributes.ReadOnly)] [InlineData(FileAttributes.Normal)] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixAttributeSetting(FileAttributes attr) { var path = GetTestFilePath(); @@ -65,7 +64,7 @@ public void UnixAttributeSetting(FileAttributes attr) [InlineData(FileAttributes.Normal)] [InlineData(FileAttributes.Temporary)] [InlineData(FileAttributes.ReadOnly | FileAttributes.Hidden)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsAttributeSetting(FileAttributes attr) { var path = GetTestFilePath(); @@ -81,7 +80,7 @@ public void WindowsAttributeSetting(FileAttributes attr) [InlineData(FileAttributes.ReparsePoint)] [InlineData(FileAttributes.Compressed)] [InlineData(FileAttributes.Encrypted)] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixInvalidAttributes(FileAttributes attr) { var path = GetTestFilePath(); @@ -96,7 +95,7 @@ public void UnixInvalidAttributes(FileAttributes attr) [InlineData(FileAttributes.SparseFile)] [InlineData(FileAttributes.ReparsePoint)] [InlineData(FileAttributes.Compressed)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsInvalidAttributes(FileAttributes attr) { var path = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/File/GetSetTimes.cs b/src/System.IO.FileSystem/tests/File/GetSetTimes.cs index 16949e4903c3..5169053ae522 100644 --- a/src/System.IO.FileSystem/tests/File/GetSetTimes.cs +++ b/src/System.IO.FileSystem/tests/File/GetSetTimes.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -122,7 +121,7 @@ public void CreationSetsAllTimes() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Windows_FileDoesntExist_ReturnDefaultValues() { string path = GetTestFilePath(); @@ -151,7 +150,7 @@ public void Windows_FileDoesntExist_ReturnDefaultValues() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_FileDoesntExist_Throws_FileNotFoundException() { string path = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/File/Move.cs b/src/System.IO.FileSystem/tests/File/Move.cs index 305ab43a0b99..d1380f386e6b 100644 --- a/src/System.IO.FileSystem/tests/File/Move.cs +++ b/src/System.IO.FileSystem/tests/File/Move.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -149,7 +148,7 @@ public void FileNameWithSignificantWhitespace() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void MaxPath_Windows() { // Create a destination path longer than the traditional Windows limit of 256 characters, @@ -178,7 +177,7 @@ public void MaxPath_Windows() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void LongPath() { //Create a destination path longer than the traditional Windows limit of 256 characters @@ -198,7 +197,7 @@ public void LongPath() #region PlatformSpecific [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsPathWithIllegalColons() { FileInfo testFile = new FileInfo(GetTestFilePath()); @@ -210,7 +209,7 @@ public void WindowsPathWithIllegalColons() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsWildCharacterPath() { Assert.Throws(() => Move("*", GetTestFilePath())); @@ -220,7 +219,7 @@ public void WindowsWildCharacterPath() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixWildCharacterPath() { string testDir = GetTestFilePath(); @@ -244,7 +243,7 @@ public void UnixWildCharacterPath() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsWhitespacePath() { FileInfo testFile = new FileInfo(GetTestFilePath()); @@ -255,7 +254,7 @@ public void WindowsWhitespacePath() } [Fact] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixWhitespacePath() { FileInfo testFileSource = new FileInfo(GetTestFilePath()); diff --git a/src/System.IO.FileSystem/tests/FileInfo/Directory.cs b/src/System.IO.FileSystem/tests/FileInfo/Directory.cs index 78c9677fd97a..e7fbd339ccb1 100644 --- a/src/System.IO.FileSystem/tests/FileInfo/Directory.cs +++ b/src/System.IO.FileSystem/tests/FileInfo/Directory.cs @@ -48,7 +48,7 @@ public void DotsInPathAreValid() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void UNCShares() { var directory = Directory(new string(Path.DirectorySeparatorChar, 2) + Path.Combine("Machine", "Directory", "File")); diff --git a/src/System.IO.FileSystem/tests/FileInfo/Exists.cs b/src/System.IO.FileSystem/tests/FileInfo/Exists.cs index 1a3022e035b4..d7b2cd421899 100644 --- a/src/System.IO.FileSystem/tests/FileInfo/Exists.cs +++ b/src/System.IO.FileSystem/tests/FileInfo/Exists.cs @@ -83,7 +83,7 @@ public void FalseForDirectory() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void TrueForNonRegularFile() { string fileName = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/FileInfo/Extension.cs b/src/System.IO.FileSystem/tests/FileInfo/Extension.cs index 167aabf3ebd3..bda0ddceef5d 100644 --- a/src/System.IO.FileSystem/tests/FileInfo/Extension.cs +++ b/src/System.IO.FileSystem/tests/FileInfo/Extension.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -25,7 +24,7 @@ public void ValidExtensions(string fileName, string extension) [Theory] [InlineData(".")] [InlineData("............")] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsInvalidExtensionsAreRemoved(string extension) { string testFile = GetTestFilePath(); @@ -36,7 +35,7 @@ public void WindowsInvalidExtensionsAreRemoved(string extension) [Theory] [InlineData(".s", ".")] [InlineData(".s", ".s....")] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsCurtailTrailingDots(string extension, string trailing) { string testFile = GetTestFilePath(); @@ -48,7 +47,7 @@ public void WindowsCurtailTrailingDots(string extension, string trailing) [Theory] [InlineData(".s", ".")] [InlineData(".s.s....", ".ls")] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixLastDotIsExtension(string extension, string trailing) { string testFile = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/FileInfo/GetSetAttributes.cs b/src/System.IO.FileSystem/tests/FileInfo/GetSetAttributes.cs index 0ec06932211f..c9ec40b4e151 100644 --- a/src/System.IO.FileSystem/tests/FileInfo/GetSetAttributes.cs +++ b/src/System.IO.FileSystem/tests/FileInfo/GetSetAttributes.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -64,7 +63,7 @@ public void IsReadOnly_Set_And_Get() [Theory] [InlineData(FileAttributes.ReadOnly)] [InlineData(FileAttributes.Normal)] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixAttributeSetting(FileAttributes attr) { var test = new FileInfo(GetTestFilePath()); @@ -83,7 +82,7 @@ public void UnixAttributeSetting(FileAttributes attr) [InlineData(FileAttributes.Normal)] [InlineData(FileAttributes.Temporary)] [InlineData(FileAttributes.ReadOnly | FileAttributes.Hidden)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsAttributeSetting(FileAttributes attr) { var test = new FileInfo(GetTestFilePath()); @@ -100,7 +99,7 @@ public void WindowsAttributeSetting(FileAttributes attr) [InlineData(FileAttributes.SparseFile)] [InlineData(FileAttributes.ReparsePoint)] [InlineData(FileAttributes.Compressed)] - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UnixInvalidAttributes(FileAttributes attr) { var path = GetTestFilePath(); @@ -115,7 +114,7 @@ public void UnixInvalidAttributes(FileAttributes attr) [InlineData(FileAttributes.SparseFile)] [InlineData(FileAttributes.ReparsePoint)] [InlineData(FileAttributes.Compressed)] - [PlatformSpecific(XunitPlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void WindowsInvalidAttributes(FileAttributes attr) { var path = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/FileStream/CopyToAsync.cs b/src/System.IO.FileSystem/tests/FileStream/CopyToAsync.cs index d573316f3966..f337dca64ff1 100644 --- a/src/System.IO.FileSystem/tests/FileStream/CopyToAsync.cs +++ b/src/System.IO.FileSystem/tests/FileStream/CopyToAsync.cs @@ -9,7 +9,6 @@ using System.Threading; using System.Threading.Tasks; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -197,7 +196,7 @@ public async Task AnonymousPipeViaFileStream_AllDataCopied(int writeSize, int nu Assert.Equal(expectedData, actualData); } - [PlatformSpecific(XunitPlatformID.Windows)] // Uses P/Invokes to create async pipe handle + [PlatformSpecific(TestPlatforms.Windows)] // Uses P/Invokes to create async pipe handle [Theory] [InlineData(false, 10, 1024)] [InlineData(true, 10, 1024)] @@ -238,7 +237,7 @@ public async Task NamedPipeViaFileStream_AllDataCopied(bool useAsync, int writeS Assert.Equal(expectedData, actualData); } - [PlatformSpecific(XunitPlatformID.Windows)] // Uses P/Invokes to create async pipe handle + [PlatformSpecific(TestPlatforms.Windows)] // Uses P/Invokes to create async pipe handle [Theory] public async Task NamedPipeViaFileStream_CancellationRequested_OperationCanceled() { diff --git a/src/System.IO.FileSystem/tests/FileStream/LockUnlock.cs b/src/System.IO.FileSystem/tests/FileStream/LockUnlock.cs index faf74f39e8d2..e3e13faba2bf 100644 --- a/src/System.IO.FileSystem/tests/FileStream/LockUnlock.cs +++ b/src/System.IO.FileSystem/tests/FileStream/LockUnlock.cs @@ -5,7 +5,6 @@ using System; using System.IO; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -29,7 +28,7 @@ public void InvalidArgs_Throws() } } - [ActiveIssue(5964, XunitPlatformID.AnyUnix)] + [ActiveIssue(5964, TestPlatforms.AnyUnix)] [Fact] public void FileClosed_Throws() { @@ -41,7 +40,7 @@ public void FileClosed_Throws() Assert.Throws(() => fs.Lock(0, 1)); } - [ActiveIssue(5964, XunitPlatformID.AnyUnix)] + [ActiveIssue(5964, TestPlatforms.AnyUnix)] [Theory] [InlineData(100, 0, 100)] [InlineData(200, 0, 100)] @@ -60,7 +59,7 @@ public void Lock_Unlock_Successful(long fileLength, long position, long length) } } - [ActiveIssue(5964, XunitPlatformID.AnyUnix)] + [ActiveIssue(5964, TestPlatforms.AnyUnix)] [Theory] [InlineData(10, 0, 2, 3, 5)] public void NonOverlappingRegions_Success(long fileLength, long firstPosition, long firstLength, long secondPosition, long secondLength) @@ -91,7 +90,7 @@ public void NonOverlappingRegions_Success(long fileLength, long firstPosition, l } } - [ActiveIssue(5964, XunitPlatformID.AnyUnix)] + [ActiveIssue(5964, TestPlatforms.AnyUnix)] [Theory] [InlineData(10, 0, 10, 1, 2)] [InlineData(10, 3, 5, 3, 5)] diff --git a/src/System.IO.FileSystem/tests/FileStream/Pipes.cs b/src/System.IO.FileSystem/tests/FileStream/Pipes.cs index 5946ffb2dafc..e7c91dba9fbc 100644 --- a/src/System.IO.FileSystem/tests/FileStream/Pipes.cs +++ b/src/System.IO.FileSystem/tests/FileStream/Pipes.cs @@ -7,7 +7,6 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -42,7 +41,7 @@ public async Task AnonymousPipeWriteViaFileStream(bool asyncWrites) } } - [PlatformSpecific(XunitPlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public async Task FifoReadWriteViaFileStream() { string fifoPath = GetTestFilePath(); @@ -91,7 +90,7 @@ await client.ReadAsync(arr, 0, 1) : } } - [PlatformSpecific(XunitPlatformID.Windows)] // Uses P/Invokes to create async pipe handle + [PlatformSpecific(TestPlatforms.Windows)] // Uses P/Invokes to create async pipe handle [Theory] [InlineData(true)] [InlineData(false)] @@ -125,7 +124,7 @@ public async Task NamedPipeWriteViaAsyncFileStream(bool asyncWrites) } } - [PlatformSpecific(XunitPlatformID.Windows)] // Uses P/Invokes to create async pipe handle + [PlatformSpecific(TestPlatforms.Windows)] // Uses P/Invokes to create async pipe handle [Theory] [InlineData(true)] [InlineData(false)] diff --git a/src/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs.delete.cs b/src/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs.delete.cs index 8d1133395041..2d4570542952 100644 --- a/src/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs.delete.cs +++ b/src/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs.delete.cs @@ -6,7 +6,6 @@ using System.IO; using System.Runtime.InteropServices; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -86,7 +85,7 @@ public void FileShareDeleteExistingRename() } } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // file sharing restriction limitations on Unix + [PlatformSpecific(TestPlatforms.Windows)] // file sharing restriction limitations on Unix public void FileShareDeleteExistingMultipleClients() { // create the file @@ -120,7 +119,7 @@ public void FileShareDeleteExistingMultipleClients() } [Fact] - [PlatformSpecific(XunitPlatformID.Windows)] // file sharing restriction limitations on Unix + [PlatformSpecific(TestPlatforms.Windows)] // file sharing restriction limitations on Unix public void FileShareWithoutDeleteThrows() { string fileName = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs.read.cs b/src/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs.read.cs index cbc69b03971f..04858b29e00e 100644 --- a/src/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs.read.cs +++ b/src/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs.read.cs @@ -41,7 +41,7 @@ public void FileShareReadExisting() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] // file sharing restriction limitations on Unix + [PlatformSpecific(TestPlatforms.Windows)] // file sharing restriction limitations on Unix public void FileShareWithoutReadThrows() { string fileName = GetTestFilePath(); diff --git a/src/System.IO.FileSystem/tests/FileSystemTest.cs b/src/System.IO.FileSystem/tests/FileSystemTest.cs index 60bbf96bd5e4..d8fd44c10156 100644 --- a/src/System.IO.FileSystem/tests/FileSystemTest.cs +++ b/src/System.IO.FileSystem/tests/FileSystemTest.cs @@ -4,7 +4,6 @@ using System.Runtime.InteropServices; using Xunit; -using XunitPlatformID = Xunit.PlatformID; namespace System.IO.Tests { @@ -12,8 +11,8 @@ public abstract class FileSystemTest : FileCleanupTestBase { public static readonly byte[] TestBuffer = { 0xBA, 0x5E, 0xBA, 0x11, 0xF0, 0x07, 0xBA, 0x11 }; - protected const XunitPlatformID CaseInsensitivePlatforms = XunitPlatformID.Windows | XunitPlatformID.OSX; - protected const XunitPlatformID CaseSensitivePlatforms = XunitPlatformID.AnyUnix & ~XunitPlatformID.OSX; + protected const TestPlatforms CaseInsensitivePlatforms = TestPlatforms.Windows | TestPlatforms.OSX; + protected const TestPlatforms CaseSensitivePlatforms = TestPlatforms.AnyUnix & ~TestPlatforms.OSX; /// /// In some cases (such as when running without elevated privileges), diff --git a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs index ed2cc894786b..cf3635a37ccf 100644 --- a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs +++ b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs @@ -119,7 +119,7 @@ public void FileAccessAndMapAccessCombinations_Valid(FileAccess fileAccess, Memo /// Tests various values of FileAccess used to construct a FileStream and MemoryMappedFileAccess used /// to construct a map over that stream on Windows. The combinations should all be invalid, resulting in exception. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(FileAccess.Read, MemoryMappedFileAccess.ReadWrite)] [InlineData(FileAccess.Read, MemoryMappedFileAccess.ReadExecute)] @@ -146,7 +146,7 @@ public void FileAccessAndMapAccessCombinations_Invalid_Windows(FileAccess fileAc /// Tests various values of FileAccess used to construct a FileStream and MemoryMappedFileAccess used /// to construct a map over that stream on Unix. The combinations should all be invalid, resulting in exception. /// - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [InlineData(FileAccess.Read, MemoryMappedFileAccess.ReadWrite)] [InlineData(FileAccess.Read, MemoryMappedFileAccess.ReadExecute)] @@ -192,7 +192,7 @@ public void InvalidArguments_MapName() /// /// Test to verify that map names are left unsupported on Unix. /// - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [MemberData(nameof(CreateValidMapNames))] public void MapNamesNotSupported_Unix(string mapName) @@ -576,7 +576,7 @@ public void FileAlreadyExists() /// Test exceptional behavior when trying to create a map for a read-write file that's currently in use. /// [Fact] - [PlatformSpecific(PlatformID.Windows)] // FileShare is limited on Unix, with None == exclusive, everything else == concurrent + [PlatformSpecific(TestPlatforms.Windows)] // FileShare is limited on Unix, with None == exclusive, everything else == concurrent public void FileInUse_CreateFromFile_FailsWithExistingReadWriteFile() { // Already opened with a FileStream @@ -591,7 +591,7 @@ public void FileInUse_CreateFromFile_FailsWithExistingReadWriteFile() /// Test exceptional behavior when trying to create a map for a non-shared file that's currently in use. /// [Fact] - [PlatformSpecific(PlatformID.Windows)] // FileShare is limited on Unix, with None == exclusive, everything else == concurrent + [PlatformSpecific(TestPlatforms.Windows)] // FileShare is limited on Unix, with None == exclusive, everything else == concurrent public void FileInUse_CreateFromFile_FailsWithExistingReadWriteMap() { // Already opened with another read-write map @@ -636,7 +636,7 @@ public void FileInUse_CreateFromFile_SucceedsWithReadOnly() /// /// Test the exceptional behavior of *Execute access levels. /// - [PlatformSpecific(PlatformID.Windows)] // Unix model for executable differs from Windows + [PlatformSpecific(TestPlatforms.Windows)] // Unix model for executable differs from Windows [Theory] [InlineData(MemoryMappedFileAccess.ReadExecute)] [InlineData(MemoryMappedFileAccess.ReadWriteExecute)] @@ -813,7 +813,7 @@ public void FileSizeExpandsToCapacity() /// /// Test the exceptional behavior when attempting to create a map so large it's not supported. /// - [PlatformSpecific(~PlatformID.OSX)] // Because of the file-based backing, OS X pops up a warning dialog about being out-of-space (even though we clean up immediately) + [PlatformSpecific(~TestPlatforms.OSX)] // Because of the file-based backing, OS X pops up a warning dialog about being out-of-space (even though we clean up immediately) [Fact] public void TooLargeCapacity() { @@ -836,7 +836,7 @@ public void TooLargeCapacity() /// Test to verify map names are handled appropriately, causing a conflict when they're active but /// reusable in a sequential manner. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [MemberData(nameof(CreateValidMapNames))] public void ReusingNames_Windows(string name) diff --git a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateNew.Tests.cs b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateNew.Tests.cs index db8fe7ee7efc..b4b5c10a5da6 100644 --- a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateNew.Tests.cs +++ b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateNew.Tests.cs @@ -87,7 +87,7 @@ public void InvalidArguments_Inheritability(HandleInheritability inheritability) /// /// Test the exceptional behavior when attempting to create a map so large it's not supported. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void TooLargeCapacity_Windows() { @@ -104,7 +104,7 @@ public void TooLargeCapacity_Windows() /// /// Test the exceptional behavior when attempting to create a map so large it's not supported. /// - [PlatformSpecific(PlatformID.AnyUnix & ~PlatformID.OSX)] // Because of the file-based backing, OS X pops up a warning dialog about being out-of-space (even though we clean up immediately) + [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.OSX)] // Because of the file-based backing, OS X pops up a warning dialog about being out-of-space (even though we clean up immediately) [Fact] public void TooLargeCapacity_Unix() { @@ -125,7 +125,7 @@ public void TooLargeCapacity_Unix() /// /// Test to verify that map names are left unsupported on Unix. /// - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [MemberData(nameof(CreateValidMapNames))] public void MapNamesNotSupported_Unix(string mapName) @@ -138,7 +138,7 @@ public void MapNamesNotSupported_Unix(string mapName) /// /// Test to verify a variety of map names work correctly on Windows. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [MemberData(nameof(CreateValidMapNames))] [InlineData(null)] @@ -162,7 +162,7 @@ public void ValidMapNames_Windows(string name) /// Test to verify map names are handled appropriately, causing a conflict when they're active but /// reusable in a sequential manner. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [MemberData(nameof(CreateValidMapNames))] public void ReusingNames_Windows(string name) @@ -254,7 +254,7 @@ public static IEnumerable MemberData_ValidArgumentCombinations( /// /// Test to verify that two unrelated maps don't share data. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [MemberData(nameof(CreateValidMapNames))] [InlineData(null)] @@ -307,7 +307,7 @@ public void ManyConcurrentMaps() /// /// Test to verify expected capacity with regards to page size and automatically rounding up to the nearest. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void RoundedUpCapacity_Windows() { @@ -326,7 +326,7 @@ public void RoundedUpCapacity_Windows() /// /// Test to verify expected capacity with regards to page size and automatically rounding up to the nearest. /// - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void RoundedUpCapacity_Unix() { diff --git a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateOrOpen.Tests.cs b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateOrOpen.Tests.cs index 1157be80c0ee..fcda65ce2272 100644 --- a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateOrOpen.Tests.cs +++ b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateOrOpen.Tests.cs @@ -29,7 +29,7 @@ public void InvalidArguments_MapName() /// /// Test to verify that map names are left unsupported on Unix. /// - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [MemberData(nameof(CreateValidMapNames))] public void MapNamesNotSupported_Unix(string mapName) @@ -105,7 +105,7 @@ public void InvalidArgument_Inheritability(HandleInheritability inheritability) /// Test various combinations of arguments to CreateOrOpen, validating the created maps each time they're created, /// focusing on accesses that don't involve execute permissions. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [MemberData(nameof(MemberData_ValidArgumentCombinations), new string[] { "CreateUniqueMapName()" }, @@ -166,7 +166,7 @@ public void ValidArgumentCombinations_NonExecute( /// Test various combinations of arguments to CreateOrOpen, validating the created maps each time they're created, /// focusing on accesses that involve execute permissions. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [MemberData(nameof(MemberData_ValidArgumentCombinations), new string[] { "CreateUniqueMapName()" }, @@ -251,7 +251,7 @@ public static IEnumerable MemberData_ValidArgumentCombinations( /// /// Test to validate behavior with MemoryMappedFileAccess.Write. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenWrite() { @@ -272,7 +272,7 @@ public void OpenWrite() /// /// Test the exceptional behavior when attempting to create a map so large it's not supported. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void TooLargeCapacity() { @@ -290,7 +290,7 @@ public void TooLargeCapacity() /// Test that the capacity of a view matches the original capacity, not that specified when opening the new map, /// and that the original capacity doesn't change from opening another map with a different capacity. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenedCapacityMatchesOriginal() { @@ -328,7 +328,7 @@ public void OpenedCapacityMatchesOriginal() } } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenedAccessibilityLimitedToOriginal() { @@ -348,7 +348,7 @@ public void OpenedAccessibilityLimitedToOriginal() } } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenedAccessibilityLimitedBeyondOriginal() { diff --git a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.OpenExisting.Tests.cs b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.OpenExisting.Tests.cs index ac4b056fa0d1..03823e6e9839 100644 --- a/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.OpenExisting.Tests.cs +++ b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.OpenExisting.Tests.cs @@ -25,7 +25,7 @@ public void InvalidArguments_Name() /// /// Test to verify that map names are left unsupported on Unix. /// - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [MemberData(nameof(CreateValidMapNames))] public void MapNamesNotSupported_Unix(string mapName) @@ -38,7 +38,7 @@ public void MapNamesNotSupported_Unix(string mapName) /// /// Test to verify that non-existent map names result in exceptions. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void InvalidArguments_Name_NonExistent() { @@ -73,7 +73,7 @@ public void InvalidArguments_Rights() /// /// Test various combinations of arguments to Open, opening maps created by CreateNew. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [MemberData(nameof(MemberData_OpenCreated))] public void OpenCreatedNew(string mapName, MemoryMappedFileRights desiredAccessRights, HandleInheritability inheritability) @@ -106,7 +106,7 @@ public void OpenCreatedNew(string mapName, MemoryMappedFileRights desiredAccessR /// /// Test various combinations of arguments to Open, opening maps created by CreateFromFile. /// - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [MemberData(nameof(MemberData_OpenCreated))] public void OpenCreatedFromFile(string name, MemoryMappedFileRights rights, HandleInheritability inheritability) diff --git a/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs b/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs index f38d72c47e83..45d513a15984 100644 --- a/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs +++ b/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs @@ -80,7 +80,7 @@ public static void ClonedClient_ActsAsOriginalClient() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/1012 - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public static void Linux_BufferSizeRoundtrips() { // On Linux, setting the buffer size of the server will also set the buffer size of the @@ -109,7 +109,7 @@ public static void Linux_BufferSizeRoundtrips() } [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public static void OSX_BufferSizeNotSupported() { int desiredBufferSize = 10; @@ -122,7 +122,7 @@ public static void OSX_BufferSizeNotSupported() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void Windows_BufferSizeRoundtripping() { // On Windows, setting the buffer size of the server will only set diff --git a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs index e23256ce43a3..b370c0c6fbb0 100644 --- a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs +++ b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs @@ -67,7 +67,7 @@ public static void ReservedPipeName_Throws_ArgumentOutOfRangeException(PipeDirec } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void NotSupportedPipePath_Throws_PlatformNotSupportedException() { string hostName; diff --git a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs index d5f29af8976a..16448e4ac1d1 100644 --- a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs +++ b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateServer.cs @@ -44,7 +44,7 @@ public static void ZeroLengthPipeName_Throws_ArgumentException(PipeDirection dir [InlineData(PipeDirection.In)] [InlineData(PipeDirection.InOut)] [InlineData(PipeDirection.Out)] - [PlatformSpecific(PlatformID.Windows)] // "anonymous" only reserved on Windows + [PlatformSpecific(TestPlatforms.Windows)] // "anonymous" only reserved on Windows public static void ReservedPipeName_Throws_ArgumentOutOfRangeException(PipeDirection direction) { const string reservedName = "anonymous"; @@ -68,7 +68,7 @@ public static void Create_PipeName_Direction_MaxInstances() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // can't access SafePipeHandle on Unix until after connection created + [PlatformSpecific(TestPlatforms.Windows)] // can't access SafePipeHandle on Unix until after connection created public static void CreateWithNegativeOneServerInstances_DefaultsToMaxServerInstances() { // When passed -1 as the maxnumberofserverisntances, the NamedPipeServerStream.Windows class @@ -194,7 +194,7 @@ public static void BadHandleKind_Throws_IOException(PipeDirection direction) [InlineData(PipeDirection.In)] [InlineData(PipeDirection.InOut)] [InlineData(PipeDirection.Out)] - [PlatformSpecific(PlatformID.Windows)] // accessing SafePipeHandle on Unix fails for a non-connected stream + [PlatformSpecific(TestPlatforms.Windows)] // accessing SafePipeHandle on Unix fails for a non-connected stream public static void Windows_CreateFromDisposedServerHandle_Throws_ObjectDisposedException(PipeDirection direction) { // The pipe is closed when we try to make a new Stream with it @@ -205,7 +205,7 @@ public static void Windows_CreateFromDisposedServerHandle_Throws_ObjectDisposedE } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void Unix_GetHandleOfNewServerStream_Throws_InvalidOperationException() { using (var pipe = new NamedPipeServerStream(GetUniquePipeName(), PipeDirection.Out, 1, PipeTransmissionMode.Byte)) @@ -218,7 +218,7 @@ public static void Unix_GetHandleOfNewServerStream_Throws_InvalidOperationExcept [InlineData(PipeDirection.In)] [InlineData(PipeDirection.InOut)] [InlineData(PipeDirection.Out)] - [PlatformSpecific(PlatformID.Windows)] // accessing SafePipeHandle on Unix fails for a non-connected stream + [PlatformSpecific(TestPlatforms.Windows)] // accessing SafePipeHandle on Unix fails for a non-connected stream public static void Windows_CreateFromAlreadyBoundHandle_Throws_ArgumentException(PipeDirection direction) { // The pipe is already bound @@ -229,7 +229,7 @@ public static void Windows_CreateFromAlreadyBoundHandle_Throws_ArgumentException } [Fact] - [PlatformSpecific(PlatformID.Windows)] // NumberOfServerInstances > 1 isn't supported and has undefined behavior on Unix + [PlatformSpecific(TestPlatforms.Windows)] // NumberOfServerInstances > 1 isn't supported and has undefined behavior on Unix public static void ServerCountOverMaxServerInstances_Throws_IOException() { string uniqueServerName = GetUniquePipeName(); @@ -240,7 +240,7 @@ public static void ServerCountOverMaxServerInstances_Throws_IOException() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // NumberOfServerInstances > 1 isn't supported and has undefined behavior on Unix + [PlatformSpecific(TestPlatforms.Windows)] // NumberOfServerInstances > 1 isn't supported and has undefined behavior on Unix public static void Windows_ServerCloneWithDifferentDirection_Throws_UnauthorizedAccessException() { string uniqueServerName = GetUniquePipeName(); diff --git a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Simple.cs b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Simple.cs index 3ff5ec8dc840..52b701dc6927 100644 --- a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Simple.cs +++ b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Simple.cs @@ -238,7 +238,7 @@ public async Task CancelTokenOn_ServerWaitForConnectionAsync_Throws_OperationCan } [Fact] - [PlatformSpecific(PlatformID.Windows)] // P/Invoking to Win32 functions + [PlatformSpecific(TestPlatforms.Windows)] // P/Invoking to Win32 functions public async Task CancelTokenOff_ServerWaitForConnectionAsyncWithOuterCancellation_Throws_OperationCanceledException() { using (NamedPipePair pair = CreateNamedPipePair()) @@ -253,7 +253,7 @@ public async Task CancelTokenOff_ServerWaitForConnectionAsyncWithOuterCancellati } [Fact] - [PlatformSpecific(PlatformID.Windows)] // P/Invoking to Win32 functions + [PlatformSpecific(TestPlatforms.Windows)] // P/Invoking to Win32 functions public async Task CancelTokenOn_ServerWaitForConnectionAsyncWithOuterCancellation_Throws_IOException() { using (NamedPipePair pair = CreateNamedPipePair()) @@ -350,7 +350,7 @@ public virtual async Task OperationsOnDisconnectedClient() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // Unix implemented on sockets, where disposal information doesn't propagate + [PlatformSpecific(TestPlatforms.Windows)] // Unix implemented on sockets, where disposal information doesn't propagate public async Task Windows_OperationsOnNamedServerWithDisposedClient() { using (NamedPipePair pair = CreateNamedPipePair()) @@ -366,7 +366,7 @@ public async Task Windows_OperationsOnNamedServerWithDisposedClient() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/1011 - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public async Task Unix_OperationsOnNamedServerWithDisposedClient() { using (NamedPipePair pair = CreateNamedPipePair()) @@ -500,7 +500,7 @@ public async Task ReadAsync_DisconnectDuringRead_Returns0() } } - [PlatformSpecific(PlatformID.Windows)] // Unix named pipes are on sockets, where small writes with an empty buffer will succeed immediately + [PlatformSpecific(TestPlatforms.Windows)] // Unix named pipes are on sockets, where small writes with an empty buffer will succeed immediately [Fact] public async Task WriteAsync_DisconnectDuringWrite_Throws() { @@ -561,7 +561,7 @@ public async Task Server_ReadWriteCancelledToken_Throws_OperationCanceledExcepti } [Fact] - [PlatformSpecific(PlatformID.Windows)] // P/Invoking to Win32 functions + [PlatformSpecific(TestPlatforms.Windows)] // P/Invoking to Win32 functions public async Task CancelTokenOff_Server_ReadWriteCancelledToken_Throws_OperationCanceledException() { using (NamedPipePair pair = CreateNamedPipePair()) @@ -591,7 +591,7 @@ public async Task CancelTokenOff_Server_ReadWriteCancelledToken_Throws_Operation } [Fact] - [PlatformSpecific(PlatformID.Windows)] // P/Invoking to Win32 functions + [PlatformSpecific(TestPlatforms.Windows)] // P/Invoking to Win32 functions public async Task CancelTokenOn_Server_ReadWriteCancelledToken_Throws_IOException() { using (NamedPipePair pair = CreateNamedPipePair()) @@ -657,7 +657,7 @@ public async Task Client_ReadWriteCancelledToken_Throws_OperationCanceledExcepti } [Fact] - [PlatformSpecific(PlatformID.Windows)] // P/Invoking to Win32 functions + [PlatformSpecific(TestPlatforms.Windows)] // P/Invoking to Win32 functions public async Task CancelTokenOff_Client_ReadWriteCancelledToken_Throws_OperationCanceledException() { using (NamedPipePair pair = CreateNamedPipePair()) @@ -686,7 +686,7 @@ public async Task CancelTokenOff_Client_ReadWriteCancelledToken_Throws_Operation } [Fact] - [PlatformSpecific(PlatformID.Windows)] // P/Invoking to Win32 functions + [PlatformSpecific(TestPlatforms.Windows)] // P/Invoking to Win32 functions public async Task CancelTokenOn_Client_ReadWriteCancelledToken_Throws_IOException() { using (NamedPipePair pair = CreateNamedPipePair()) diff --git a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs index 052c2ac18b35..50b4226f2357 100644 --- a/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs +++ b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs @@ -55,7 +55,7 @@ public async Task CancelConnectToNonExistentServer_Throws_OperationCanceledExcep } [Fact] - [PlatformSpecific(PlatformID.Windows)] // Unix implementation uses bidirectional sockets + [PlatformSpecific(TestPlatforms.Windows)] // Unix implementation uses bidirectional sockets public void ConnectWithConflictingDirections_Throws_UnauthorizedAccessException() { string serverName1 = GetUniquePipeName(); @@ -78,7 +78,7 @@ public void ConnectWithConflictingDirections_Throws_UnauthorizedAccessException( [Theory] [InlineData(PipeOptions.None)] [InlineData(PipeOptions.Asynchronous)] - [PlatformSpecific(PlatformID.Windows)] // Unix currently doesn't support message mode + [PlatformSpecific(TestPlatforms.Windows)] // Unix currently doesn't support message mode public async Task Windows_MessagePipeTransissionMode(PipeOptions serverOptions) { byte[] msg1 = new byte[] { 5, 7, 9, 10 }; @@ -167,7 +167,7 @@ public async Task Windows_MessagePipeTransissionMode(PipeOptions serverOptions) } [Fact] - [PlatformSpecific(PlatformID.Windows)] // Unix doesn't support MaxNumberOfServerInstances + [PlatformSpecific(TestPlatforms.Windows)] // Unix doesn't support MaxNumberOfServerInstances public async Task Windows_Get_NumberOfServerInstances_Succeed() { string pipeName = GetUniquePipeName(); @@ -189,7 +189,7 @@ public async Task Windows_Get_NumberOfServerInstances_Succeed() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // Win32 P/Invokes to verify the user name + [PlatformSpecific(TestPlatforms.Windows)] // Win32 P/Invokes to verify the user name public async Task Windows_GetImpersonationUserName_Succeed() { string pipeName = GetUniquePipeName(); @@ -211,7 +211,7 @@ public async Task Windows_GetImpersonationUserName_Succeed() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/1011 - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public async Task Unix_GetImpersonationUserName_Succeed() { string pipeName = GetUniquePipeName(); @@ -231,7 +231,7 @@ public async Task Unix_GetImpersonationUserName_Succeed() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_MessagePipeTransissionMode() { Assert.Throws(() => new NamedPipeServerStream(GetUniquePipeName(), PipeDirection.InOut, 1, PipeTransmissionMode.Message)); @@ -241,7 +241,7 @@ public void Unix_MessagePipeTransissionMode() [InlineData(PipeDirection.In)] [InlineData(PipeDirection.Out)] [InlineData(PipeDirection.InOut)] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void Unix_BufferSizeRoundtripping(PipeDirection direction) { int desiredBufferSize = 0; @@ -276,7 +276,7 @@ public static void Unix_BufferSizeRoundtripping(PipeDirection direction) } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void Windows_BufferSizeRoundtripping() { int desiredBufferSize = 10; @@ -315,7 +315,7 @@ public void PipeTransmissionMode_Returns_Byte() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // Unix doesn't currently support message mode + [PlatformSpecific(TestPlatforms.Windows)] // Unix doesn't currently support message mode public void Windows_SetReadModeTo__PipeTransmissionModeByte() { string pipeName = GetUniquePipeName(); @@ -356,7 +356,7 @@ public void Windows_SetReadModeTo__PipeTransmissionModeByte() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_SetReadModeTo__PipeTransmissionModeByte() { string pipeName = GetUniquePipeName(); @@ -413,7 +413,7 @@ public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection ser } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void NameTooLong_MaxLengthPerPlatform() { // Increase a name's length until it fails diff --git a/src/System.Net.Http/tests/FunctionalTests/CancellationTest.cs b/src/System.Net.Http/tests/FunctionalTests/CancellationTest.cs index a5b4c7239798..56e891f9451d 100644 --- a/src/System.Net.Http/tests/FunctionalTests/CancellationTest.cs +++ b/src/System.Net.Http/tests/FunctionalTests/CancellationTest.cs @@ -76,7 +76,7 @@ await Assert.ThrowsAnyAsync(async () => } } - [ActiveIssue(9075, PlatformID.AnyUnix)] // recombine this test into the subsequent one when issue is fixed + [ActiveIssue(9075, TestPlatforms.AnyUnix)] // recombine this test into the subsequent one when issue is fixed [OuterLoop] // includes seconds of delay [Fact] public Task ReadAsStreamAsync_ReadAsync_Cancel_BodyNeverStarted_TaskCanceledQuickly() diff --git a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ClientCertificates.cs b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ClientCertificates.cs index ffce048f8f11..63579846e940 100644 --- a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ClientCertificates.cs +++ b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ClientCertificates.cs @@ -69,7 +69,7 @@ public async Task Manual_SSLBackendNotSupported_ThrowsPlatformNotSupportedExcept } [OuterLoop] // TODO: Issue #11345 - [ActiveIssue(9543, PlatformID.Windows)] // reuseClient==false fails in debug/release, reuseClient==true fails sporadically in release + [ActiveIssue(9543, TestPlatforms.Windows)] // reuseClient==false fails in debug/release, reuseClient==true fails sporadically in release [ConditionalTheory(nameof(BackendSupportsCustomCertificateHandling))] [InlineData(6, false)] [InlineData(3, true)] diff --git a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.DefaultProxyCredentials.cs b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.DefaultProxyCredentials.cs index fa8b28c7db4a..b1d4fcb8530a 100644 --- a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.DefaultProxyCredentials.cs +++ b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.DefaultProxyCredentials.cs @@ -66,7 +66,7 @@ public void ProxyExplicitlyProvided_DefaultCredentials_Ignored() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] // proxies set via the http_proxy environment variable are specific to Unix + [PlatformSpecific(TestPlatforms.AnyUnix)] // proxies set via the http_proxy environment variable are specific to Unix public void ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed() { int port; diff --git a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.cs b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.cs index 0ec528e3c7ae..57c31fa97386 100644 --- a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.cs +++ b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.cs @@ -37,7 +37,7 @@ public async Task NoCallback_ValidCertificate_CallbackNotCalled() [OuterLoop] // TODO: Issue #11345 [ConditionalFact(nameof(BackendSupportsCustomCertificateHandling))] - [ActiveIssue(12015, PlatformID.AnyUnix)] + [ActiveIssue(12015, TestPlatforms.AnyUnix)] public void UseCallback_HaveNoCredsAndUseAuthenticatedCustomProxyAndPostToSecureServer_ProxyAuthenticationRequiredStatusCode() { int port; @@ -197,7 +197,7 @@ public async Task NoCallback_RevokedCertificate_RevocationChecking_Fails() }; [OuterLoop] // TODO: Issue #11345 - [ActiveIssue(7812, PlatformID.Windows)] + [ActiveIssue(7812, TestPlatforms.Windows)] [ConditionalTheory(nameof(BackendSupportsCustomCertificateHandling))] [MemberData(nameof(CertificateValidationServersAndExpectedPolicies))] public async Task UseCallback_BadCertificate_ExpectedPolicyErrors(string url, SslPolicyErrors expectedErrors) @@ -247,7 +247,7 @@ public async Task SSLBackendNotSupported_Revocation_ThrowsPlatformNotSupportedEx } [OuterLoop] // TODO: Issue #11345 - [PlatformSpecific(PlatformID.Windows)] // CopyToAsync(Stream, TransportContext) isn't used on unix + [PlatformSpecific(TestPlatforms.Windows)] // CopyToAsync(Stream, TransportContext) isn't used on unix [Fact] public async Task PostAsync_Post_ChannelBinding_ConfiguredCorrectly() { diff --git a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs index 25d988e3d2bd..7e193dea0b71 100644 --- a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs +++ b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs @@ -191,7 +191,7 @@ await TestHelper.WhenAllCompletedOrAnyFailed( } [OuterLoop] // TODO: Issue #11345 - [ActiveIssue(8538, PlatformID.Windows)] + [ActiveIssue(8538, TestPlatforms.Windows)] [Fact] public async Task GetAsync_DisallowTls10_AllowTls11_AllowTls12() { diff --git a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs index f7d9ea76dd65..e7f55cf4c4c5 100644 --- a/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs +++ b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs @@ -494,7 +494,7 @@ public async Task GetAsync_AllowAutoRedirectTrue_RedirectToUriWithParams_Request } [OuterLoop] // TODO: Issue #11345 - [ActiveIssue(8945, PlatformID.Windows)] + [ActiveIssue(8945, TestPlatforms.Windows)] [Theory] [InlineData(3, 2)] [InlineData(3, 3)] @@ -583,7 +583,7 @@ await LoopbackServer.ReadRequestAndSendResponseAsync(origServer, [OuterLoop] // TODO: Issue #11345 [Theory] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [InlineData("#origFragment", "", "#origFragment", false)] [InlineData("#origFragment", "", "#origFragment", true)] [InlineData("", "#redirFragment", "#redirFragment", false)] @@ -1347,7 +1347,7 @@ await LoopbackServer.AcceptSocketAsync(server, async (s, stream, reader, writer) { Assert.False(contentDisposed, "Expected request content to not be disposed while request data still being sent"); } - else // [ActiveIssue(9006, PlatformID.AnyUnix)] + else // [ActiveIssue(9006, TestPlatforms.AnyUnix)] { await post; Assert.True(contentDisposed, "Current implementation will dispose of the request content once response headers arrive"); @@ -1423,7 +1423,7 @@ public async Task GetAsync_CallMethod_ExpectedStatusLine(HttpStatusCode statusCo } [OuterLoop] // TODO: Issue #11345 - [PlatformSpecific(PlatformID.Windows)] // CopyToAsync(Stream, TransportContext) isn't used on unix + [PlatformSpecific(TestPlatforms.Windows)] // CopyToAsync(Stream, TransportContext) isn't used on unix [Fact] public async Task PostAsync_Post_ChannelBindingHasExpectedValue() { @@ -1548,7 +1548,7 @@ public async Task SendAsync_SendRequestUsingNoBodyMethodToEchoServerWithContent_ { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && method == "TRACE") { - // [ActiveIssue(9023, PlatformID.Windows)] + // [ActiveIssue(9023, TestPlatforms.Windows)] Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); } else @@ -1592,7 +1592,7 @@ public async Task SendAsync_RequestVersionNotSpecified_ServerReceivesVersion11Re [OuterLoop] // TODO: Issue #11345 [Theory, MemberData(nameof(Http2Servers))] - [ActiveIssue(10958, PlatformID.Windows)] + [ActiveIssue(10958, TestPlatforms.Windows)] public async Task SendAsync_RequestVersion20_ResponseVersion20IfHttp2Supported(Uri server) { // We don't currently have a good way to test whether HTTP/2 is supported without diff --git a/src/System.Net.Http/tests/FunctionalTests/PostScenarioTest.cs b/src/System.Net.Http/tests/FunctionalTests/PostScenarioTest.cs index 8eaab5c8741d..14505ca240cb 100644 --- a/src/System.Net.Http/tests/FunctionalTests/PostScenarioTest.cs +++ b/src/System.Net.Http/tests/FunctionalTests/PostScenarioTest.cs @@ -60,7 +60,7 @@ public async Task PostEmptyContentUsingContentLengthSemantics_Success(Uri server } [OuterLoop] // TODO: Issue #11345 - [ActiveIssue(5485, PlatformID.Windows)] + [ActiveIssue(5485, TestPlatforms.Windows)] [Theory, MemberData(nameof(EchoServers))] public async Task PostEmptyContentUsingChunkedEncoding_Success(Uri serverUri) { diff --git a/src/System.Net.Http/tests/FunctionalTests/SchSendAuxRecordHttpTest.cs b/src/System.Net.Http/tests/FunctionalTests/SchSendAuxRecordHttpTest.cs index ab61b3929bff..0284be6abc33 100644 --- a/src/System.Net.Http/tests/FunctionalTests/SchSendAuxRecordHttpTest.cs +++ b/src/System.Net.Http/tests/FunctionalTests/SchSendAuxRecordHttpTest.cs @@ -24,7 +24,7 @@ public SchSendAuxRecordHttpTest(ITestOutputHelper output) [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public async Task HttpClient_ClientUsesAuxRecord_Ok() { X509Certificate2 serverCert = Configuration.Certificates.GetServerCertificate(); diff --git a/src/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs b/src/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs index 4dd0ac6f1041..8d8c9724bdbc 100644 --- a/src/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs +++ b/src/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs @@ -86,7 +86,7 @@ public static IEnumerable GetNoneAddresses() yield return new object[] { IPAddress.None }; } - [ActiveIssue(10345, PlatformID.AnyUnix)] + [ActiveIssue(10345, TestPlatforms.AnyUnix)] [Theory] [MemberData(nameof(GetNoneAddresses))] public async Task Dns_GetHostEntryAsync_NoneIPAddress_Fail(IPAddress address) diff --git a/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs b/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs index 720a404bd5c7..8168f8d7aec5 100644 --- a/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs +++ b/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs @@ -154,7 +154,7 @@ public void TryGetAddrInfo_LocalHost_TryGetNameInfo() Assert.NotNull(name); } - [ActiveIssue(10764, PlatformID.AnyUnix)] + [ActiveIssue(10764, TestPlatforms.AnyUnix)] [Fact] public void TryGetAddrInfo_HostName_TryGetNameInfo() { diff --git a/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Linux.cs b/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Linux.cs index 5c1180bb6bca..522ddb15dc61 100644 --- a/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Linux.cs +++ b/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Linux.cs @@ -10,7 +10,7 @@ namespace System.Net.NetworkInformation.Tests { - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public class IPInterfacePropertiesTest_Linux { private readonly ITestOutputHelper _log; diff --git a/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_OSX.cs b/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_OSX.cs index 89a93611ce66..6dccea24fd91 100644 --- a/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_OSX.cs +++ b/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_OSX.cs @@ -10,7 +10,7 @@ namespace System.Net.NetworkInformation.Tests { - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public class IPInterfacePropertiesTest_OSX { private readonly ITestOutputHelper _log; diff --git a/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Windows.cs b/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Windows.cs index 6eb7d440aae5..bbe279cf2f3b 100644 --- a/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Windows.cs +++ b/src/System.Net.NetworkInformation/tests/FunctionalTests/IPInterfacePropertiesTest_Windows.cs @@ -10,7 +10,7 @@ namespace System.Net.NetworkInformation.Tests { - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public class IPInterfacePropertiesTest_Windows { private readonly ITestOutputHelper _log; diff --git a/src/System.Net.NetworkInformation/tests/FunctionalTests/NetworkInterfaceBasicTest.cs b/src/System.Net.NetworkInformation/tests/FunctionalTests/NetworkInterfaceBasicTest.cs index 29de04c96701..fc82b1900216 100644 --- a/src/System.Net.NetworkInformation/tests/FunctionalTests/NetworkInterfaceBasicTest.cs +++ b/src/System.Net.NetworkInformation/tests/FunctionalTests/NetworkInterfaceBasicTest.cs @@ -27,7 +27,7 @@ public void BasicTest_GetNetworkInterfaces_AtLeastOne() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BasicTest_AccessInstanceProperties_NoExceptions() { foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) @@ -51,7 +51,7 @@ public void BasicTest_AccessInstanceProperties_NoExceptions() } [Fact] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void BasicTest_AccessInstanceProperties_NoExceptions_Linux() { foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) @@ -85,7 +85,7 @@ public void BasicTest_AccessInstanceProperties_NoExceptions_Linux() } [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void BasicTest_AccessInstanceProperties_NoExceptions_Osx() { foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) @@ -172,7 +172,7 @@ public void BasicTest_StaticIPv6LoopbackIndex_ExceptionIfV6NotSupported() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BasicTest_GetIPInterfaceStatistics_Success() { foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) @@ -196,7 +196,7 @@ public void BasicTest_GetIPInterfaceStatistics_Success() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BasicTest_GetIPv4InterfaceStatistics_Success() { // This API is not actually IPv4 specific. @@ -221,7 +221,7 @@ public void BasicTest_GetIPv4InterfaceStatistics_Success() } [Fact] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void BasicTest_GetIPInterfaceStatistics_Success_Linux() { foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) @@ -245,7 +245,7 @@ public void BasicTest_GetIPInterfaceStatistics_Success_Linux() } [Fact] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void BasicTest_GetIPv4InterfaceStatistics_Success_Linux() { // This API is not actually IPv4 specific. @@ -270,7 +270,7 @@ public void BasicTest_GetIPv4InterfaceStatistics_Success_Linux() } [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void BasicTest_GetIPInterfaceStatistics_Success_OSX() { foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) @@ -294,7 +294,7 @@ public void BasicTest_GetIPInterfaceStatistics_Success_OSX() } [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void BasicTest_GetIPv4InterfaceStatistics_Success_OSX() { // This API is not actually IPv4 specific. @@ -325,7 +325,7 @@ public void BasicTest_GetIsNetworkAvailable_Success() } [ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] [InlineData(false)] [InlineData(true)] public async Task NetworkInterface_LoopbackInterfaceIndex_MatchesReceivedPackets(bool ipv6) diff --git a/src/System.Net.Ping/tests/FunctionalTests/PingTest.cs b/src/System.Net.Ping/tests/FunctionalTests/PingTest.cs index a6886a12f831..47e30a2d09e0 100644 --- a/src/System.Net.Ping/tests/FunctionalTests/PingTest.cs +++ b/src/System.Net.Ping/tests/FunctionalTests/PingTest.cs @@ -122,7 +122,7 @@ await SendBatchPingAsync( }); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public async Task SendPingAsyncWithIPAddressAndTimeoutAndBuffer() { @@ -140,7 +140,7 @@ await SendBatchPingAsync( }); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public async Task SendPingAsyncWithIPAddressAndTimeoutAndBuffer_Unix() { @@ -166,7 +166,7 @@ await SendBatchPingAsync( }); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public async Task SendPingAsyncWithIPAddressAndTimeoutAndBufferAndPingOptions() { @@ -185,7 +185,7 @@ await SendBatchPingAsync( }); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public async Task SendPingAsyncWithIPAddressAndTimeoutAndBufferAndPingOptions_Unix() { @@ -239,7 +239,7 @@ await SendBatchPingAsync( }); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public async Task SendPingAsyncWithHostAndTimeoutAndBuffer() { @@ -257,7 +257,7 @@ await SendBatchPingAsync( }); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public async Task SendPingAsyncWithHostAndTimeoutAndBuffer_Unix() { @@ -283,7 +283,7 @@ await SendBatchPingAsync( }); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public async Task SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions() { @@ -301,7 +301,7 @@ await SendBatchPingAsync( }); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public async Task SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions_Unix() { diff --git a/src/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs b/src/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs index b1fa97b76d5e..6ff6e656a36c 100644 --- a/src/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs +++ b/src/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs @@ -22,7 +22,7 @@ public class UnixPingUtilityTests [InlineData(1)] [InlineData(50)] [InlineData(1000)] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static async Task PacketSizeIsRespected(int payloadSize) { IPAddress localAddress = await TestSettings.GetLocalIPAddress(); diff --git a/src/System.Net.Primitives/tests/FunctionalTests/IPAddressParsing.cs b/src/System.Net.Primitives/tests/FunctionalTests/IPAddressParsing.cs index c868ff3ce305..78f8a70e63ef 100644 --- a/src/System.Net.Primitives/tests/FunctionalTests/IPAddressParsing.cs +++ b/src/System.Net.Primitives/tests/FunctionalTests/IPAddressParsing.cs @@ -98,7 +98,7 @@ public void ParseIPv4_InvalidHex_Failure(string address) } [Theory] - [PlatformSpecific(~PlatformID.OSX)] // There doesn't appear to be an OSX API that will fail for these + [PlatformSpecific(~TestPlatforms.OSX)] // There doesn't appear to be an OSX API that will fail for these [InlineData("0x.1.1.1")] // Empty leading hex segment public void ParseIPv4_InvalidHex_Failure_NonOSX(string address) { @@ -106,7 +106,7 @@ public void ParseIPv4_InvalidHex_Failure_NonOSX(string address) } [Theory] - [ActiveIssue(8362, PlatformID.OSX)] + [ActiveIssue(8362, TestPlatforms.OSX)] [InlineData("0.0.0.089")] // Octal (leading zero) but with 8 or 9 public void ParseIPv4_InvalidOctal_Failure(string address) { @@ -124,7 +124,7 @@ public void ParseIPv4_InvalidValue_Failure(string address) } [Theory] - [PlatformSpecific(~PlatformID.OSX)] // There does't appear to be an OSX API that will fail for these + [PlatformSpecific(~TestPlatforms.OSX)] // There does't appear to be an OSX API that will fail for these [InlineData("4294967296")] // Decimal overflow by 1 [InlineData("040000000000")] // Octal overflow by 1 [InlineData("01011101001110110001100100011011")] // Binary? Read as octal, overflows @@ -249,7 +249,7 @@ public void ParseIPv6_v4_Success(string address, string expected) } [Theory] - [PlatformSpecific(~PlatformID.AnyUnix)] + [PlatformSpecific(~TestPlatforms.AnyUnix)] // Linux/OSX don't do the IPv6->IPv4 formatting for these addresses [InlineData("::FFFF:0:192.168.0.1", "::ffff:0:192.168.0.1")] // SIIT [InlineData("::5EFE:192.168.0.1", "::5efe:192.168.0.1")] // ISATAP @@ -260,7 +260,7 @@ public void ParseIPv6_v4_Success_NonUnix(string address, string expected) } [Theory] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] // Linux/OSX don't do the IPv6->IPv4 formatting for these addresses [InlineData("::FFFF:0:192.168.0.1", "::ffff:0:c0a8:1")] // SIIT [InlineData("::5EFE:192.168.0.1", "::5efe:c0a8:1")] // ISATAP @@ -271,7 +271,7 @@ public void ParseIPv6_v4_Success_Unix(string address, string expected) } [Theory] - [PlatformSpecific(~PlatformID.Linux)] // Linux does not appear to recognize this as a valid address + [PlatformSpecific(~TestPlatforms.Linux)] // Linux does not appear to recognize this as a valid address [InlineData("::192.168.0.010", "::192.168.0.10")] // Embedded IPv4 octal, read as decimal public void ParseIPv6_v4_Success_NonLinux(string address, string expected) { @@ -363,7 +363,7 @@ public void ParseIPv6_JustScope_Failure() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ParseIPv6_AlphaNumericScope_Failure() { Assert.Throws(() => { IPAddress.Parse("::%1a"); }); diff --git a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamStreamToStreamTest.cs b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamStreamToStreamTest.cs index a960ee0689f1..d95fd8df82ae 100644 --- a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamStreamToStreamTest.cs +++ b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamStreamToStreamTest.cs @@ -12,7 +12,7 @@ namespace System.Net.Security.Tests { - [PlatformSpecific(PlatformID.Windows)] // NegotiateStream only supports client-side functionality on Unix + [PlatformSpecific(TestPlatforms.Windows)] // NegotiateStream only supports client-side functionality on Unix public abstract class NegotiateStreamStreamToStreamTest { private readonly byte[] _sampleMsg = Encoding.UTF8.GetBytes("Sample Test Message"); diff --git a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs index 337dfb3c566f..2f76e7b0d0ee 100644 --- a/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs +++ b/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs @@ -112,7 +112,7 @@ private static int RunSetupScript(string args = null) } } - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] [Trait(XunitConstants.Category, XunitConstants.RequiresElevation)] public class NegotiateStreamTest : IDisposable, IClassFixture { @@ -151,7 +151,7 @@ public NegotiateStreamTest(KDCSetup fixture, ITestOutputHelper output) } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_KerberosAuthentication_Success() { if (!_isKrbAvailable) @@ -184,7 +184,7 @@ public void NegotiateStream_StreamToStream_KerberosAuthentication_Success() } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_AuthToHttpTarget_Success() { if (!_isKrbAvailable) @@ -217,7 +217,7 @@ public void NegotiateStream_StreamToStream_AuthToHttpTarget_Success() } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_KerberosAuthWithoutRealm_Success() { if (!_isKrbAvailable) @@ -249,7 +249,7 @@ public void NegotiateStream_StreamToStream_KerberosAuthWithoutRealm_Success() } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_KerberosAuthDefaultCredentials_Success() { if (!_isKrbAvailable) @@ -284,7 +284,7 @@ public void NegotiateStream_StreamToStream_KerberosAuthDefaultCredentials_Succes } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_EchoServer_ClientWriteRead_Successive_Sync_Success() { if (!_isKrbAvailable) @@ -328,7 +328,7 @@ public void NegotiateStream_EchoServer_ClientWriteRead_Successive_Sync_Success() } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_EchoServer_ClientWriteRead_Successive_Async_Success() { if (!_isKrbAvailable) @@ -385,7 +385,7 @@ private static async Task ReadAllAsync(Stream source, byte[] buffer, int offset, } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_KerberosAuthDefaultCredentialsNoSeed_Failure() { if (!_isKrbAvailable) @@ -408,7 +408,7 @@ public void NegotiateStream_StreamToStream_KerberosAuthDefaultCredentialsNoSeed_ } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_KerberosAuthInvalidUser_Failure() { if (!_isKrbAvailable) @@ -435,7 +435,7 @@ public void NegotiateStream_StreamToStream_KerberosAuthInvalidUser_Failure() } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_KerberosAuthInvalidPassword_Failure() { if (!_isKrbAvailable) @@ -463,7 +463,7 @@ public void NegotiateStream_StreamToStream_KerberosAuthInvalidPassword_Failure() } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_KerberosAuthInvalidTarget_Failure() { if (!_isKrbAvailable) @@ -519,7 +519,7 @@ public static IEnumerable InvalidNtlmCredentials [Theory, OuterLoop] [MemberData(nameof(ValidNtlmCredentials))] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_NtlmAuthentication_ValidCredentials_Success(NetworkCredential credential) { if (!_isNtlmAvailable) @@ -565,7 +565,7 @@ public void NegotiateStream_StreamToStream_NtlmAuthentication_ValidCredentials_S [Fact, OuterLoop] [ActiveIssue(7825)] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_NtlmAuthentication_Fallback_Success() { if (!_isNtlmAvailable) @@ -610,7 +610,7 @@ public void NegotiateStream_StreamToStream_NtlmAuthentication_Fallback_Success() } [Fact, OuterLoop] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_NtlmAuthentication_KerberosCreds_Success() { if (!_isNtlmAvailable) @@ -656,7 +656,7 @@ public void NegotiateStream_StreamToStream_NtlmAuthentication_KerberosCreds_Succ [Fact, OuterLoop] [ActiveIssue(7825)] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_EchoServer_NTLM_ClientWriteRead_Successive_Sync_Success() { if (!_isNtlmAvailable) @@ -705,7 +705,7 @@ public void NegotiateStream_EchoServer_NTLM_ClientWriteRead_Successive_Sync_Succ [Fact, OuterLoop] [ActiveIssue(7825)] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_EchoServer_NTLM_ClientWriteRead_Successive_Async_Success() { if (!_isNtlmAvailable) @@ -759,7 +759,7 @@ public void NegotiateStream_EchoServer_NTLM_ClientWriteRead_Successive_Async_Suc [Theory, OuterLoop] [MemberData(nameof(InvalidNtlmCredentials))] - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void NegotiateStream_StreamToStream_NtlmAuthentication_NtlmUser_InvalidCredentials_Fail(NetworkCredential credential) { if (!_isNtlmAvailable) diff --git a/src/System.Net.Security/tests/FunctionalTests/SslStreamSchSendAuxRecordTest.cs b/src/System.Net.Security/tests/FunctionalTests/SslStreamSchSendAuxRecordTest.cs index a56eef28f02d..8f90c00dcf78 100644 --- a/src/System.Net.Security/tests/FunctionalTests/SslStreamSchSendAuxRecordTest.cs +++ b/src/System.Net.Security/tests/FunctionalTests/SslStreamSchSendAuxRecordTest.cs @@ -24,7 +24,7 @@ public SchSendAuxRecordTest(ITestOutputHelper output) [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public async Task SslStream_ClientAndServerUsesAuxRecord_Ok() { X509Certificate2 serverCert = Configuration.Certificates.GetServerCertificate(); diff --git a/src/System.Net.Sockets/tests/FunctionalTests/AcceptAsync.cs b/src/System.Net.Sockets/tests/FunctionalTests/AcceptAsync.cs index d111aa6dd720..ed11e9cefbfe 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/AcceptAsync.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/AcceptAsync.cs @@ -118,7 +118,7 @@ public void AcceptAsync_IPv6_Success() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void AcceptAsync_WithReceiveBuffer_Success() { Assert.True(Capability.IPv4Support()); @@ -169,7 +169,7 @@ public void AcceptAsync_WithReceiveBuffer_Success() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void AcceptAsync_WithReceiveBuffer_Failure() { // diff --git a/src/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs b/src/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs index b8d20510058a..165dcc301975 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs @@ -698,7 +698,7 @@ public void SendToAsync_NullRemoteEndPoint_Throws_ArgumentNull() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Socket_Connect_DnsEndPoint_NotSupported() { using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -726,7 +726,7 @@ public async Task Socket_Connect_DnsEndPointWithIPAddressString_Supported() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Socket_Connect_StringHost_NotSupported() { using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -772,7 +772,7 @@ public async Task Socket_Connect_IPv6AddressAsStringHost_Supported() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Socket_Connect_MultipleAddresses_NotSupported() { using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -782,7 +782,7 @@ public void Socket_Connect_MultipleAddresses_NotSupported() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Socket_ConnectAsync_DnsEndPoint_NotSupported() { using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -809,7 +809,7 @@ await Task.WhenAll( } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Socket_ConnectAsync_StringHost_NotSupported() { using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -853,7 +853,7 @@ await Task.WhenAll( } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Socket_ConnectAsync_MultipleAddresses_NotSupported() { using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -863,7 +863,7 @@ public void Socket_ConnectAsync_MultipleAddresses_NotSupported() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Connect_ConnectTwice_NotSupported() { using (Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -882,7 +882,7 @@ public void Connect_ConnectTwice_NotSupported() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void ConnectAsync_ConnectTwice_NotSupported() { AutoResetEvent completed = new AutoResetEvent(false); @@ -954,7 +954,7 @@ public void BeginConnect_EndPoint_ListeningSocket_Throws_InvalidOperation() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BeginConnect_EndPoint_AddressFamily_Throws_NotSupported() { Assert.Throws(() => GetSocket(AddressFamily.InterNetwork).BeginConnect(new DnsEndPoint("localhost", 1, AddressFamily.InterNetworkV6), TheAsyncCallback, null)); @@ -974,7 +974,7 @@ public void BeginConnect_Host_InvalidPort_Throws_ArgumentOutOfRange() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BeginConnect_Host_ListeningSocket_Throws_InvalidOperation() { using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -1024,7 +1024,7 @@ public void BeginConnect_IPAddresses_InvalidPort_Throws_ArgumentOutOfRange() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BeginConnect_IPAddresses_ListeningSocket_Throws_InvalidOperation() { using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -1288,7 +1288,7 @@ public void EndReceiveMessageFrom_NullAsyncResult_Throws_ArgumentNull() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void TcpClient_ConnectAsync_StringHost_NotSupportedAfterClientAccess() { using (TcpClient client = new TcpClient()) @@ -1299,7 +1299,7 @@ public void TcpClient_ConnectAsync_StringHost_NotSupportedAfterClientAccess() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void TcpClient_ConnectAsync_ArrayOfAddresses_NotSupportedAfterClientAccess() { using (TcpClient client = new TcpClient()) diff --git a/src/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs index 715d882cfce7..79044ccdf05a 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs @@ -27,7 +27,7 @@ public void OnCompleted(object sender, SocketAsyncEventArgs args) [Fact] [OuterLoop("Issue #11345")] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Disconnect_Success() { AutoResetEvent completed = new AutoResetEvent(false); @@ -61,7 +61,7 @@ public void Disconnect_Success() [Fact] [OuterLoop("Issue #11345")] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DisconnectAsync_Success() { AutoResetEvent completed = new AutoResetEvent(false); @@ -97,7 +97,7 @@ public void DisconnectAsync_Success() [Fact] [OuterLoop("Issue #11345")] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BeginDisconnect_Success() { AutoResetEvent completed = new AutoResetEvent(false); @@ -129,7 +129,7 @@ public void BeginDisconnect_Success() } [Fact] - [PlatformSpecific(~PlatformID.Windows)] + [PlatformSpecific(~TestPlatforms.Windows)] public void Disconnect_NonWindows_NotSupported() { using (Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -139,7 +139,7 @@ public void Disconnect_NonWindows_NotSupported() } [Fact] - [PlatformSpecific(~PlatformID.Windows)] + [PlatformSpecific(~TestPlatforms.Windows)] public void DisconnectAsync_NonWindows_NotSupported() { using (Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -151,7 +151,7 @@ public void DisconnectAsync_NonWindows_NotSupported() } [Fact] - [PlatformSpecific(~PlatformID.Windows)] + [PlatformSpecific(~TestPlatforms.Windows)] public void BeginDisconnect_NonWindows_NotSupported() { using (Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) diff --git a/src/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs index d3a696bd7a33..171350650bdb 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs @@ -32,7 +32,7 @@ private void OnConnectAsyncCompleted(object sender, SocketAsyncEventArgs args) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Socket_ConnectDnsEndPoint_Success(SocketImplementationType type) { int port; @@ -47,7 +47,7 @@ public void Socket_ConnectDnsEndPoint_Success(SocketImplementationType type) [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Socket_ConnectDnsEndPoint_Failure() { using (Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -103,7 +103,7 @@ public void Socket_ReceiveFromDnsEndPoint_ArgumentException() [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Socket_BeginConnectDnsEndPoint_Success(SocketImplementationType type) { int port; @@ -119,7 +119,7 @@ public void Socket_BeginConnectDnsEndPoint_Success(SocketImplementationType type [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Socket_BeginConnectDnsEndPoint_Failure() { using (Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -162,7 +162,7 @@ public void Socket_BeginSendToDnsEndPoint_ArgumentException() [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] [Trait("IPv4", "true")] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Socket_ConnectAsyncDnsEndPoint_Success(SocketImplementationType type) { Assert.True(Capability.IPv4Support()); @@ -196,7 +196,7 @@ public void Socket_ConnectAsyncDnsEndPoint_Success(SocketImplementationType type [OuterLoop] // TODO: Issue #11345 [Fact] [Trait("IPv4", "true")] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Socket_ConnectAsyncDnsEndPoint_HostNotFound() { Assert.True(Capability.IPv4Support()); @@ -225,7 +225,7 @@ public void Socket_ConnectAsyncDnsEndPoint_HostNotFound() [OuterLoop] // TODO: Issue #11345 [Fact] [Trait("IPv4", "true")] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Socket_ConnectAsyncDnsEndPoint_ConnectionRefused() { Assert.True(Capability.IPv4Support()); @@ -259,7 +259,7 @@ public void Socket_ConnectAsyncDnsEndPoint_ConnectionRefused() [InlineData(SocketImplementationType.Async)] [Trait("IPv4", "true")] [Trait("IPv6", "true")] - [ActiveIssue(4002, PlatformID.AnyUnix)] + [ActiveIssue(4002, TestPlatforms.AnyUnix)] public void Socket_StaticConnectAsync_Success(SocketImplementationType type) { Assert.True(Capability.IPv4Support() && Capability.IPv6Support()); diff --git a/src/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs index a25754c3951f..966f53f8f7eb 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs @@ -230,7 +230,7 @@ private void DualModeConnect_IPEndPointToHost_Helper(IPAddress connectTo, IPAddr public class DualModeConnectToIPAddressArray : DualModeBase { [Fact] // Base Case - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] // "None of the discovered or specified addresses match the socket address family." public void Socket_ConnectV4IPAddressListToV4Host_Throws() { @@ -249,7 +249,7 @@ public void Socket_ConnectV4IPAddressListToV4Host_Throws() [Theory] [MemberData(nameof(DualMode_IPAddresses_ListenOn_DualMode_Throws_Data))] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DualModeConnect_IPAddressListToHost_Throws(IPAddress[] connectTo, IPAddress listenOn, bool dualModeServer) { Assert.ThrowsAny(() => DualModeConnect_IPAddressListToHost_Success(connectTo, listenOn, dualModeServer)); @@ -257,7 +257,7 @@ public void DualModeConnect_IPAddressListToHost_Throws(IPAddress[] connectTo, IP [Theory] [MemberData(nameof(DualMode_IPAddresses_ListenOn_DualMode_Success_Data))] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DualModeConnect_IPAddressListToHost_Success(IPAddress[] connectTo, IPAddress listenOn, bool dualModeServer) { int port; @@ -276,7 +276,7 @@ public class DualModeConnectToHostString : DualModeBase { [Theory] [MemberData(nameof(DualMode_Connect_IPAddress_DualMode_Data))] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DualModeConnect_LoopbackDnsToHost_Helper(IPAddress listenOn, bool dualModeServer) { int port; @@ -295,7 +295,7 @@ public class DualModeConnectToDnsEndPoint : DualModeBase { [Theory] [MemberData(nameof(DualMode_Connect_IPAddress_DualMode_Data))] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] private void DualModeConnect_DnsEndPointToHost_Helper(IPAddress listenOn, bool dualModeServer) { int port; @@ -438,7 +438,7 @@ public class DualModeBeginConnect : DualModeBase { [Theory] [MemberData(nameof(DualMode_IPAddresses_ListenOn_DualMode_Data))] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] private void DualModeBeginConnect_IPAddressListToHost_Helper(IPAddress[] connectTo, IPAddress listenOn, bool dualModeServer) { int port; @@ -453,7 +453,7 @@ private void DualModeBeginConnect_IPAddressListToHost_Helper(IPAddress[] connect [Theory] [MemberData(nameof(DualMode_Connect_IPAddress_DualMode_Data))] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DualModeBeginConnect_LoopbackDnsToHost_Helper(IPAddress listenOn, bool dualModeServer) { int port; @@ -468,7 +468,7 @@ public void DualModeBeginConnect_LoopbackDnsToHost_Helper(IPAddress listenOn, bo [Theory] [MemberData(nameof(DualMode_Connect_IPAddress_DualMode_Data))] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DualModeBeginConnect_DnsEndPointToHost_Helper(IPAddress listenOn, bool dualModeServer) { int port; @@ -565,7 +565,7 @@ private void DualModeConnectAsync_IPEndPointToHost_Helper(IPAddress connectTo, I [Theory] [MemberData(nameof(DualMode_Connect_IPAddress_DualMode_Data))] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void DualModeConnectAsync_DnsEndPointToHost_Helper(IPAddress listenOn, bool dualModeServer) { int port; @@ -591,7 +591,7 @@ public void DualModeConnectAsync_DnsEndPointToHost_Helper(IPAddress listenOn, bo [Theory] [MemberData(nameof(DualMode_Connect_IPAddress_DualMode_Data))] - [ActiveIssue(4002, PlatformID.AnyUnix)] + [ActiveIssue(4002, TestPlatforms.AnyUnix)] public void DualModeConnectAsync_Static_DnsEndPointToHost_Helper(IPAddress listenOn, bool dualModeServer) { int port; @@ -716,7 +716,7 @@ public void AcceptV6BoundToAnyV6_Success() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // https://github.com/dotnet/corefx/issues/5832 + [PlatformSpecific(TestPlatforms.Windows)] // https://github.com/dotnet/corefx/issues/5832 public void AcceptV6BoundToSpecificV4_CantConnect() { Assert.Throws(() => @@ -726,7 +726,7 @@ public void AcceptV6BoundToSpecificV4_CantConnect() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // https://github.com/dotnet/corefx/issues/5832 + [PlatformSpecific(TestPlatforms.Windows)] // https://github.com/dotnet/corefx/issues/5832 public void AcceptV4BoundToSpecificV6_CantConnect() { Assert.Throws(() => @@ -736,7 +736,7 @@ public void AcceptV4BoundToSpecificV6_CantConnect() } [Fact] - [PlatformSpecific(PlatformID.Windows)] // https://github.com/dotnet/corefx/issues/5832 + [PlatformSpecific(TestPlatforms.Windows)] // https://github.com/dotnet/corefx/issues/5832 public void AcceptV6BoundToAnyV4_CantConnect() { Assert.Throws(() => @@ -1348,7 +1348,7 @@ public void Socket_ReceiveFromV4IPEndPointFromV4Client_Throws() } [Fact] // Base case - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void Socket_ReceiveFromDnsEndPoint_Throws() { // "The parameter remoteEP must not be of type DnsEndPoint." @@ -1364,35 +1364,35 @@ public void Socket_ReceiveFromDnsEndPoint_Throws() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromV4BoundToSpecificV4_Success() { ReceiveFrom_Helper(IPAddress.Loopback, IPAddress.Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromV4BoundToAnyV4_Success() { ReceiveFrom_Helper(IPAddress.Any, IPAddress.Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromV6BoundToSpecificV6_Success() { ReceiveFrom_Helper(IPAddress.IPv6Loopback, IPAddress.IPv6Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromV6BoundToAnyV6_Success() { ReceiveFrom_Helper(IPAddress.IPv6Any, IPAddress.IPv6Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromV6BoundToSpecificV4_NotReceived() { Assert.Throws(() => @@ -1402,7 +1402,7 @@ public void ReceiveFromV6BoundToSpecificV4_NotReceived() } [Fact] - [PlatformSpecific(~(PlatformID.Linux | PlatformID.OSX))] + [PlatformSpecific(~(TestPlatforms.Linux | TestPlatforms.OSX))] public void ReceiveFromV4BoundToSpecificV6_NotReceived() { Assert.Throws(() => @@ -1419,7 +1419,7 @@ public void ReceiveFromV4BoundToSpecificV6_NotReceived() // an acceptable difference due to the extra state that would otherwise // be necessary to emulate the Winsock behavior. [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/982 - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void ReceiveFromV4BoundToSpecificV6_NotReceived_Linux() { Assert.Throws(() => @@ -1429,7 +1429,7 @@ public void ReceiveFromV4BoundToSpecificV6_NotReceived_Linux() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromV6BoundToAnyV4_NotReceived() { Assert.Throws(() => @@ -1439,7 +1439,7 @@ public void ReceiveFromV6BoundToAnyV4_NotReceived() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromV4BoundToAnyV6_Success() { ReceiveFrom_Helper(IPAddress.IPv6Any, IPAddress.Loopback); @@ -1448,7 +1448,7 @@ public void ReceiveFromV4BoundToAnyV6_Success() #endregion ReceiveFrom Sync [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void ReceiveFrom_NotSupported() { using (Socket sock = new Socket(SocketType.Dgram, ProtocolType.Udp)) @@ -1487,7 +1487,7 @@ public void Socket_BeginReceiveFromV4IPEndPointFromV4Client_Throws() } [Fact] // Base case - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] // "The parameter remoteEP must not be of type DnsEndPoint." public void Socket_BeginReceiveFromDnsEndPoint_Throws() { @@ -1504,35 +1504,35 @@ public void Socket_BeginReceiveFromDnsEndPoint_Throws() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveFromV4BoundToSpecificV4_Success() { BeginReceiveFrom_Helper(IPAddress.Loopback, IPAddress.Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveFromV4BoundToAnyV4_Success() { BeginReceiveFrom_Helper(IPAddress.Any, IPAddress.Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveFromV6BoundToSpecificV6_Success() { BeginReceiveFrom_Helper(IPAddress.IPv6Loopback, IPAddress.IPv6Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveFromV6BoundToAnyV6_Success() { BeginReceiveFrom_Helper(IPAddress.IPv6Any, IPAddress.IPv6Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveFromV6BoundToSpecificV4_NotReceived() { Assert.Throws(() => @@ -1542,7 +1542,7 @@ public void BeginReceiveFromV6BoundToSpecificV4_NotReceived() } [Fact] - [PlatformSpecific(~(PlatformID.Linux | PlatformID.OSX))] + [PlatformSpecific(~(TestPlatforms.Linux | TestPlatforms.OSX))] public void BeginReceiveFromV4BoundToSpecificV6_NotReceived() { Assert.Throws(() => @@ -1559,7 +1559,7 @@ public void BeginReceiveFromV4BoundToSpecificV6_NotReceived() // an acceptable difference due to the extra state that would otherwise // be necessary to emulate the Winsock behavior. [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/982 - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void BeginReceiveFromV4BoundToSpecificV6_NotReceived_Linux() { Assert.Throws(() => @@ -1569,7 +1569,7 @@ public void BeginReceiveFromV4BoundToSpecificV6_NotReceived_Linux() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveFromV6BoundToAnyV4_NotReceived() { Assert.Throws(() => @@ -1579,7 +1579,7 @@ public void BeginReceiveFromV6BoundToAnyV4_NotReceived() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveFromV4BoundToAnyV6_Success() { BeginReceiveFrom_Helper(IPAddress.IPv6Any, IPAddress.Loopback); @@ -1645,7 +1645,7 @@ public void Socket_ReceiveFromAsyncV4IPEndPointFromV4Client_Throws() } [Fact] // Base case - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] // "The parameter remoteEP must not be of type DnsEndPoint." public void Socket_ReceiveFromAsyncDnsEndPoint_Throws() { @@ -1664,35 +1664,35 @@ public void Socket_ReceiveFromAsyncDnsEndPoint_Throws() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromAsyncV4BoundToSpecificV4_Success() { ReceiveFromAsync_Helper(IPAddress.Loopback, IPAddress.Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromAsyncV4BoundToAnyV4_Success() { ReceiveFromAsync_Helper(IPAddress.Any, IPAddress.Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromAsyncV6BoundToSpecificV6_Success() { ReceiveFromAsync_Helper(IPAddress.IPv6Loopback, IPAddress.IPv6Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromAsyncV6BoundToAnyV6_Success() { ReceiveFromAsync_Helper(IPAddress.IPv6Any, IPAddress.IPv6Loopback); } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromAsyncV6BoundToSpecificV4_NotReceived() { Assert.Throws(() => @@ -1702,7 +1702,7 @@ public void ReceiveFromAsyncV6BoundToSpecificV4_NotReceived() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromAsyncV4BoundToSpecificV6_NotReceived() { Assert.Throws(() => @@ -1712,7 +1712,7 @@ public void ReceiveFromAsyncV4BoundToSpecificV6_NotReceived() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromAsyncV6BoundToAnyV4_NotReceived() { Assert.Throws(() => @@ -1722,7 +1722,7 @@ public void ReceiveFromAsyncV6BoundToAnyV4_NotReceived() } [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveFromAsyncV4BoundToAnyV6_Success() { ReceiveFromAsync_Helper(IPAddress.IPv6Any, IPAddress.Loopback); @@ -1765,7 +1765,7 @@ private void ReceiveFromAsync_Helper(IPAddress listenOn, IPAddress connectTo, bo #endregion ReceiveFrom Async/Event [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void ReceiveFromAsync_NotSupported() { using (Socket sock = new Socket(SocketType.Dgram, ProtocolType.Udp)) @@ -1788,7 +1788,7 @@ public void ReceiveFromAsync_NotSupported() public class DualModeConnectionlessReceiveMessageFrom : DualModeBase { [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void ReceiveMessageFrom_NotSupported() { using (Socket sock = new Socket(SocketType.Dgram, ProtocolType.Udp)) @@ -1805,7 +1805,7 @@ public void ReceiveMessageFrom_NotSupported() } [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void ReceiveMessageFromAsync_NotSupported() { using (Socket sock = new Socket(SocketType.Dgram, ProtocolType.Udp)) @@ -1839,7 +1839,7 @@ public void Socket_ReceiveMessageFromV4IPEndPointFromV4Client_Throws() } [Fact] // Base case - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] // "The parameter remoteEP must not be of type DnsEndPoint." public void Socket_ReceiveMessageFromDnsEndPoint_Throws() { @@ -1858,49 +1858,49 @@ public void Socket_ReceiveMessageFromDnsEndPoint_Throws() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromV4BoundToSpecificMappedV4_Success() { ReceiveMessageFrom_Helper(IPAddress.Loopback.MapToIPv6(), IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromV4BoundToAnyMappedV4_Success() { ReceiveMessageFrom_Helper(IPAddress.Any.MapToIPv6(), IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromV4BoundToSpecificV4_Success() { ReceiveMessageFrom_Helper(IPAddress.Loopback, IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromV4BoundToAnyV4_Success() { ReceiveMessageFrom_Helper(IPAddress.Any, IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromV6BoundToSpecificV6_Success() { ReceiveMessageFrom_Helper(IPAddress.IPv6Loopback, IPAddress.IPv6Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromV6BoundToAnyV6_Success() { ReceiveMessageFrom_Helper(IPAddress.IPv6Any, IPAddress.IPv6Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromV6BoundToSpecificV4_NotReceived() { Assert.Throws(() => @@ -1910,7 +1910,7 @@ public void ReceiveMessageFromV6BoundToSpecificV4_NotReceived() } [Fact] - [PlatformSpecific(~(PlatformID.Linux | PlatformID.OSX))] + [PlatformSpecific(~(TestPlatforms.Linux | TestPlatforms.OSX))] public void ReceiveMessageFromV4BoundToSpecificV6_NotReceived() { Assert.Throws(() => @@ -1927,7 +1927,7 @@ public void ReceiveMessageFromV4BoundToSpecificV6_NotReceived() // an acceptable difference due to the extra state that would otherwise // be necessary to emulate the Winsock behavior. [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void ReceiveMessageFromV4BoundToSpecificV6_NotReceived_Linux() { Assert.Throws(() => @@ -1937,7 +1937,7 @@ public void ReceiveMessageFromV4BoundToSpecificV6_NotReceived_Linux() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromV6BoundToAnyV4_NotReceived() { Assert.Throws(() => @@ -1947,7 +1947,7 @@ public void ReceiveMessageFromV6BoundToAnyV4_NotReceived() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromV4BoundToAnyV6_Success() { ReceiveMessageFrom_Helper(IPAddress.IPv6Any, IPAddress.Loopback); @@ -2029,7 +2029,7 @@ public void Socket_BeginReceiveMessageFromV4IPEndPointFromV4Client_Throws() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] // "The parameter remoteEP must not be of type DnsEndPoint." public void Socket_BeginReceiveMessageFromDnsEndPoint_Throws() { @@ -2047,49 +2047,49 @@ public void Socket_BeginReceiveMessageFromDnsEndPoint_Throws() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveMessageFromV4BoundToSpecificMappedV4_Success() { BeginReceiveMessageFrom_Helper(IPAddress.Loopback.MapToIPv6(), IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveMessageFromV4BoundToAnyMappedV4_Success() { BeginReceiveMessageFrom_Helper(IPAddress.Any.MapToIPv6(), IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveMessageFromV4BoundToSpecificV4_Success() { BeginReceiveMessageFrom_Helper(IPAddress.Loopback, IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveMessageFromV4BoundToAnyV4_Success() { BeginReceiveMessageFrom_Helper(IPAddress.Any, IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveMessageFromV6BoundToSpecificV6_Success() { BeginReceiveMessageFrom_Helper(IPAddress.IPv6Loopback, IPAddress.IPv6Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveMessageFromV6BoundToAnyV6_Success() { BeginReceiveMessageFrom_Helper(IPAddress.IPv6Any, IPAddress.IPv6Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveMessageFromV6BoundToSpecificV4_NotReceived() { Assert.Throws(() => @@ -2099,7 +2099,7 @@ public void BeginReceiveMessageFromV6BoundToSpecificV4_NotReceived() } [Fact] - [PlatformSpecific(~(PlatformID.Linux | PlatformID.OSX))] + [PlatformSpecific(~(TestPlatforms.Linux | TestPlatforms.OSX))] public void BeginReceiveMessageFromV4BoundToSpecificV6_NotReceived() { Assert.Throws(() => @@ -2116,7 +2116,7 @@ public void BeginReceiveMessageFromV4BoundToSpecificV6_NotReceived() // an acceptable difference due to the extra state that would otherwise // be necessary to emulate the Winsock behavior. [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void BeginReceiveMessageFromV4BoundToSpecificV6_NotReceived_Linux() { Assert.Throws(() => @@ -2126,7 +2126,7 @@ public void BeginReceiveMessageFromV4BoundToSpecificV6_NotReceived_Linux() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveMessageFromV6BoundToAnyV4_NotReceived() { Assert.Throws(() => @@ -2136,7 +2136,7 @@ public void BeginReceiveMessageFromV6BoundToAnyV4_NotReceived() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void BeginReceiveMessageFromV4BoundToAnyV6_Success() { BeginReceiveMessageFrom_Helper(IPAddress.IPv6Any, IPAddress.Loopback); @@ -2200,7 +2200,7 @@ public void Socket_ReceiveMessageFromAsyncV4IPEndPointFromV4Client_Throws() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] // "The parameter remoteEP must not be of type DnsEndPoint." public void Socket_ReceiveMessageFromAsyncDnsEndPoint_Throws() { @@ -2220,49 +2220,49 @@ public void Socket_ReceiveMessageFromAsyncDnsEndPoint_Throws() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromAsyncV4BoundToSpecificMappedV4_Success() { ReceiveMessageFromAsync_Helper(IPAddress.Loopback.MapToIPv6(), IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromAsyncV4BoundToAnyMappedV4_Success() { ReceiveMessageFromAsync_Helper(IPAddress.Any.MapToIPv6(), IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromAsyncV4BoundToSpecificV4_Success() { ReceiveMessageFromAsync_Helper(IPAddress.Loopback, IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromAsyncV4BoundToAnyV4_Success() { ReceiveMessageFromAsync_Helper(IPAddress.Any, IPAddress.Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromAsyncV6BoundToSpecificV6_Success() { ReceiveMessageFromAsync_Helper(IPAddress.IPv6Loopback, IPAddress.IPv6Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromAsyncV6BoundToAnyV6_Success() { ReceiveMessageFromAsync_Helper(IPAddress.IPv6Any, IPAddress.IPv6Loopback); } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromAsyncV6BoundToSpecificV4_NotReceived() { Assert.Throws(() => @@ -2272,7 +2272,7 @@ public void ReceiveMessageFromAsyncV6BoundToSpecificV4_NotReceived() } [Fact] - [PlatformSpecific(~(PlatformID.Linux | PlatformID.OSX))] + [PlatformSpecific(~(TestPlatforms.Linux | TestPlatforms.OSX))] public void ReceiveMessageFromAsyncV4BoundToSpecificV6_NotReceived() { Assert.Throws(() => @@ -2289,7 +2289,7 @@ public void ReceiveMessageFromAsyncV4BoundToSpecificV6_NotReceived() // an acceptable difference due to the extra state that would otherwise // be necessary to emulate the Winsock behavior. [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public void ReceiveMessageFromAsyncV4BoundToSpecificV6_NotReceived_Linux() { Assert.Throws(() => @@ -2299,7 +2299,7 @@ public void ReceiveMessageFromAsyncV4BoundToSpecificV6_NotReceived_Linux() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromAsyncV6BoundToAnyV4_NotReceived() { Assert.Throws(() => @@ -2309,7 +2309,7 @@ public void ReceiveMessageFromAsyncV6BoundToAnyV4_NotReceived() } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/987 - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void ReceiveMessageFromAsyncV4BoundToAnyV6_Success() { ReceiveMessageFromAsync_Helper(IPAddress.IPv6Any, IPAddress.Loopback); @@ -2353,7 +2353,7 @@ private void ReceiveMessageFromAsync_Helper(IPAddress listenOn, IPAddress connec } [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void BeginReceiveFrom_NotSupported() { using (Socket sock = new Socket(SocketType.Dgram, ProtocolType.Udp)) @@ -2368,7 +2368,7 @@ public void BeginReceiveFrom_NotSupported() } [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void BeginReceiveMessageFrom_NotSupported() { using (Socket sock = new Socket(SocketType.Dgram, ProtocolType.Udp)) diff --git a/src/System.Net.Sockets/tests/FunctionalTests/Handle.cs b/src/System.Net.Sockets/tests/FunctionalTests/Handle.cs index a3f6e0196f58..afd9f225fb6c 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/Handle.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/Handle.cs @@ -19,7 +19,7 @@ public static void ValidHandle_NotNegativeOne() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void ValidHandle_NotZero() { using (var s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) diff --git a/src/System.Net.Sockets/tests/FunctionalTests/LingerStateTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/LingerStateTest.cs index 104fffe85842..b66305478468 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/LingerStateTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/LingerStateTest.cs @@ -44,7 +44,7 @@ public void Socket_LingerState_Common_Boundaries_CorrectBehavior() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(~PlatformID.OSX)] + [PlatformSpecific(~TestPlatforms.OSX)] public void Socket_LingerState_Upper_Boundaries_CorrectBehavior() { Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); @@ -56,7 +56,7 @@ public void Socket_LingerState_Upper_Boundaries_CorrectBehavior() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public void Socket_LingerState_Upper_Boundaries_CorrectBehavior_OSX() { // The upper bound for linger time is drastically different on OS X. diff --git a/src/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs index 1dc0dd1879fc..0874c5d1ec82 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs @@ -24,7 +24,7 @@ public SelectTest(ITestOutputHelper output) private const int SmallTimeoutMicroseconds = 10 * 1000; private const int FailTimeoutMicroseconds = 30 * 1000 * 1000; - [PlatformSpecific(~PlatformID.OSX)] // typical OSX install has very low max open file descriptors value + [PlatformSpecific(~TestPlatforms.OSX)] // typical OSX install has very low max open file descriptors value [Theory] [InlineData(90, 0)] [InlineData(0, 90)] @@ -79,7 +79,7 @@ public void Select_ReadWrite_AllReady(int reads, int writes) } } - [PlatformSpecific(~PlatformID.OSX)] // typical OSX install has very low max open file descriptors value + [PlatformSpecific(~TestPlatforms.OSX)] // typical OSX install has very low max open file descriptors value [Fact] public void Select_ReadError_NoneReady_ManySockets() { @@ -111,7 +111,7 @@ public void Select_ReadError_NoneReady(int reads, int errors) } } - [PlatformSpecific(~PlatformID.OSX)] // typical OSX install has very low max open file descriptors value + [PlatformSpecific(~TestPlatforms.OSX)] // typical OSX install has very low max open file descriptors value public void Select_Read_OneReadyAtATime_ManySockets(int reads) { Select_Read_OneReadyAtATime(90); // value larger than the internal value in SocketPal.Unix that swaps between stack and heap allocation @@ -145,7 +145,7 @@ public void Select_Read_OneReadyAtATime(int reads) } } - [PlatformSpecific(~PlatformID.OSX)] // typical OSX install has very low max open file descriptors value + [PlatformSpecific(~TestPlatforms.OSX)] // typical OSX install has very low max open file descriptors value [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/989 public void Select_Error_OneReadyAtATime() { diff --git a/src/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs b/src/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs index 849f081e5f61..1241e602c0e0 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs @@ -57,7 +57,7 @@ public SendPacketsAsync(ITestOutputHelper output) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Unix_NotSupported_ThrowsPlatformNotSupportedException(SocketImplementationType type) { int port; @@ -146,7 +146,7 @@ public void NullList_Throws(SocketImplementationType type) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void NullElement_Ignored(SocketImplementationType type) { SendPackets(type, (SendPacketsElement)null, 0); @@ -156,7 +156,7 @@ public void NullElement_Ignored(SocketImplementationType type) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void EmptyList_Ignored(SocketImplementationType type) { SendPackets(type, new SendPacketsElement[0], SocketError.Success, 0); @@ -177,7 +177,7 @@ public void SocketAsyncEventArgs_DefaultSendSize_0() [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void NormalBuffer_Success(SocketImplementationType type) { SendPackets(type, new SendPacketsElement(new byte[10]), 10); @@ -186,7 +186,7 @@ public void NormalBuffer_Success(SocketImplementationType type) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void NormalBufferRange_Success(SocketImplementationType type) { SendPackets(type, new SendPacketsElement(new byte[10], 5, 5), 5); @@ -195,7 +195,7 @@ public void NormalBufferRange_Success(SocketImplementationType type) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void EmptyBuffer_Ignored(SocketImplementationType type) { SendPackets(type, new SendPacketsElement(new byte[0]), 0); @@ -204,7 +204,7 @@ public void EmptyBuffer_Ignored(SocketImplementationType type) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BufferZeroCount_Ignored(SocketImplementationType type) { SendPackets(type, new SendPacketsElement(new byte[10], 4, 0), 0); @@ -213,7 +213,7 @@ public void BufferZeroCount_Ignored(SocketImplementationType type) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BufferMixedBuffers_ZeroCountBufferIgnored(SocketImplementationType type) { SendPacketsElement[] elements = new SendPacketsElement[] @@ -228,7 +228,7 @@ public void BufferMixedBuffers_ZeroCountBufferIgnored(SocketImplementationType t [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void BufferZeroCountThenNormal_ZeroCountIgnored(SocketImplementationType type) { Assert.True(Capability.IPv6Support()); @@ -284,7 +284,7 @@ public void BufferZeroCountThenNormal_ZeroCountIgnored(SocketImplementationType [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_EmptyFileName_Throws(SocketImplementationType type) { Assert.Throws(() => @@ -296,7 +296,7 @@ public void SendPacketsElement_EmptyFileName_Throws(SocketImplementationType typ [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_BlankFileName_Throws(SocketImplementationType type) { Assert.Throws(() => @@ -309,7 +309,7 @@ public void SendPacketsElement_BlankFileName_Throws(SocketImplementationType typ [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_BadCharactersFileName_Throws(SocketImplementationType type) { Assert.Throws(() => @@ -322,7 +322,7 @@ public void SendPacketsElement_BadCharactersFileName_Throws(SocketImplementation [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_MissingDirectoryName_Throws(SocketImplementationType type) { Assert.Throws(() => @@ -335,7 +335,7 @@ public void SendPacketsElement_MissingDirectoryName_Throws(SocketImplementationT [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_MissingFile_Throws(SocketImplementationType type) { Assert.Throws(() => @@ -348,7 +348,7 @@ public void SendPacketsElement_MissingFile_Throws(SocketImplementationType type) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_File_Success(SocketImplementationType type) { SendPackets(type, new SendPacketsElement(TestFileName), s_testFileSize); // Whole File @@ -357,7 +357,7 @@ public void SendPacketsElement_File_Success(SocketImplementationType type) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_FileZeroCount_Success(SocketImplementationType type) { SendPackets(type, new SendPacketsElement(TestFileName, 0, 0), s_testFileSize); // Whole File @@ -366,7 +366,7 @@ public void SendPacketsElement_FileZeroCount_Success(SocketImplementationType ty [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_FilePart_Success(SocketImplementationType type) { SendPackets(type, new SendPacketsElement(TestFileName, 10, 20), 20); @@ -375,7 +375,7 @@ public void SendPacketsElement_FilePart_Success(SocketImplementationType type) [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_FileMultiPart_Success(SocketImplementationType type) { SendPacketsElement[] elements = new SendPacketsElement[] @@ -390,7 +390,7 @@ public void SendPacketsElement_FileMultiPart_Success(SocketImplementationType ty [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_FileLargeOffset_Throws(SocketImplementationType type) { // Length is validated on Send @@ -400,7 +400,7 @@ public void SendPacketsElement_FileLargeOffset_Throws(SocketImplementationType t [Theory] [InlineData(SocketImplementationType.APM)] [InlineData(SocketImplementationType.Async)] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void SendPacketsElement_FileLargeCount_Throws(SocketImplementationType type) { // Length is validated on Send diff --git a/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs index ae350c016690..d3fdee52a6a4 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs @@ -113,7 +113,7 @@ public async Task MulticastInterface_Set_AnyInterface_Succeeds() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.Windows)] // see comment below + [PlatformSpecific(TestPlatforms.Windows)] // see comment below public async Task MulticastInterface_Set_Loopback_Succeeds() { // On Windows, we can apparently assume interface 1 is "loopback." On other platforms, this is not a @@ -281,7 +281,7 @@ public void ReuseAddress(bool? exclusiveAddressUse, bool? firstSocketReuseAddres } [Theory] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [InlineData(false, null, null, true)] [InlineData(false, null, false, true)] [InlineData(false, false, null, true)] diff --git a/src/System.Net.Sockets/tests/FunctionalTests/TcpClientTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/TcpClientTest.cs index d4e0544a82e6..0ef07a55ff62 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/TcpClientTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/TcpClientTest.cs @@ -87,7 +87,7 @@ public void ConnectedAvailable_NullClient() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void ExclusiveAddressUse_NullClient_Windows() { using (TcpClient client = new TcpClient()) @@ -100,7 +100,7 @@ public void ExclusiveAddressUse_NullClient_Windows() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(~PlatformID.Windows)] + [PlatformSpecific(~TestPlatforms.Windows)] public void ExclusiveAddressUse_NullClient_NonWindows() { using (TcpClient client = new TcpClient()) @@ -122,7 +122,7 @@ public void Roundtrip_ExclusiveAddressUse_GetEqualsSet_True() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Roundtrip_ExclusiveAddressUse_GetEqualsSet_False() { using (TcpClient client = new TcpClient()) @@ -134,7 +134,7 @@ public void Roundtrip_ExclusiveAddressUse_GetEqualsSet_False() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void ExclusiveAddressUse_Set_False_NotSupported() { using (TcpClient client = new TcpClient()) diff --git a/src/System.Net.Sockets/tests/FunctionalTests/UdpClientTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/UdpClientTest.cs index a5171107c1b5..c4fc5560364a 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/UdpClientTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/UdpClientTest.cs @@ -71,7 +71,7 @@ public void Client_Idempotent() [OuterLoop] // TODO: Issue #11345 [Fact] - [ActiveIssue(9189, PlatformID.AnyUnix)] + [ActiveIssue(9189, TestPlatforms.AnyUnix)] public async Task ConnectAsync_StringHost_Success() { using (var c = new UdpClient()) @@ -92,7 +92,7 @@ public async Task ConnectAsync_IPAddressHost_Success() [OuterLoop] // TODO: Issue #11345 [Fact] - [ActiveIssue(9189, PlatformID.AnyUnix)] + [ActiveIssue(9189, TestPlatforms.AnyUnix)] public void Connect_StringHost_Success() { using (var c = new UdpClient()) diff --git a/src/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs b/src/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs index 7ccb109e022e..82fb41fe281a 100644 --- a/src/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs +++ b/src/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs @@ -25,7 +25,7 @@ public UnixDomainSocketTest(ITestOutputHelper output) [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Socket_CreateUnixDomainSocket_Throws_OnWindows() { SocketException e = Assert.Throws(() => new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)); @@ -34,7 +34,7 @@ public void Socket_CreateUnixDomainSocket_Throws_OnWindows() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() { string path = null; @@ -89,7 +89,7 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_Success() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() { string path = GetRandomNonExistingFilePath(); @@ -123,7 +123,7 @@ public async Task Socket_ConnectAsyncUnixDomainSocketEndPoint_NotServer() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Socket_SendReceive_Success() { string path = GetRandomNonExistingFilePath(); @@ -162,7 +162,7 @@ public void Socket_SendReceive_Success() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public async Task Socket_SendReceiveAsync_Success() { string path = GetRandomNonExistingFilePath(); @@ -201,7 +201,7 @@ public async Task Socket_SendReceiveAsync_Success() [OuterLoop] // TODO: Issue #11345 [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void ConcurrentSendReceive() { using (Socket server = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)) diff --git a/src/System.Net.Sockets/tests/PerformanceTests/SocketPerformanceAsyncTests.cs b/src/System.Net.Sockets/tests/PerformanceTests/SocketPerformanceAsyncTests.cs index 647c5e4e9965..96babb9eb314 100644 --- a/src/System.Net.Sockets/tests/PerformanceTests/SocketPerformanceAsyncTests.cs +++ b/src/System.Net.Sockets/tests/PerformanceTests/SocketPerformanceAsyncTests.cs @@ -20,7 +20,7 @@ public SocketPerformanceAsyncTests(ITestOutputHelper output) _log = TestLogging.GetInstance(); } - [ActiveIssue(8768, PlatformID.AnyUnix)] + [ActiveIssue(8768, TestPlatforms.AnyUnix)] [OuterLoop] [Fact] public void SocketPerformance_SingleSocketClientAsync_LocalHostServerAsync() @@ -42,7 +42,7 @@ public void SocketPerformance_SingleSocketClientAsync_LocalHostServerAsync() socket_instances); } - [ActiveIssue(8768, PlatformID.AnyUnix)] + [ActiveIssue(8768, TestPlatforms.AnyUnix)] [OuterLoop] [Fact] public void SocketPerformance_MultipleSocketClientAsync_LocalHostServerAsync() diff --git a/src/System.Reflection.Emit/tests/Utilities.cs b/src/System.Reflection.Emit/tests/Utilities.cs index 3caf4a962395..06b5ec94cc13 100644 --- a/src/System.Reflection.Emit/tests/Utilities.cs +++ b/src/System.Reflection.Emit/tests/Utilities.cs @@ -71,7 +71,7 @@ public static void VerifyType(TypeBuilder type, Module module, TypeBuilder decla Assert.Equal(createdType, module.GetType(name, false, false)); Assert.Equal(createdType, module.GetType(name, true, false)); - // [ActiveIssue(10989, PlatformID.AnyUnix)] + // [ActiveIssue(10989, TestPlatforms.AnyUnix)] // Assert.Equal(createdType, module.GetType(name, true, true)); // Assert.Equal(createdType, module.GetType(name.ToLowerInvariant(), true, true)); // Assert.Equal(createdType, module.GetType(name.ToUpperInvariant(), true, true)); diff --git a/src/System.Reflection.Metadata/tests/PortableExecutable/DebugDirectoryTests.cs b/src/System.Reflection.Metadata/tests/PortableExecutable/DebugDirectoryTests.cs index bf2727827235..8d5b47250d3b 100644 --- a/src/System.Reflection.Metadata/tests/PortableExecutable/DebugDirectoryTests.cs +++ b/src/System.Reflection.Metadata/tests/PortableExecutable/DebugDirectoryTests.cs @@ -35,14 +35,14 @@ public void CodeView() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void CodeView_Loaded() { LoaderUtilities.LoadPEAndValidate(Misc.Debug, ValidateCodeView); } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void CodeView_Loaded_FromStream() { LoaderUtilities.LoadPEAndValidate(Misc.Debug, ValidateCodeView, useStream: true); @@ -85,7 +85,7 @@ public void Deterministic() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void Deterministic_Loaded() { LoaderUtilities.LoadPEAndValidate(Misc.Deterministic, ValidateDeterministic); @@ -133,14 +133,14 @@ private void ValidateDeterministic(PEReader reader) } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void EmbeddedPortablePdb_Loaded() { LoaderUtilities.LoadPEAndValidate(PortablePdbs.DocumentsEmbeddedDll, ValidateEmbeddedPortablePdb); } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void EmbeddedPortablePdb_Loaded_FromStream() { LoaderUtilities.LoadPEAndValidate(PortablePdbs.DocumentsEmbeddedDll, ValidateEmbeddedPortablePdb, useStream: true); diff --git a/src/System.Reflection.Metadata/tests/PortableExecutable/PEReaderTests.cs b/src/System.Reflection.Metadata/tests/PortableExecutable/PEReaderTests.cs index 20b7842ce549..9cbd4027da22 100644 --- a/src/System.Reflection.Metadata/tests/PortableExecutable/PEReaderTests.cs +++ b/src/System.Reflection.Metadata/tests/PortableExecutable/PEReaderTests.cs @@ -204,7 +204,7 @@ public void EntireImage_EagerLoad() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void GetMethodBody_Loaded() { LoaderUtilities.LoadPEAndValidate(Misc.Members, reader => @@ -228,7 +228,7 @@ public void GetSectionData() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void GetSectionData_Loaded() { LoaderUtilities.LoadPEAndValidate(Misc.Members, ValidateSectionData); diff --git a/src/System.Runtime.Extensions/tests/System/Environment.GetEnvironmentVariable.cs b/src/System.Runtime.Extensions/tests/System/Environment.GetEnvironmentVariable.cs index 8e9acbfcfe34..e5add5ba72e4 100644 --- a/src/System.Runtime.Extensions/tests/System/Environment.GetEnvironmentVariable.cs +++ b/src/System.Runtime.Extensions/tests/System/Environment.GetEnvironmentVariable.cs @@ -39,7 +39,7 @@ public void EmptyVariableReturnsNull() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] // GetEnvironmentVariable by design doesn't respect changes via setenv + [PlatformSpecific(TestPlatforms.Windows)] // GetEnvironmentVariable by design doesn't respect changes via setenv public void RandomLongVariableNameCanRoundTrip() { // NOTE: The limit of 32766 characters enforced by desktop diff --git a/src/System.Runtime.Extensions/tests/System/Environment.NewLine.cs b/src/System.Runtime.Extensions/tests/System/Environment.NewLine.cs index 3cff98ca1e01..a5cdcf83c79b 100644 --- a/src/System.Runtime.Extensions/tests/System/Environment.NewLine.cs +++ b/src/System.Runtime.Extensions/tests/System/Environment.NewLine.cs @@ -8,14 +8,14 @@ namespace System.Tests { public class EnvironmentNewLine { - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void Windows_NewLineTest() { Assert.Equal("\r\n", Environment.NewLine); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void Unix_NewLineTest() { diff --git a/src/System.Runtime.Extensions/tests/System/Environment.ProcessorCount.cs b/src/System.Runtime.Extensions/tests/System/Environment.ProcessorCount.cs index 4be494b75a1b..7fcfb0b255dd 100644 --- a/src/System.Runtime.Extensions/tests/System/Environment.ProcessorCount.cs +++ b/src/System.Runtime.Extensions/tests/System/Environment.ProcessorCount.cs @@ -9,7 +9,7 @@ namespace System.Tests { public class EnvironmentProcessorCount { - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void Windows_ProcessorCountTest() { @@ -26,7 +26,7 @@ public void Windows_ProcessorCountTest() Assert.Equal(expected, actual); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void Unix_ProcessorCountTest() { diff --git a/src/System.Runtime.Extensions/tests/System/EnvironmentTests.cs b/src/System.Runtime.Extensions/tests/System/EnvironmentTests.cs index b7a1797cde45..4168a0bb7747 100644 --- a/src/System.Runtime.Extensions/tests/System/EnvironmentTests.cs +++ b/src/System.Runtime.Extensions/tests/System/EnvironmentTests.cs @@ -98,7 +98,7 @@ public void Is64BitOperatingSystem_TrueIf64BitProcess() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void Is64BitOperatingSystem_Unix_TrueIff64BitProcess() { Assert.Equal(Environment.Is64BitProcess, Environment.Is64BitOperatingSystem); @@ -161,7 +161,7 @@ public void UserDomainName_Valid() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void UserDomainName_Unix_MatchesMachineName() { Assert.Equal(Environment.MachineName, Environment.UserDomainName); @@ -198,7 +198,7 @@ public void FailFast_ExpectFailureExitCode() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void GetFolderPath_Unix_PersonalIsHomeAndUserProfile() { Assert.Equal(Environment.GetEnvironmentVariable("HOME"), Environment.GetFolderPath(Environment.SpecialFolder.Personal)); @@ -207,7 +207,7 @@ public void GetFolderPath_Unix_PersonalIsHomeAndUserProfile() } [Theory] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [InlineData(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.None)] [InlineData(Environment.SpecialFolder.Personal, Environment.SpecialFolderOption.None)] [InlineData(Environment.SpecialFolder.MyDocuments, Environment.SpecialFolderOption.None)] @@ -232,7 +232,7 @@ public void GetFolderPath_Unix_NonEmptyFolderPaths(Environment.SpecialFolder fol } [Theory] - [PlatformSpecific(Xunit.PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] [InlineData(Environment.SpecialFolder.Favorites, Environment.SpecialFolderOption.DoNotVerify)] [InlineData(Environment.SpecialFolder.InternetCache, Environment.SpecialFolderOption.DoNotVerify)] [InlineData(Environment.SpecialFolder.ProgramFiles, Environment.SpecialFolderOption.None)] @@ -294,7 +294,7 @@ public void GetFolderPath_OSX_NonEmptyFolderPaths(Environment.SpecialFolder fold // [InlineData(Environment.SpecialFolder.LocalizedResources)] [InlineData(Environment.SpecialFolder.SystemX86)] [InlineData(Environment.SpecialFolder.Windows)] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public unsafe void GetFolderPath_Windows(Environment.SpecialFolder folder) { string knownFolder = Environment.GetFolderPath(folder); @@ -308,7 +308,7 @@ public unsafe void GetFolderPath_Windows(Environment.SpecialFolder folder) } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void GetLogicalDrives_Unix_AtLeastOneIsRoot() { string[] drives = Environment.GetLogicalDrives(); @@ -319,7 +319,7 @@ public void GetLogicalDrives_Unix_AtLeastOneIsRoot() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public void GetLogicalDrives_Windows_MatchesExpectedLetters() { string[] drives = Environment.GetLogicalDrives(); diff --git a/src/System.Runtime.Extensions/tests/System/IO/Path.Combine.cs b/src/System.Runtime.Extensions/tests/System/IO/Path.Combine.cs index f403bdb82a22..91980393c498 100644 --- a/src/System.Runtime.Extensions/tests/System/IO/Path.Combine.cs +++ b/src/System.Runtime.Extensions/tests/System/IO/Path.Combine.cs @@ -141,7 +141,7 @@ public static void ContainsInvalidCharWithoutRootedAfterArgumentNull() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void ContainsInvalidCharWithoutRootedAfterArgumentNull_Windows() { //any path contains invalid character without rooted after (AE) @@ -159,7 +159,7 @@ public static void ContainsInvalidCharWithRootedAfterArgumentNull() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void ContainsInvalidCharWithRootedAfterArgumentNull_Windows() { //any path contains invalid character with rooted after (AE) diff --git a/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs b/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs index 747d7314b8b6..5f8107c58482 100644 --- a/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs +++ b/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs @@ -29,7 +29,7 @@ public static class GetRelativePathTests [InlineData(@"C:\a", @"C:\ab", @"..\ab")] [InlineData(@"C:\", @"\\LOCALHOST\Share\b", @"\\LOCALHOST\Share\b")] [InlineData(@"\\LOCALHOST\Share\a", @"\\LOCALHOST\Share\b", @"..\b")] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void GetRelativePath_Windows(string relativeTo, string path, string expected) { string result = Path.GetRelativePath(relativeTo, path); @@ -56,7 +56,7 @@ public static void GetRelativePath_Windows(string relativeTo, string path, strin [InlineData(@"/a/", @"/a/b", @"b")] [InlineData(@"/ab", @"/a", @"../a")] [InlineData(@"/a", @"/ab", @"../ab")] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void GetRelativePath_AnyUnix(string relativeTo, string path, string expected) { string result = Path.GetRelativePath(relativeTo, path); @@ -72,7 +72,7 @@ public static void GetRelativePath_AnyUnix(string relativeTo, string path, strin [InlineData(@"/a", @"/A/", @"../A/")] [InlineData(@"/a/", @"/A", @"../A")] [InlineData(@"/a/", @"/A/b", @"../A/b")] - [PlatformSpecific(Xunit.PlatformID.Linux)] + [PlatformSpecific(TestPlatforms.Linux)] public static void GetRelativePath_Linux(string relativeTo, string path, string expected) { string result = Path.GetRelativePath(relativeTo, path); @@ -88,7 +88,7 @@ public static void GetRelativePath_Linux(string relativeTo, string path, string [InlineData(@"/a", @"/A/", @"../A/")] [InlineData(@"/a/", @"/A", @"../A")] [InlineData(@"/a/", @"/A/b", @"../A/b")] - [PlatformSpecific(Xunit.PlatformID.FreeBSD)] + [PlatformSpecific(TestPlatforms.FreeBSD)] public static void GetRelativePath_FreeBSD(string relativeTo, string path, string expected) { string result = Path.GetRelativePath(relativeTo, path); @@ -104,7 +104,7 @@ public static void GetRelativePath_FreeBSD(string relativeTo, string path, strin [InlineData(@"/a", @"/A/", @"../A/")] [InlineData(@"/a/", @"/A", @"../A")] [InlineData(@"/a/", @"/A/b", @"../A/b")] - [PlatformSpecific(Xunit.PlatformID.NetBSD)] + [PlatformSpecific(TestPlatforms.NetBSD)] public static void GetRelativePath_NetBSD(string relativeTo, string path, string expected) { string result = Path.GetRelativePath(relativeTo, path); @@ -120,7 +120,7 @@ public static void GetRelativePath_NetBSD(string relativeTo, string path, string [InlineData(@"/a", @"/A/", @".")] [InlineData(@"/a/", @"/A", @".")] [InlineData(@"/a/", @"/A/b", @"b")] - [PlatformSpecific(Xunit.PlatformID.OSX)] + [PlatformSpecific(TestPlatforms.OSX)] public static void GetRelativePath_Mac(string relativeTo, string path, string expected) { string result = Path.GetRelativePath(relativeTo, path); diff --git a/src/System.Runtime.Extensions/tests/System/IO/PathTests.cs b/src/System.Runtime.Extensions/tests/System/IO/PathTests.cs index b72e7f3b4422..458f05890973 100644 --- a/src/System.Runtime.Extensions/tests/System/IO/PathTests.cs +++ b/src/System.Runtime.Extensions/tests/System/IO/PathTests.cs @@ -55,7 +55,7 @@ public static void GetDirectoryName(string path, string expected) [InlineData(@"..\..\files.txt", @"..\..")] [InlineData(@"C:\", null)] [InlineData(@"C:", null)] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void GetDirectoryName_Windows(string path, string expected) { Assert.Equal(expected, Path.GetDirectoryName(path)); @@ -68,7 +68,7 @@ public static void GetDirectoryName_Windows(string path, string expected) [InlineData(@"dir/baz/bar", @"dir/baz")] [InlineData(@"../../files.txt", @"../..")] [InlineData(@"/", null)] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void GetDirectoryName_Unix(string path, string expected) { Assert.Equal(expected, Path.GetDirectoryName(path)); @@ -82,7 +82,7 @@ public static void GetDirectoryName_CurrentDirectory() Assert.Equal(null, Path.GetDirectoryName(Path.GetPathRoot(curDir))); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public static void GetDirectoryName_ControlCharacters_Unix() { @@ -110,7 +110,7 @@ public static void GetExtension(string path, string expected) Assert.Equal(!string.IsNullOrEmpty(expected), Path.HasExtension(path)); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [InlineData("file.e xe", ".e xe")] [InlineData("file. ", ". ")] @@ -143,7 +143,7 @@ public static void GetFileName(string path, string expected) Assert.Equal(expected, Path.GetFileName(path)); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public static void GetFileName_Unix() { @@ -185,7 +185,7 @@ public static void GetPathRoot() Assert.False(Path.IsPathRooted("file.exe")); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(@"\\test\unc\path\to\something", @"\\test\unc")] [InlineData(@"\\a\b\c\d\e", @"\\a\b")] @@ -203,7 +203,7 @@ public static void GetPathRoot_Windows_UncAndExtended(string value, string expec Assert.Equal(expected, Path.GetPathRoot(value)); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(@"C:", @"C:")] [InlineData(@"C:\", @"C:\")] @@ -218,7 +218,7 @@ public static void GetPathRoot_Windows(string value, string expected) Assert.Equal(expected, Path.GetPathRoot(value)); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public static void GetPathRoot_Unix() { @@ -304,7 +304,7 @@ public static void GetTempPath_Default() Assert.True(Directory.Exists(tmpPath)); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(@"C:\Users\someuser\AppData\Local\Temp\", @"C:\Users\someuser\AppData\Local\Temp")] [InlineData(@"C:\Users\someuser\AppData\Local\Temp\", @"C:\Users\someuser\AppData\Local\Temp\")] @@ -316,7 +316,7 @@ public static void GetTempPath_SetEnvVar_Windows(string expected, string newTemp GetTempPath_SetEnvVar("TMP", expected, newTempPath); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [InlineData("/tmp/", "/tmp")] [InlineData("/tmp/", "/tmp/")] @@ -413,7 +413,7 @@ public static void GetFullPath_BasicExpansions(string path, string expected) Assert.Equal(expected, Path.GetFullPath(path)); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public static void GetFullPath_Unix_Whitespace() { @@ -423,7 +423,7 @@ public static void GetFullPath_Unix_Whitespace() Assert.Equal(Path.Combine(curDir, "\r\n"), Path.GetFullPath("\r\n")); } - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Theory] [InlineData("http://www.microsoft.com")] [InlineData("file://somefile")] @@ -435,7 +435,7 @@ public static void GetFullPath_Unix_URIsAsFileNames(string uriAsFileName) Path.GetFullPath(uriAsFileName)); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public static void GetFullPath_Windows_NormalizedLongPathTooLong() { @@ -452,7 +452,7 @@ public static void GetFullPath_Windows_NormalizedLongPathTooLong() Assert.NotNull(Path.GetFullPath(longPath.ToString())); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public static void GetFullPath_Windows_AlternateDataStreamsNotSupported() { @@ -461,7 +461,7 @@ public static void GetFullPath_Windows_AlternateDataStreamsNotSupported() Assert.Throws(() => Path.GetFullPath(@"C:\some\bad:path")); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public static void GetFullPath_Windows_URIFormatNotSupported() { @@ -470,7 +470,7 @@ public static void GetFullPath_Windows_URIFormatNotSupported() Assert.Throws(() => Path.GetFullPath("file://www.microsoft.com")); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(@"bad::$DATA")] [InlineData(@"C :")] @@ -481,7 +481,7 @@ public static void GetFullPath_Windows_NotSupportedExceptionPaths(string path) Assert.Throws(() => Path.GetFullPath(path)); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(@"C:...")] [InlineData(@"C:...\somedir")] @@ -495,7 +495,7 @@ public static void GetFullPath_Windows_LegacyArgumentExceptionPaths(string path) Path.GetFullPath(path); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public static void GetFullPath_Windows_MaxPathNotTooLong() { @@ -503,14 +503,14 @@ public static void GetFullPath_Windows_MaxPathNotTooLong() Path.GetFullPath(@"C:\" + new string('a', 255) + @"\"); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public static void GetFullPath_Windows_PathTooLong() { Assert.Throws(() => Path.GetFullPath(@"C:\" + new string('a', short.MaxValue) + @"\")); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(@"C:\", @"C:\")] [InlineData(@"C:\.", @"C:\")] @@ -523,7 +523,7 @@ public static void GetFullPath_Windows_RelativeRoot(string path, string expected Assert.Equal(Path.GetFullPath(path), expected); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public static void GetFullPath_Windows_StrangeButLegalPaths() { @@ -542,7 +542,7 @@ public static void GetFullPath_Windows_StrangeButLegalPaths() Path.GetFullPath(curDir + Path.DirectorySeparatorChar + ".. " + Path.DirectorySeparatorChar)); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(@"\\?\C:\ ")] [InlineData(@"\\?\C:\ \ ")] @@ -599,7 +599,7 @@ public static void GetFullPath_Windows_ValidExtendedPaths(string path) } } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] // https://github.com/dotnet/corefx/issues/11965 [InlineData(@"\\LOCALHOST\share\test.txt.~SS", @"\\LOCALHOST\share\test.txt.~SS")] @@ -630,7 +630,7 @@ public static void GetFullPath_Windows_UNC_Valid(string expected, string input) Assert.Equal(expected, Path.GetFullPath(input)); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(@"\\")] [InlineData(@"\\LOCALHOST")] @@ -642,7 +642,7 @@ public static void GetFullPath_Windows_UNC_Invalid(string invalidPath) Assert.Throws(() => Path.GetFullPath(invalidPath)); } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsNanoServer))] public static void GetFullPath_Windows_83Paths() { @@ -687,7 +687,7 @@ public static void GetFullPath_Windows_83Paths() } } - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData('*')] [InlineData('?')] diff --git a/src/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.cs b/src/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.cs index 216a119a04ca..c61ce733226b 100644 --- a/src/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.cs +++ b/src/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.cs @@ -9,7 +9,7 @@ namespace System.Runtime.InteropServices.RuntimeInformationTests { public class CheckPlatformTests { - [Fact, PlatformSpecific(PlatformID.Linux)] + [Fact, PlatformSpecific(TestPlatforms.Linux)] public void CheckLinux() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Linux)); @@ -27,7 +27,7 @@ public void CheckLinux() Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); } - [Fact, PlatformSpecific(PlatformID.NetBSD)] + [Fact, PlatformSpecific(TestPlatforms.NetBSD)] public void CheckNetBSD() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))); @@ -45,7 +45,7 @@ public void CheckNetBSD() Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); } - [Fact, PlatformSpecific(PlatformID.OSX)] + [Fact, PlatformSpecific(TestPlatforms.OSX)] public void CheckOSX() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.OSX)); @@ -63,7 +63,7 @@ public void CheckOSX() Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); } - [Fact, PlatformSpecific(PlatformID.Windows)] + [Fact, PlatformSpecific(TestPlatforms.Windows)] public void CheckWindows() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); diff --git a/src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs b/src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs index 71d6e76960b0..42084ec19acd 100644 --- a/src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs +++ b/src/System.Runtime.InteropServices.RuntimeInformation/tests/DescriptionNameTests.cs @@ -46,25 +46,25 @@ public void VerifyOSDescription() Assert.Same(RuntimeInformation.OSDescription, RuntimeInformation.OSDescription); } - [Fact, PlatformSpecific(PlatformID.Windows)] + [Fact, PlatformSpecific(TestPlatforms.Windows)] public void VerifyWindowsDebugName() { Assert.Contains("windows", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase); } - [Fact, PlatformSpecific(PlatformID.Linux)] + [Fact, PlatformSpecific(TestPlatforms.Linux)] public void VerifyLinuxDebugName() { Assert.Contains("linux", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase); } - [Fact, PlatformSpecific(PlatformID.NetBSD)] + [Fact, PlatformSpecific(TestPlatforms.NetBSD)] public void VerifyNetBSDDebugName() { Assert.Contains("netbsd", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase); } - [Fact, PlatformSpecific(PlatformID.OSX)] + [Fact, PlatformSpecific(TestPlatforms.OSX)] public void VerifyOSXDebugName() { Assert.Contains("darwin", RuntimeInformation.OSDescription, StringComparison.OrdinalIgnoreCase); diff --git a/src/System.Runtime.Numerics/tests/ComplexTests.cs b/src/System.Runtime.Numerics/tests/ComplexTests.cs index dd6fb96ca12e..d104363a3ca4 100644 --- a/src/System.Runtime.Numerics/tests/ComplexTests.cs +++ b/src/System.Runtime.Numerics/tests/ComplexTests.cs @@ -764,7 +764,7 @@ public static void Exp(double real, double imaginary) VerifyRealImaginaryProperties(result, expected.Real, expected.Imaginary); } - [ActiveIssue(6022, PlatformID.AnyUnix)] + [ActiveIssue(6022, TestPlatforms.AnyUnix)] [Fact] public static void Exp_MaxReal() { diff --git a/src/System.Runtime/tests/System/GCTests.cs b/src/System.Runtime/tests/System/GCTests.cs index ff06d5fe1ab2..800ae6e3c4d7 100644 --- a/src/System.Runtime/tests/System/GCTests.cs +++ b/src/System.Runtime/tests/System/GCTests.cs @@ -398,7 +398,7 @@ public static void LatencyRoundtrips(GCLatencyMode value) } [Theory] - [PlatformSpecific(Xunit.PlatformID.Windows)] //Concurent GC is not enabled on Unix. Recombine to TestLatencyRoundTrips once addressed. + [PlatformSpecific(TestPlatforms.Windows)] //Concurent GC is not enabled on Unix. Recombine to TestLatencyRoundTrips once addressed. [InlineData(GCLatencyMode.LowLatency)] [InlineData(GCLatencyMode.SustainedLowLatency)] public static void LatencyRoundtrips_LowLatency(GCLatencyMode value) => LatencyRoundtrips(value); diff --git a/src/System.Runtime/tests/System/StringTests.cs b/src/System.Runtime/tests/System/StringTests.cs index 7df1c73d3798..30f3257cdc67 100644 --- a/src/System.Runtime/tests/System/StringTests.cs +++ b/src/System.Runtime/tests/System/StringTests.cs @@ -802,7 +802,7 @@ public static void EndsWith(string s, string value, StringComparison comparisonT } [Theory] - [ActiveIssue("dotnet/coreclr#2051", Xunit.PlatformID.AnyUnix)] + [ActiveIssue("dotnet/coreclr#2051", TestPlatforms.AnyUnix)] [InlineData(StringComparison.CurrentCulture)] [InlineData(StringComparison.CurrentCultureIgnoreCase)] [InlineData(StringComparison.Ordinal)] @@ -1220,7 +1220,7 @@ private static bool IsSafeForCurrentCultureComparisons(string str) } [Theory] - [ActiveIssue("dotnet/coreclr#2051", Xunit.PlatformID.AnyUnix)] + [ActiveIssue("dotnet/coreclr#2051", TestPlatforms.AnyUnix)] [InlineData("He\0lo", "He\0lo", 0)] [InlineData("He\0lo", "He\0", 0)] [InlineData("He\0lo", "\0", 2)] @@ -1679,7 +1679,7 @@ public static void LastIndexOf_SingleLetter(string s, char value, int startIndex } [Theory] - [ActiveIssue("dotnet/coreclr#2051", Xunit.PlatformID.AnyUnix)] + [ActiveIssue("dotnet/coreclr#2051", TestPlatforms.AnyUnix)] [InlineData("He\0lo", "He\0lo", 0)] [InlineData("He\0lo", "He\0", 0)] [InlineData("He\0lo", "\0", 2)] @@ -2073,7 +2073,7 @@ public static void StartsWith(string s, string value, StringComparison compariso } [Theory] - [ActiveIssue("dotnet/coreclr#2051", Xunit.PlatformID.AnyUnix)] + [ActiveIssue("dotnet/coreclr#2051", TestPlatforms.AnyUnix)] [InlineData(StringComparison.CurrentCulture)] [InlineData(StringComparison.CurrentCultureIgnoreCase)] [InlineData(StringComparison.Ordinal)] diff --git a/src/System.Runtime/tests/System/Threading/WaitHandleTests.cs b/src/System.Runtime/tests/System/Threading/WaitHandleTests.cs index 68dc94f3af5c..892490a3042a 100644 --- a/src/System.Runtime/tests/System/Threading/WaitHandleTests.cs +++ b/src/System.Runtime/tests/System/Threading/WaitHandleTests.cs @@ -84,7 +84,7 @@ public static void WaitAll_SameHandles() } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] // names aren't supported on Unix + [PlatformSpecific(TestPlatforms.Windows)] // names aren't supported on Unix public static void WaitAll_SameNames() { Mutex[] wh = new Mutex[2]; diff --git a/src/System.Runtime/tests/System/Threading/WaitHandleTests.netstandard1.7.cs b/src/System.Runtime/tests/System/Threading/WaitHandleTests.netstandard1.7.cs index 61b059813404..4483929ff515 100644 --- a/src/System.Runtime/tests/System/Threading/WaitHandleTests.netstandard1.7.cs +++ b/src/System.Runtime/tests/System/Threading/WaitHandleTests.netstandard1.7.cs @@ -110,7 +110,7 @@ public static IEnumerable SignalAndWait_MemberData() [Theory] [MemberData(nameof(SignalAndWait_MemberData))] - [PlatformSpecific(Xunit.PlatformID.Windows)] // other platforms don't support SignalAndWait + [PlatformSpecific(TestPlatforms.Windows)] // other platforms don't support SignalAndWait private static void SignalAndWait( WaitHandle toSignal, AutoResetEvent toWaitOn, @@ -155,7 +155,7 @@ private static void SignalAndWait( } [Fact] - [PlatformSpecific(Xunit.PlatformID.Windows)] // other platforms don't support SignalAndWait + [PlatformSpecific(TestPlatforms.Windows)] // other platforms don't support SignalAndWait public static void SignalAndWait_InvalidArgs() { var toSignal = new ManualResetEvent(false); @@ -180,7 +180,7 @@ public static void SignalAndWait_InvalidArgs() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void SignalAndWait_PlatformNotSupported() { var toSignal = new ManualResetEvent(false); diff --git a/src/System.Runtime/tests/System/TimeZoneInfoTests.cs b/src/System.Runtime/tests/System/TimeZoneInfoTests.cs index 11fc790ffe06..da8a5c333a5c 100644 --- a/src/System.Runtime/tests/System/TimeZoneInfoTests.cs +++ b/src/System.Runtime/tests/System/TimeZoneInfoTests.cs @@ -1668,7 +1668,7 @@ public static void IsInvalidTime() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void IsDaylightSavingTime_CatamarcaMultiYearDaylightSavings() { // America/Catamarca had DST from @@ -1691,7 +1691,7 @@ public static void IsDaylightSavingTime_CatamarcaMultiYearDaylightSavings() } [Theory] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [InlineData("1940-02-24T23:59:59.0000000Z", false, "0:00:00")] [InlineData("1940-02-25T00:00:00.0000000Z", true, "1:00:00")] [InlineData("1940-11-20T00:00:00.0000000Z", true, "1:00:00")] @@ -1715,7 +1715,7 @@ public static void IsDaylightSavingTime_CasablancaMultiYearDaylightSavings(strin } [Theory] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] // in 1996 Europe/Lisbon changed from standard time to DST without changing the UTC offset [InlineData("1995-09-30T17:00:00.0000000Z", false, "1:00:00")] [InlineData("1996-03-31T00:59:59.0000000Z", false, "1:00:00")] @@ -1832,7 +1832,7 @@ public static void DaylightTransitionsExactTime() /// See https://github.com/dotnet/coreclr/issues/2185 /// [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void DaylightTransitionsExactTime_Johannesburg() { DateTimeOffset transition = new DateTimeOffset(1943, 3, 20, 23, 0, 0, TimeSpan.Zero); diff --git a/src/System.Runtime/tests/System/Uri.MethodsTests.cs b/src/System.Runtime/tests/System/Uri.MethodsTests.cs index 65d7590ad849..d940f971a5f4 100644 --- a/src/System.Runtime/tests/System/Uri.MethodsTests.cs +++ b/src/System.Runtime/tests/System/Uri.MethodsTests.cs @@ -480,7 +480,7 @@ public static IEnumerable GetComponents_Basic_TestData() Uri invalidPunicodeUri = new Uri("http://xn--\u1234pck.com"); yield return new object[] { invalidPunicodeUri, UriComponents.Host, "xn--\u1234pck.com" }; - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // TODO: [ActiveIssue(8242, PlatformID.AnyUnix)] + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // TODO: [ActiveIssue(8242, TestPlatforms.AnyUnix)] { yield return new object[] { invalidPunicodeUri, UriComponents.NormalizedHost, "xn--\u1234pck.com" }; } diff --git a/src/System.Runtime/tests/TimeZoneInfoTests.netstandard1.7.cs b/src/System.Runtime/tests/TimeZoneInfoTests.netstandard1.7.cs index 50b4d067ba81..f237dba58fc7 100644 --- a/src/System.Runtime/tests/TimeZoneInfoTests.netstandard1.7.cs +++ b/src/System.Runtime/tests/TimeZoneInfoTests.netstandard1.7.cs @@ -116,7 +116,7 @@ public static void ConvertTimeFromToUtc() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void ConvertTimeFromToUtc_UnixOnly() { // DateTime Kind is Local @@ -210,7 +210,7 @@ public static void CreateCustomTimeZone_InvalidTimeZone() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void HasSameRules_RomeAndVatican() { TimeZoneInfo rome = TimeZoneInfo.FindSystemTimeZoneById("Europe/Rome"); diff --git a/src/System.Security.Cryptography.Encoding/tests/Oid.cs b/src/System.Security.Cryptography.Encoding/tests/Oid.cs index bc2f000069eb..d5211e564581 100644 --- a/src/System.Security.Cryptography.Encoding/tests/Oid.cs +++ b/src/System.Security.Cryptography.Encoding/tests/Oid.cs @@ -175,7 +175,7 @@ public static void LookupOidByValue_Method_EncryptionAlgorithm(string oidValue, [Theory] [MemberData(nameof(ValidOidFriendlyNameHashAlgorithmPairs))] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void LookupOidByValue_Method_WrongGroup(string oidValue, string friendlyName) { // Oid group is implemented strictly - no fallback to OidGroup.All as with many other parts of Crypto. @@ -231,7 +231,7 @@ public static void LookupOidByFriendlyName_Method_InverseCase(string oidValue, s [Theory] [MemberData(nameof(ValidOidFriendlyNameHashAlgorithmPairs))] - [PlatformSpecific(Xunit.PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void LookupOidByFriendlyName_Method_WrongGroup(string oidValue, string friendlyName) { // Oid group is implemented strictly - no fallback to OidGroup.All as with many other parts of Crypto. @@ -253,7 +253,7 @@ public static void LookupOidByFriendlyName_Method_BadInput(string badInput) } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void LookupOidByValue_Method_UnixOnly() { // This needs to be an OID not in the static lookup table. The purpose is to verify the @@ -267,7 +267,7 @@ public static void LookupOidByValue_Method_UnixOnly() } [Fact] - [PlatformSpecific(Xunit.PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void LookupOidByFriendlyName_Method_UnixOnly() { // This needs to be a name not in the static lookup table. The purpose is to verify the diff --git a/src/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs index bf4924684711..e895ac877143 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs @@ -496,7 +496,7 @@ public static void ImportStoreSavedAsCerData() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void ImportStoreSavedAsSerializedCerData_Windows() { using (var pfxCer = new X509Certificate2(TestData.PfxData, TestData.PfxDataPassword)) @@ -520,7 +520,7 @@ public static void ImportStoreSavedAsSerializedCerData_Windows() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void ImportStoreSavedAsSerializedCerData_Unix() { X509Certificate2Collection cc2 = new X509Certificate2Collection(); @@ -529,7 +529,7 @@ public static void ImportStoreSavedAsSerializedCerData_Unix() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void ImportStoreSavedAsSerializedStoreData_Windows() { using (var msCer = new X509Certificate2(TestData.MsCertificate)) @@ -554,7 +554,7 @@ public static void ImportStoreSavedAsSerializedStoreData_Windows() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void ImportStoreSavedAsSerializedStoreData_Unix() { X509Certificate2Collection cc2 = new X509Certificate2Collection(); @@ -615,7 +615,7 @@ public static void ImportFromFileTests() } [Fact] - [ActiveIssue(2745, PlatformID.AnyUnix)] + [ActiveIssue(2745, TestPlatforms.AnyUnix)] public static void ImportMultiplePrivateKeysPfx() { using (ImportedCollection ic = Cert.Import(TestData.MultiPrivateKeyPfx)) @@ -638,14 +638,14 @@ public static void ExportCert() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void ExportSerializedCert_Windows() { TestExportSingleCert(X509ContentType.SerializedCert); } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void ExportSerializedCert_Unix() { using (var msCer = new X509Certificate2(TestData.MsCertificate)) @@ -657,14 +657,14 @@ public static void ExportSerializedCert_Unix() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void ExportSerializedStore_Windows() { TestExportStore(X509ContentType.SerializedStore); } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void ExportSerializedStore_Unix() { using (var msCer = new X509Certificate2(TestData.MsCertificate)) @@ -699,7 +699,7 @@ public static void ExportEmpty_Cert() } [Fact] - [ActiveIssue(2746, PlatformID.AnyUnix)] + [ActiveIssue(2746, TestPlatforms.AnyUnix)] public static void ExportEmpty_Pkcs12() { var collection = new X509Certificate2Collection(); @@ -775,7 +775,7 @@ public static void MultipleImport() } [Fact] - [ActiveIssue(2743, PlatformID.AnyUnix)] + [ActiveIssue(2743, TestPlatforms.AnyUnix)] public static void ExportMultiplePrivateKeys() { var collection = new X509Certificate2Collection(); @@ -798,7 +798,7 @@ public static void ExportMultiplePrivateKeys() } catch (PlatformNotSupportedException) { - // [ActiveIssue(2743, PlatformID.AnyUnix)] + // [ActiveIssue(2743, TestPlatforms.AnyUnix)] // Our Unix builds can't export more than one private key in a single PFX, so this is // their exit point. // diff --git a/src/System.Security.Cryptography.X509Certificates/tests/CtorTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/CtorTests.cs index f79ff5f285f3..b163d5cfb99f 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/CtorTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/CtorTests.cs @@ -77,7 +77,7 @@ public static void TestByteArrayConstructor_PEM() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void TestByteArrayConstructor_SerializedCert_Windows() { const string ExpectedThumbPrint = "71CB4E2B02738AD44F8B382C93BD17BA665F9914"; @@ -91,7 +91,7 @@ public static void TestByteArrayConstructor_SerializedCert_Windows() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void TestByteArrayConstructor_SerializedCert_Unix() { Assert.ThrowsAny(() => new X509Certificate2(TestData.StoreSavedAsSerializedCerData)); diff --git a/src/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs index 25aba2d75262..b9d944dd4ecb 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs @@ -20,7 +20,7 @@ public static void ExportAsCert() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void ExportAsSerializedCert_Windows() { using (X509Certificate2 c1 = new X509Certificate2(TestData.MsCertificate)) @@ -38,7 +38,7 @@ public static void ExportAsSerializedCert_Windows() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void ExportAsSerializedCert_Unix() { using (X509Certificate2 c1 = new X509Certificate2(TestData.MsCertificate)) diff --git a/src/System.Security.Cryptography.X509Certificates/tests/InteropTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/InteropTests.cs index d9a5374c2681..9cfaacde0d6d 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/InteropTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/InteropTests.cs @@ -11,7 +11,7 @@ namespace System.Security.Cryptography.X509Certificates.Tests public static class InteropTests { [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void TestHandle() { // @@ -42,7 +42,7 @@ public static void TestHandle() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void TestHandleCtor() { IntPtr pCertContext = IntPtr.Zero; diff --git a/src/System.Security.Cryptography.X509Certificates/tests/LoadFromFileTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/LoadFromFileTests.cs index c745cafe63af..9b05b8ae7d15 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/LoadFromFileTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/LoadFromFileTests.cs @@ -116,8 +116,8 @@ public static void TestGetPublicKey() } [Fact] - [ActiveIssue(2910, PlatformID.AnyUnix)] - [ActiveIssue(2667, PlatformID.Windows)] + [ActiveIssue(2910, TestPlatforms.AnyUnix)] + [ActiveIssue(2667, TestPlatforms.Windows)] public static void TestLoadSignedFile() { // X509Certificate2 can also extract the certificate from a signed file. diff --git a/src/System.Security.Cryptography.X509Certificates/tests/PropsTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/PropsTests.cs index 2eb3256f8abf..d7459a5c52d1 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/PropsTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/PropsTests.cs @@ -258,7 +258,7 @@ public static void TestContentType() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void TestArchive_Windows() { using (var c = new X509Certificate2(TestData.MsCertificate)) @@ -274,7 +274,7 @@ public static void TestArchive_Windows() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void TestArchive_Unix() { using (var c = new X509Certificate2(TestData.MsCertificate)) @@ -290,7 +290,7 @@ public static void TestArchive_Unix() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void TestFriendlyName_Windows() { using (var c = new X509Certificate2(TestData.MsCertificate)) @@ -306,7 +306,7 @@ public static void TestFriendlyName_Windows() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void TestFriendlyName_Unix() { using (var c = new X509Certificate2(TestData.MsCertificate)) diff --git a/src/System.Security.Cryptography.X509Certificates/tests/PublicKeyTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/PublicKeyTests.cs index 8f37435f16e9..6327f4010379 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/PublicKeyTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/PublicKeyTests.cs @@ -348,28 +348,28 @@ public static void TestECDsa224PublicKey() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void TestKey_ECDsaCng256() { TestKey_ECDsaCng(TestData.ECDsa256Certificate, TestData.ECDsaCng256PublicKey); } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void TestKey_ECDsaCng384() { TestKey_ECDsaCng(TestData.ECDsa384Certificate, TestData.ECDsaCng384PublicKey); } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void TestKey_ECDsaCng521() { TestKey_ECDsaCng(TestData.ECDsa521Certificate, TestData.ECDsaCng521PublicKey); } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void TestKey_BrainpoolP160r1() { if (PlatformDetection.WindowsVersion >= 10) diff --git a/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs index 05b60a3eb093..027823ffbde1 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs @@ -21,7 +21,7 @@ public static void PrintInvalidEncoding() } [Fact] - [ActiveIssue(3892, PlatformID.AnyUnix)] + [ActiveIssue(3892, TestPlatforms.AnyUnix)] public static void PrintMultiComponentRdn() { byte[] encoded = ( diff --git a/src/System.Security.Cryptography.X509Certificates/tests/X509StoreTests.cs b/src/System.Security.Cryptography.X509Certificates/tests/X509StoreTests.cs index f7e93287b34a..e4ee752794e2 100644 --- a/src/System.Security.Cryptography.X509Certificates/tests/X509StoreTests.cs +++ b/src/System.Security.Cryptography.X509Certificates/tests/X509StoreTests.cs @@ -155,7 +155,7 @@ public static void RemoveClosedThrows() } [Fact] - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] public static void OpenMachineMyStore_Supported() { using (X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine)) @@ -165,7 +165,7 @@ public static void OpenMachineMyStore_Supported() } [Fact] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public static void OpenMachineMyStore_NotSupported() { using (X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine)) @@ -175,7 +175,7 @@ public static void OpenMachineMyStore_NotSupported() } [Theory] - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [InlineData(OpenFlags.ReadOnly, false)] [InlineData(OpenFlags.MaxAllowed, false)] [InlineData(OpenFlags.ReadWrite, true)] diff --git a/src/System.Threading/tests/EventWaitHandleTests.cs b/src/System.Threading/tests/EventWaitHandleTests.cs index 5e4aaa1fef2f..8c7617caf863 100644 --- a/src/System.Threading/tests/EventWaitHandleTests.cs +++ b/src/System.Threading/tests/EventWaitHandleTests.cs @@ -26,14 +26,14 @@ public void Ctor_InvalidMode() Assert.Throws(() => new EventWaitHandle(true, (EventResetMode)12345)); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void Ctor_InvalidNames() { Assert.Throws(() => new EventWaitHandle(true, EventResetMode.AutoReset, new string('a', 1000))); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void Ctor_NamesArentSupported_Unix() { @@ -42,7 +42,7 @@ public void Ctor_NamesArentSupported_Unix() Assert.Throws(() => new EventWaitHandle(false, EventResetMode.AutoReset, "anything", out createdNew)); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Theory] [InlineData(false, EventResetMode.AutoReset)] [InlineData(false, EventResetMode.ManualReset)] @@ -62,7 +62,7 @@ public void Ctor_StateModeNameCreatedNew_Windows(bool initialState, EventResetMo } } - [PlatformSpecific(PlatformID.Windows)] // named semaphores aren't supported on Unix + [PlatformSpecific(TestPlatforms.Windows)] // named semaphores aren't supported on Unix [Theory] [InlineData(EventResetMode.AutoReset)] [InlineData(EventResetMode.ManualReset)] @@ -100,7 +100,7 @@ public void SetReset() } } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenExisting_Windows() { @@ -131,7 +131,7 @@ public void OpenExisting_Windows() } } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void OpenExisting_NotSupported_Unix() { @@ -140,7 +140,7 @@ public void OpenExisting_NotSupported_Unix() Assert.Throws(() => EventWaitHandle.TryOpenExisting("anything", out ewh)); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenExisting_InvalidNames_Windows() { @@ -149,7 +149,7 @@ public void OpenExisting_InvalidNames_Windows() Assert.Throws(() => EventWaitHandle.OpenExisting(new string('a', 10000))); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenExisting_UnavailableName_Windows() { @@ -159,7 +159,7 @@ public void OpenExisting_UnavailableName_Windows() Assert.False(EventWaitHandle.TryOpenExisting(name, out ignored)); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenExisting_NameUsedByOtherSynchronizationPrimitive_Windows() { @@ -172,7 +172,7 @@ public void OpenExisting_NameUsedByOtherSynchronizationPrimitive_Windows() } } - [PlatformSpecific(PlatformID.Windows)] // names aren't supported on Unix + [PlatformSpecific(TestPlatforms.Windows)] // names aren't supported on Unix [Theory] [InlineData(EventResetMode.ManualReset)] [InlineData(EventResetMode.AutoReset)] diff --git a/src/System.Threading/tests/MutexTests.cs b/src/System.Threading/tests/MutexTests.cs index 4a99e37da386..77cdc42c501e 100644 --- a/src/System.Threading/tests/MutexTests.cs +++ b/src/System.Threading/tests/MutexTests.cs @@ -58,7 +58,7 @@ public void Ctor_ValidName() } } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void Ctor_NameUsedByOtherSynchronizationPrimitive_Windows() { @@ -113,7 +113,7 @@ public void OpenExisting_UnavailableName() Assert.False(Mutex.TryOpenExisting(name, out ignored)); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenExisting_NameUsedByOtherSynchronizationPrimitive_Windows() { diff --git a/src/System.Threading/tests/SemaphoreTests.cs b/src/System.Threading/tests/SemaphoreTests.cs index 9f324b4d6e0d..ab1b0af66861 100644 --- a/src/System.Threading/tests/SemaphoreTests.cs +++ b/src/System.Threading/tests/SemaphoreTests.cs @@ -24,7 +24,7 @@ public void Ctor_InitialAndMax(int initialCount, int maximumCount) new Semaphore(initialCount, maximumCount, null).Dispose(); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void Ctor_ValidName_Windows() { @@ -37,7 +37,7 @@ public void Ctor_ValidName_Windows() Assert.True(createdNew); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void Ctor_NamesArentSupported_Unix() { @@ -73,7 +73,7 @@ public void Ctor_InvalidArguments() Assert.Throws(() => new Semaphore(2, 1, "CtorSemaphoreTest", out createdNew)); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void Ctor_InvalidNames() { @@ -167,7 +167,7 @@ public void AnonymousProducerConsumer() } } - [PlatformSpecific(PlatformID.Windows)] // named semaphores aren't supported on Unix + [PlatformSpecific(TestPlatforms.Windows)] // named semaphores aren't supported on Unix [Fact] public void NamedProducerConsumer() { @@ -196,7 +196,7 @@ public void NamedProducerConsumer() }, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default)); } - [PlatformSpecific(PlatformID.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix)] [Fact] public void OpenExisting_NotSupported_Unix() { @@ -207,7 +207,7 @@ public void OpenExisting_NotSupported_Unix() Assert.Throws(() => Semaphore.TryOpenExisting("anything", out semaphore)); } - [PlatformSpecific(PlatformID.Windows)] + [PlatformSpecific(TestPlatforms.Windows)] [Fact] public void OpenExisting_InvalidNames_Windows() { @@ -216,7 +216,7 @@ public void OpenExisting_InvalidNames_Windows() Assert.Throws(() => Semaphore.OpenExisting(new string('a', 10000))); } - [PlatformSpecific(PlatformID.Windows)] // named semaphores aren't supported on Unix + [PlatformSpecific(TestPlatforms.Windows)] // named semaphores aren't supported on Unix [Fact] public void OpenExisting_UnavailableName_Windows() { @@ -226,7 +226,7 @@ public void OpenExisting_UnavailableName_Windows() Assert.False(Semaphore.TryOpenExisting(name, out ignored)); } - [PlatformSpecific(PlatformID.Windows)] // named semaphores aren't supported on Unix + [PlatformSpecific(TestPlatforms.Windows)] // named semaphores aren't supported on Unix [Fact] public void OpenExisting_NameUsedByOtherSynchronizationPrimitive_Windows() { @@ -239,7 +239,7 @@ public void OpenExisting_NameUsedByOtherSynchronizationPrimitive_Windows() } } - [PlatformSpecific(PlatformID.Windows)] // named semaphores aren't supported on Unix + [PlatformSpecific(TestPlatforms.Windows)] // named semaphores aren't supported on Unix [Fact] public void OpenExisting_SameAsOriginal_Windows() { @@ -277,7 +277,7 @@ public void OpenExisting_SameAsOriginal_Windows() } } - [PlatformSpecific(PlatformID.Windows)] // names aren't supported on Unix + [PlatformSpecific(TestPlatforms.Windows)] // names aren't supported on Unix [Fact] public void PingPong() { diff --git a/src/System.ValueTuple/tests/ValueTupleTests.cs b/src/System.ValueTuple/tests/ValueTupleTests.cs index 70021e4c98cc..a747aea2f9ed 100644 --- a/src/System.ValueTuple/tests/ValueTupleTests.cs +++ b/src/System.ValueTuple/tests/ValueTupleTests.cs @@ -326,7 +326,7 @@ public static void TestToString() ValueTupleDriverA.TestToString("(" + ((short)10000) + ", " + ((int)1000000) + ", " + ((long)10000000) + ", 2008?7?2?, 0, " + ((Single)0.0001) + ", " + ((Double)0.0000001) + ", " + now + ", (False, System.Object), " + TimeSpan.Zero + ")"); } - [ActiveIssue(10207, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(10207, TestPlatforms.AnyUnix)] [Fact] public static void TestEquals_GetHashCode() { @@ -418,7 +418,7 @@ public static void TestEquals_GetHashCode() ValueTupleDriverA.TestEquals_GetHashCode(ValueTupleDriverC, false, false); } - [ActiveIssue(10207, Xunit.PlatformID.AnyUnix)] + [ActiveIssue(10207, TestPlatforms.AnyUnix)] [Fact] public static void TestCompareTo() {