[libraries] Properly skip thread failing WASM tests (#38089)
authorMitchell Hwang <mitchhwang1418@gmail.com>
Fri, 19 Jun 2020 23:49:29 +0000 (19:49 -0400)
committerGitHub <noreply@github.com>
Fri, 19 Jun 2020 23:49:29 +0000 (01:49 +0200)
Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
81 files changed:
src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs
src/libraries/Microsoft.Extensions.Configuration.UserSecrets/tests/ConfigurationExtensionTest.cs
src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs
src/libraries/Microsoft.Extensions.Http/tests/DefaultHttpClientFactoryTest.cs
src/libraries/Microsoft.Extensions.Http/tests/Logging/RedactedLogValueIntegrationTest.cs
src/libraries/Microsoft.Extensions.Logging/tests/Common/ConsoleLoggerTest.cs
src/libraries/System.Collections.Concurrent/tests/BlockingCollectionCancellationTests.cs
src/libraries/System.Collections.Concurrent/tests/ConcurrentBagTests.cs
src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs
src/libraries/System.Collections.Concurrent/tests/ConcurrentStackTests.cs
src/libraries/System.Collections.Concurrent/tests/PartitionerStaticTests.cs
src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs
src/libraries/System.ComponentModel.EventBasedAsync/tests/BackgroundWorkerTests.cs
src/libraries/System.Data.Odbc/tests/CommandBuilderTests.cs
src/libraries/System.Data.Odbc/tests/DependencyCheckTest.cs
src/libraries/System.Data.Odbc/tests/OdbcConnectionSchemaTests.cs
src/libraries/System.Data.Odbc/tests/ReaderTests.cs
src/libraries/System.Data.Odbc/tests/SmokeTest.cs
src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs
src/libraries/System.Diagnostics.Process/tests/ProcessWaitingTests.cs
src/libraries/System.Diagnostics.TraceSource/tests/CorrelationManagerTests.cs
src/libraries/System.Diagnostics.TraceSource/tests/TraceListenerClassTests.cs
src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllLinesAsync.cs
src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllTextAsync.cs
src/libraries/System.IO.FileSystem/tests/FileStream/CopyToAsync.cs
src/libraries/System.IO.FileSystem/tests/FileStream/ReadAsync.cs
src/libraries/System.IO.FileSystem/tests/FileStream/ReadWriteSpan.cs
src/libraries/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs_buffer_fo.cs
src/libraries/System.IO.Pipelines/tests/FlushAsyncCancellationTests.cs
src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs
src/libraries/System.IO/tests/BufferedStream/BufferedStream.FlushTests.cs
src/libraries/System.IO/tests/IndentedTextWriter.cs
src/libraries/System.IO/tests/Stream/Stream.APMMethodsTests.cs
src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs
src/libraries/System.IO/tests/TextReader/TextReaderTests.cs
src/libraries/System.IO/tests/TextWriter/TextWriterTests.cs
src/libraries/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs
src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs
src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs
src/libraries/System.Net.NameResolution/tests/FunctionalTests/ResolveTest.cs
src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs
src/libraries/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs
src/libraries/System.Net.Requests/tests/FileWebRequestTest.cs
src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs
src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs
src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs
src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs
src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs
src/libraries/System.Runtime.Caching/tests/AdditionalCacheTests/AdditionalCacheTests.cs
src/libraries/System.Runtime.Caching/tests/System.Runtime.Caching/MemoryCacheTest.cs
src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs
src/libraries/System.Runtime/tests/System/Runtime/CompilerServices/ConditionalWeakTableTests.cs
src/libraries/System.Security.Cryptography.Algorithms/tests/RandomNumberGeneratorTests.cs
src/libraries/System.Security.Cryptography.Primitives/tests/HashAlgorithmTest.cs
src/libraries/System.Text.Json/tests/JsonDocumentTests.cs
src/libraries/System.Text.Json/tests/Serialization/CacheTests.cs
src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.Stream.cs
src/libraries/System.Text.Json/tests/Serialization/InvalidTypeTests.cs
src/libraries/System.Text.Json/tests/Serialization/ReferenceHandlerTests.Deserialize.cs
src/libraries/System.Text.Json/tests/Serialization/Stream.ReadTests.cs
src/libraries/System.Threading.Channels/tests/BoundedChannelTests.cs
src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs
src/libraries/System.Threading.Channels/tests/ChannelTestBase.netcoreapp.cs
src/libraries/System.Threading.Channels/tests/ChannelTests.cs
src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs
src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/BroadcastBlockTests.cs
src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/JoinBlockTests.cs
src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/SimpleNetworkTests.cs
src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/WriteOnceBlockTests.cs
src/libraries/System.Threading.Tasks/tests/Task/TaskContinueWithTests.cs
src/libraries/System.Threading.Timer/tests/TimerChangeTests.cs
src/libraries/System.Threading.Timer/tests/TimerConstructorTests.cs
src/libraries/System.Threading.Timer/tests/TimerDisposeTests.cs
src/libraries/System.Threading.Timer/tests/TimerFiringTests.cs
src/libraries/System.Transactions.Local/tests/AsyncTest.cs
src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs
src/libraries/System.Transactions.Local/tests/CloneTxTests.cs
src/libraries/System.Transactions.Local/tests/EnlistTest.cs
src/libraries/System.Transactions.Local/tests/LTMEnlistmentTests.cs
src/libraries/System.Transactions.Local/tests/NonMsdtcPromoterTests.cs
src/libraries/System.Transactions.Local/tests/TransactionScopeTest.cs

index 32d73a6..2bb75ea 100644 (file)
@@ -155,7 +155,7 @@ namespace System.IO.Compression
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public async Task ReadAsync_DuringReadAsync()
         {
             byte[] buffer = new byte[32];
index 7b7c140..c0cecba 100644 (file)
@@ -52,7 +52,7 @@ namespace Microsoft.Extensions.Configuration.UserSecrets.Test
             File.WriteAllText(secretsFilePath, contents.ToString(), Encoding.UTF8);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
         public void AddUserSecrets_FindsAssemblyAttribute()
         {
@@ -67,7 +67,7 @@ namespace Microsoft.Extensions.Configuration.UserSecrets.Test
             Assert.Equal(randValue, config[configKey]);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
         public void AddUserSecrets_FindsAssemblyAttributeFromType()
         {
@@ -108,7 +108,7 @@ namespace Microsoft.Extensions.Configuration.UserSecrets.Test
             Assert.Empty(config.AsEnumerable());
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
         public void AddUserSecrets_With_SecretsId_Passed_Explicitly()
         {
index f53975f..7087827 100644 (file)
@@ -207,7 +207,7 @@ CommonKey3:CommonKey4=IniValue6";
             Assert.False(error.Message.Contains(_basePath), error.Message);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
         public void LoadAndCombineKeyValuePairsFromDifferentConfigurationProviders()
         {
@@ -247,7 +247,7 @@ CommonKey3:CommonKey4=IniValue6";
             Assert.Equal("MemValue6", config["CommonKey1:CommonKey2:CommonKey3:CommonKey4"]);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
         public void LoadAndCombineKeyValuePairsFromDifferentConfigurationProvidersWithAbsolutePath()
         {
@@ -288,7 +288,7 @@ CommonKey3:CommonKey4=IniValue6";
             Assert.Equal("MemValue6", config["CommonKey1:CommonKey2:CommonKey3:CommonKey4"]);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
         public void CanOverrideValuesWithNewConfigurationProvider()
         {
@@ -418,7 +418,7 @@ CommonKey3:CommonKey4=IniValue6";
             Assert.NotNull(provider);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
         public void OnLoadErrorWillBeCalledOnIniLoadError()
         {
@@ -819,7 +819,7 @@ IniKey1=IniValue2");
             Assert.True(createAgainToken.HasChanged);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
         public void LoadIncorrectJsonFile_ThrowException()
         {
@@ -836,7 +836,7 @@ IniKey1=IniValue2");
             Assert.Contains("Could not parse the JSON file.", exception.Message);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
         public void SetBasePathCalledMultipleTimesForEachSourceLastOneWins()
         {
index 0a39165..a53f38b 100644 (file)
@@ -250,7 +250,7 @@ namespace Microsoft.Extensions.Http
             Assert.Same(expected[7], handler);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Factory_CreateClient_WithExpiry_CanExpire()
         {
             // Arrange
@@ -293,7 +293,7 @@ namespace Microsoft.Extensions.Http
             Assert.NotSame(activeEntry1.Handler, activeEntry2.Handler);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Factory_CreateClient_WithExpiry_HandlerCanBeReusedBeforeExpiry()
         {
             // Arrange
index 09d10fa..3b3c122 100644 (file)
@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System;
 using System.Linq;
 using System.Net.Http;
 using System.Net.Http.Headers;
@@ -17,7 +16,7 @@ namespace Microsoft.Extensions.Http.Logging
 {
     public class RedactedLogValueIntegrationTest
     {
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public async Task RedactHeaderValueWithHeaderList_ValueIsRedactedBeforeLogging()
         {
             // Arrange
@@ -95,7 +94,7 @@ Y-Non-Sensitive: innocuous value
 ", message.Message);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public async Task RedactHeaderValueWithPredicate_ValueIsRedactedBeforeLogging()
         {
             // Arrange
index 8c8786c..c0b14f8 100644 (file)
@@ -232,7 +232,7 @@ namespace Microsoft.Extensions.Logging.Test
             Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void WriteError_LogsCorrectColors()
         {
             // Arrange
@@ -295,7 +295,7 @@ namespace Microsoft.Extensions.Logging.Test
             Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void WriteDebug_LogsCorrectColors()
         {
             // Arrange
@@ -402,7 +402,7 @@ namespace Microsoft.Extensions.Logging.Test
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(FormatsAndLevels))]
         public void WriteCore_LogsCorrectTimestampInUtc(ConsoleLoggerFormat format, LogLevel level)
         {
@@ -508,7 +508,7 @@ namespace Microsoft.Extensions.Logging.Test
             Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void WritingScopes_LogsWithCorrectColors()
         {
             // Arrange
index 8537c5c..a5462ec 100644 (file)
@@ -11,7 +11,7 @@ namespace System.Collections.Concurrent.Tests
 {
     public class BlockingCollectionCancellationTests
     {
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void InternalCancellation_CompleteAdding_Negative()
         {
             BlockingCollection<int> coll1 = new BlockingCollection<int>();
@@ -27,7 +27,7 @@ namespace System.Collections.Concurrent.Tests
         }
 
         //This tests that Take/TryTake wake up correctly if CompleteAdding() is called while waiting
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void InternalCancellation_WakingUp()
         {
             for (int test = 0; test < 2; test++)
@@ -61,7 +61,7 @@ namespace System.Collections.Concurrent.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void ExternalCancel_Negative()
         {
             BlockingCollection<int> bc = new BlockingCollection<int>(); //empty collection.
@@ -97,7 +97,7 @@ namespace System.Collections.Concurrent.Tests
                cs.Token);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void ExternalCancel_AddToAny()
         {
             for (int test = 0; test < 3; test++)
index 3a1edb5..830297f 100644 (file)
@@ -20,7 +20,7 @@ namespace System.Collections.Concurrent.Tests
 
         protected override string CopyToNoLengthParamName => "index";
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(1, 10)]
         [InlineData(3, 100)]
         [InlineData(8, 1000)]
@@ -46,7 +46,7 @@ namespace System.Collections.Concurrent.Tests
             Assert.Equal(itemsPerThread * threadsCount, bag.Count);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void AddOnOneThread_PeekOnAnother_EnsureWeCanTakeOnTheOriginal()
         {
             var bag = new ConcurrentBag<int>(Enumerable.Range(1, 5));
@@ -77,7 +77,7 @@ namespace System.Collections.Concurrent.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void AddManyItems_ThenTakeOnDifferentThread_ItemsOutputInExpectedOrder()
         {
             var bag = new ConcurrentBag<int>(Enumerable.Range(0, 100000));
@@ -92,7 +92,7 @@ namespace System.Collections.Concurrent.Tests
             }, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default).GetAwaiter().GetResult();
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void SingleProducerAdding_MultiConsumerTaking_SemaphoreThrottling_AllTakesSucceed()
         {
             var bag = new ConcurrentBag<int>();
@@ -148,7 +148,7 @@ namespace System.Collections.Concurrent.Tests
             ce.Wait();
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(10)]
@@ -211,7 +211,7 @@ namespace System.Collections.Concurrent.Tests
             Assert.Throws<InvalidCastException>(() => c.CopyTo(new ArgumentNullException[Size], 0));
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(10)]
@@ -261,7 +261,7 @@ namespace System.Collections.Concurrent.Tests
             IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(false, 0)]
         [InlineData(false, 1)]
         [InlineData(false, 20)]
@@ -312,7 +312,7 @@ namespace System.Collections.Concurrent.Tests
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(1, 10)]
         [InlineData(3, 100)]
         [InlineData(8, 1000)]
index 0c7eb74..68d9cc6 100644 (file)
@@ -57,7 +57,7 @@ namespace System.Collections.Concurrent.Tests
             Task.WaitAll(producer, consumer);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void Concurrent_Enqueue_TryPeek_TryDequeue_AllItemsSeen()
         {
             int items = 1000;
index a550167..71ee6d9 100644 (file)
@@ -64,7 +64,7 @@ namespace System.Collections.Concurrent.Tests
             Assert.True(s.IsEmpty);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(8, 10)]
         [InlineData(16, 100)]
         [InlineData(128, 100)]
@@ -98,7 +98,7 @@ namespace System.Collections.Concurrent.Tests
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(8, 10)]
         [InlineData(16, 100)]
         [InlineData(128, 100)]
index 57329d3..e9d4537 100644 (file)
@@ -14,7 +14,7 @@ namespace System.Collections.Concurrent.Tests
 {
     public class PartitionerStaticTests
     {
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void TestStaticPartitioningIList()
         {
             RunTestWithAlgorithm(dataSize: 11, partitionCount: 8, algorithm: 0);
@@ -22,7 +22,7 @@ namespace System.Collections.Concurrent.Tests
             RunTestWithAlgorithm(dataSize: 10000, partitionCount: 11, algorithm: 0);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void TestStaticPartitioningArray()
         {
             RunTestWithAlgorithm(dataSize: 7, partitionCount: 4, algorithm: 1);
@@ -30,7 +30,7 @@ namespace System.Collections.Concurrent.Tests
             RunTestWithAlgorithm(dataSize: 1000, partitionCount: 7, algorithm: 1);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void TestLoadBalanceIList()
         {
             RunTestWithAlgorithm(dataSize: 7, partitionCount: 4, algorithm: 2);
@@ -38,7 +38,7 @@ namespace System.Collections.Concurrent.Tests
             RunTestWithAlgorithm(dataSize: 1000, partitionCount: 7, algorithm: 2);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void TestLoadBalanceArray()
         {
             RunTestWithAlgorithm(dataSize: 11, partitionCount: 8, algorithm: 3);
@@ -46,7 +46,7 @@ namespace System.Collections.Concurrent.Tests
             RunTestWithAlgorithm(dataSize: 10000, partitionCount: 11, algorithm: 3);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void TestLoadBalanceEnumerator()
         {
             RunTestWithAlgorithm(dataSize: 7, partitionCount: 4, algorithm: 4);
index adf0994..de2a612 100644 (file)
@@ -98,7 +98,7 @@ namespace System.Collections.Concurrent.Tests
             AssertSetsEqual(expected, actual);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void Add_TakeFromAnotherThread_ExpectedItemsTaken()
         {
             IProducerConsumerCollection<int> c = CreateProducerConsumerCollection();
@@ -187,7 +187,7 @@ namespace System.Collections.Concurrent.Tests
             Assert.Equal(oracle.Count, c.Count);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(100, 1, 100, true)]
         [InlineData(100, 4, 10, false)]
         [InlineData(1000, 11, 100, true)]
index d11a8a3..13cf3b3 100644 (file)
@@ -16,7 +16,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests
         private const int TimeoutShort = 300;
         private const int TimeoutLong = 30000;
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void TestBackgroundWorkerBasic()
         {
             var orignal = SynchronizationContext.Current;
@@ -71,7 +71,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task RunWorkerAsync_NoOnWorkHandler_SetsResultToNull()
         {
             var tcs = new TaskCompletionSource();
@@ -93,7 +93,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests
 
         private ManualResetEventSlim manualResetEvent3;
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void TestCancelAsync()
         {
             BackgroundWorker bw = new BackgroundWorker();
@@ -157,7 +157,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests
 
         #endregion
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void TestThrowExceptionInDoWork()
         {
             var original = SynchronizationContext.Current;
@@ -210,7 +210,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests
             Assert.False(bw.CancellationPending);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void RunWorkerAsyncTwice()
         {
             var bw = new BackgroundWorker();
@@ -235,7 +235,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void TestCancelInsideDoWork()
         {
             var original = SynchronizationContext.Current;
@@ -329,6 +329,7 @@ namespace System.ComponentModel.EventBasedAsync.Tests
 
         [Fact]
         [ActiveIssue("https://github.com/dotnet/runtime/issues/37136", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoInterpreter))]
+        [ActiveIssue("https://github.com/dotnet/runtime/issues/37136", TestPlatforms.Browser)]
         public void TestFinalization()
         {
             // BackgroundWorker has a finalizer that exists purely for backwards compatibility
index 46c7a37..e10a57a 100644 (file)
@@ -8,7 +8,7 @@ namespace System.Data.Odbc.Tests
 {
     public class CommandBuilderTests : IntegrationTestBase
     {
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void QuoteIdentifier_UseConnection()
         {
             var commandBuilder = new OdbcCommandBuilder();
@@ -37,7 +37,7 @@ namespace System.Data.Odbc.Tests
             Assert.Throws<InvalidOperationException>(() => commandBuilder.UnquoteIdentifier("Test"));
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void QuoteIdentifier_CustomPrefixSuffix()
         {
             var commandBuilder = new OdbcCommandBuilder();
index 21aba80..950d35b 100644 (file)
@@ -2,15 +2,13 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System;
 using Xunit;
 
 namespace System.Data.Odbc.Tests
 {
     public class DependencyCheckTest
     {
-        public static bool IsObdcNotAvailableAndThreadingSupported => Helpers.CheckOdbcNotAvailable() && PlatformDetection.IsThreadingSupported;
-        [ConditionalFact(nameof(IsObdcNotAvailableAndThreadingSupported))]
+        [ConditionalFact(Helpers.OdbcNotAvailable)]
         public void OdbcConnection_OpenWhenOdbcNotInstalled_ThrowsException()
         {
             if (PlatformDetection.IsWindowsServerCore && !Environment.Is64BitProcess)
index cbf5aca..caf10e3 100644 (file)
@@ -25,7 +25,7 @@ namespace System.Data.Odbc.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TestConnectionSchemaOnNonOpenConnection()
         {
             using (OdbcConnection connection = new OdbcConnection(string.Empty))
index ee4e484..75eeed3 100644 (file)
@@ -9,7 +9,7 @@ namespace System.Data.Odbc.Tests
 {
     public class ReaderTests : IntegrationTestBase
     {
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void EmptyReader()
         {
             command.CommandText =
@@ -43,7 +43,7 @@ namespace System.Data.Odbc.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void GetValues()
         {
             command.CommandText =
@@ -76,7 +76,7 @@ namespace System.Data.Odbc.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void GetValueFailsWithBigIntWithBackwardsCompatibility()
         {
             command.CommandText =
@@ -111,7 +111,7 @@ namespace System.Data.Odbc.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void GetDataTypeName()
         {
             command.CommandText =
@@ -137,7 +137,7 @@ namespace System.Data.Odbc.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void GetFieldTypeIsNotSupportedInSqlite()
         {
             command.CommandText =
@@ -168,7 +168,7 @@ namespace System.Data.Odbc.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void IsDbNullIsNotSupportedInSqlite()
         {
             command.CommandText =
@@ -199,7 +199,7 @@ namespace System.Data.Odbc.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void InvalidRowIndex()
         {
             command.CommandText =
@@ -231,7 +231,7 @@ namespace System.Data.Odbc.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void InvalidRowName()
         {
             command.CommandText =
index a9f44ea..737ce52 100644 (file)
@@ -8,7 +8,7 @@ namespace System.Data.Odbc.Tests
 {
     public class SmokeTest : IntegrationTestBase
     {
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact]
         public void CreateInsertSelectTest()
         {
             command.CommandText =
index 8e7c58f..44c7eeb 100644 (file)
@@ -212,7 +212,7 @@ namespace System.Diagnostics.Tests
         /// <summary>
         /// Tests Id generation
         /// </summary>
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void IdGenerationNoParent()
         {
             var orphan1 = new Activity("orphan1");
@@ -228,7 +228,7 @@ namespace System.Diagnostics.Tests
         /// <summary>
         /// Tests Id generation
         /// </summary>
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void IdGenerationInternalParent()
         {
             var parent = new Activity("parent");
@@ -1238,7 +1238,7 @@ namespace System.Diagnostics.Tests
         /// <summary>
         /// Tests that Activity.Current flows correctly within async methods
         /// </summary>
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ActivityCurrentFlowsWithAsyncSimple()
         {
             Activity activity = new Activity("activity").Start();
@@ -1255,7 +1255,7 @@ namespace System.Diagnostics.Tests
         /// <summary>
         /// Tests that Activity.Current flows correctly within async methods
         /// </summary>
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ActivityCurrentFlowsWithAsyncComplex()
         {
             Activity originalActivity = Activity.Current;
@@ -1294,7 +1294,7 @@ namespace System.Diagnostics.Tests
         /// <summary>
         /// Tests that Activity.Current could be set
         /// </summary>
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ActivityCurrentSet()
         {
             Activity activity = new Activity("activity");
index 9accffb..d55b422 100644 (file)
@@ -119,7 +119,7 @@ namespace System.Diagnostics.Tests
             Assert.False(Process.GetCurrentProcess().WaitForExit(milliseconds));
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(0)]  // poll
         [InlineData(10)] // real timeout
         public async Task CurrentProcess_WaitAsyncNeverCompletes(int milliseconds)
index 1bf6841..068f59e 100644 (file)
@@ -53,7 +53,7 @@ namespace System.Diagnostics.TraceSourceTests
             Assert.Equal(id, Trace.CorrelationManager.ActivityId);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task CorrelationManager_MutateStackPush()
         {
             Guid id = Guid.NewGuid();
@@ -68,7 +68,7 @@ namespace System.Diagnostics.TraceSourceTests
             ValidateStack(Trace.CorrelationManager.LogicalOperationStack, 2, 1);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task CorrelationManager_MutateStackPop()
         {
             Guid id = Guid.NewGuid();
@@ -83,7 +83,7 @@ namespace System.Diagnostics.TraceSourceTests
             ValidateStack(Trace.CorrelationManager.LogicalOperationStack, Array.Empty<object>());
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task CorrelationManager_ActivityIdAcrossAwait()
         {
             Guid g = Guid.NewGuid();
@@ -95,7 +95,7 @@ namespace System.Diagnostics.TraceSourceTests
             Assert.Equal(g, Trace.CorrelationManager.ActivityId);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task CorrelationManager_CorrelationAcrossAwait()
         {
             Guid g = Guid.NewGuid();
index af56ffd..97b7067 100644 (file)
@@ -313,7 +313,7 @@ namespace System.Diagnostics.TraceSourceTests
             Assert.Equal(expected, listener.WriteCount);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         [MethodImpl(MethodImplOptions.NoInlining)]
         public void WriteFooterTest_Callstack()
         {
index 50a099a..5cc2573 100644 (file)
@@ -45,7 +45,7 @@ namespace System.IO.Tests
             Assert.Equal(new string[] { "" }, await ReadAsync(path));
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task EmptyStringCreatesFileAsync()
         {
             string path = GetTestFilePath();
@@ -54,7 +54,7 @@ namespace System.IO.Tests
             Assert.Empty(await ReadAsync(path));
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(0)]
         [InlineData(100)]
         public async Task ValidWriteAsync(int size)
index 3e703b3..73a3d14 100644 (file)
@@ -36,7 +36,7 @@ namespace System.IO.Tests
         public Task NonExistentPathAsync() => Assert.ThrowsAsync<DirectoryNotFoundException>(
             async () => await WriteAsync(Path.Combine(TestDirectory, GetTestFileName(), GetTestFileName()), "Text"));
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task NullContent_CreatesFileAsync()
         {
             string path = GetTestFilePath();
index 3c2cee7..5abfced 100644 (file)
@@ -70,7 +70,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Theory] // inner loop, just a few cases
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // inner loop, just a few cases
         [InlineData(false, false)]
         [InlineData(true, false)]
         [InlineData(true, true)]
@@ -81,7 +81,7 @@ namespace System.IO.Tests
                 bufferSize: 4096, writeSize: 1024, numWrites: 10);
         }
 
-        [Theory] // outer loop, many combinations
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // outer loop, many combinations
         [OuterLoop]
         [MemberData(nameof(File_AllDataCopied_MemberData))]
         public async Task File_AllDataCopied(
@@ -277,7 +277,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(false)]
         [InlineData(true)]
         public async Task DerivedFileStream_ReadAsyncInvoked(bool useAsync)
index 14e69be..0857930 100644 (file)
@@ -252,7 +252,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsyncCancelledFile()
         {
             string fileName = GetTestFilePath();
index 0d34069..e49f944 100644 (file)
@@ -137,7 +137,7 @@ namespace System.IO.Tests
             Assert.Throws<ObjectDisposedException>(() => { fs.WriteAsync(new ReadOnlyMemory<byte>(new byte[1])); });
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task EmptyFile_ReadAsync_Succeeds()
         {
             using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create))
@@ -160,7 +160,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task NonEmptyFile_ReadAsync_GetsExpectedData()
         {
             string fileName = GetTestFilePath();
@@ -189,7 +189,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task NonEmptyFile_CustomMemoryManager_ReadAsync_GetsExpectedData()
         {
             string fileName = GetTestFilePath();
@@ -239,7 +239,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task NonEmptyWriteAsync_WritesExpectedData()
         {
             using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create))
@@ -255,7 +255,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task NonEmptyWriteAsync_CustomMemoryManager_WritesExpectedData()
         {
             using (var mem = new NativeMemoryManager(TestBuffer.Length))
index 6358f9b..e07723e 100644 (file)
@@ -27,7 +27,7 @@ namespace System.IO.Tests
             AssertExtensions.Throws<ArgumentOutOfRangeException>("options", () => CreateFileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite, FileShare.Read, c_DefaultBufferSize, ~FileOptions.None));
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(FileOptions.None)]
         [InlineData(FileOptions.DeleteOnClose)]
         [InlineData(FileOptions.RandomAccess)]
@@ -65,7 +65,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(FileOptions.Encrypted)]
         [InlineData(FileOptions.Asynchronous | FileOptions.Encrypted)]
         [InlineData(FileOptions.Asynchronous | FileOptions.DeleteOnClose | FileOptions.Encrypted | FileOptions.RandomAccess | FileOptions.SequentialScan | FileOptions.WriteThrough)]
index 5440b92..95121b2 100644 (file)
@@ -13,7 +13,7 @@ namespace System.IO.Pipelines.Tests
 {
     public class FlushAsyncCancellationTests : PipeTest
     {
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void FlushAsyncCancellationDeadlock()
         {
             var cts = new CancellationTokenSource();
index 905b318..372c6d7 100644 (file)
@@ -45,7 +45,7 @@ namespace System.IO.Pipelines.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task UseSynchronizationContextFalseIgnoresSyncContextForReaderScheduler()
         {
             SynchronizationContext previous = SynchronizationContext.Current;
index 67a8e4b..2e784de 100644 (file)
@@ -39,7 +39,7 @@ namespace System.IO.Tests
             Assert.Equal(0, wrapper.TimesCalled(nameof(wrapper.FlushAsync)));
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(true, true)]
         [InlineData(true, false)]
         [InlineData(false, true)]
index 3f71ab3..2feed61 100644 (file)
@@ -92,7 +92,7 @@ namespace System.CodeDom.Tests
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData("\r\n")]
         [InlineData("\n")]
         [InlineData("newline")]
index ec1be37..2e272ed 100644 (file)
@@ -20,7 +20,7 @@ namespace System.IO.Tests
         {
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void BeginEndReadTest()
         {
             Stream stream = CreateStream();
@@ -28,7 +28,7 @@ namespace System.IO.Tests
             stream.EndRead(result);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void BeginEndWriteTest()
         {
             Stream stream = CreateStream();
index d819dc2..c559bda 100644 (file)
@@ -41,7 +41,7 @@ namespace System.IO.Tests
             Assert.InRange(outerCount, 1, int.MaxValue); // the buffer can't be size 0
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task AsyncIfCanSeekIsFalseLengthAndPositionShouldNotBeCalled()
         {
             var baseStream = new DelegateStream(
@@ -134,7 +134,7 @@ namespace System.IO.Tests
             Assert.InRange(outerCount, 1, int.MaxValue);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(LengthIsLessThanOrEqualToPosition))]
         public async Task AsyncIfLengthIsLessThanOrEqualToPositionCopyToShouldStillBeCalledWithAPositiveBufferSize(long length, long position)
         {
@@ -189,7 +189,7 @@ namespace System.IO.Tests
             Assert.InRange(outerCount, 1, int.MaxValue);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(LengthMinusPositionPositiveOverflows))]
         public async Task AsyncIfLengthMinusPositionPositiveOverflowsBufferSizeShouldStillBePositive(long length, long position)
         {
@@ -268,7 +268,7 @@ namespace System.IO.Tests
             Assert.Equal(ReadLimit - 1, dest.TimesCalled(nameof(dest.Write)));
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(LengthIsGreaterThanPositionAndDoesNotOverflow))]
         public async Task AsyncIfLengthIsGreaterThanPositionAndDoesNotOverflowEverythingShouldGoNormally(long length, long position)
         {
index 4f572ed..5e6d800 100644 (file)
@@ -162,7 +162,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadBlockAsyncCharArr()
         {
             (char[] chArr, CharArrayTextReader textReader) baseInfo = GetCharArray();
@@ -180,7 +180,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync()
         {
             (char[] chArr, CharArrayTextReader textReader) baseInfo = GetCharArray();
@@ -236,7 +236,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadLineAsyncContinuousNewLinesAndTabs()
         {
             char[] newLineTabData = new char[] { '\n', '\n', '\r', '\r', '\n' };
index 7a8f26d..8534c6c 100644 (file)
@@ -473,7 +473,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WriteAsyncStringTest()
         {
             using (CharArrayTextWriter tw = NewTextWriter)
@@ -574,7 +574,7 @@ namespace System.IO.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WriteLineCharMemoryTest()
         {
             using (CharArrayTextWriter tw = NewTextWriter)
index 4308cfb..ec44817 100644 (file)
@@ -504,7 +504,7 @@ namespace System.Linq.Parallel.Tests
         // On CTP-M1, this would deadlock for DOP=7,9,11,... on 4-core, but works for DOP=1..6 and 8,10,12, ...
         //
         // In this test, every call to the key-selector delegate throws.
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(OrderByThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })]
         public static void OrderBy_ThreadedDeadlock(Labeled<ParallelQuery<int>> labeled, int count, int degree)
         {
index c2f716d..637ec5f 100644 (file)
@@ -11,7 +11,7 @@ namespace System.Net.NameResolution.Tests
 {
     public class GetHostByNameTest
     {
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void DnsObsoleteBeginGetHostByName_BadName_Throws()
         {
             IAsyncResult asyncObject = Dns.BeginGetHostByName("BadName", null, null);
@@ -29,7 +29,7 @@ namespace System.Net.NameResolution.Tests
             Assert.Equal(IPAddress.Loopback, entry.AddressList[0]);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void DnsObsoleteBeginGetHostByName_MachineNameWithIPv4_MatchesGetHostByName()
         {
             IAsyncResult asyncObject = Dns.BeginGetHostByName(TestSettings.LocalHost, null, null);
@@ -113,7 +113,7 @@ namespace System.Net.NameResolution.Tests
         }
 
         [ActiveIssue("https://github.com/dotnet/runtime/issues/1488", TestPlatforms.OSX)]
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/27622")]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process), nameof(PlatformDetection.IsThreadingSupported))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/27622")]
         public void DnsObsoleteBeginEndGetHostByName_EmptyString_ReturnsHostName()
         {
             IPHostEntry entry = Dns.EndGetHostByName(Dns.BeginGetHostByName("", null, null));
index c127201..1fff02e 100644 (file)
@@ -13,7 +13,7 @@ namespace System.Net.NameResolution.Tests
 {
     public class GetHostEntryTest
     {
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Dns_GetHostEntryAsync_IPAddress_Ok()
         {
             IPAddress localIPAddress = await TestSettings.GetLocalIPAddress();
@@ -132,7 +132,7 @@ namespace System.Net.NameResolution.Tests
             await Assert.ThrowsAsync<ArgumentException>(() => Task.Factory.FromAsync(Dns.BeginGetHostEntry, Dns.EndGetHostEntry, address.ToString(), null));
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task DnsGetHostEntry_MachineName_AllVariationsMatch()
         {
             IPHostEntry syncResult = Dns.GetHostEntry(TestSettings.LocalHost);
index 8e66f6b..5796fce 100644 (file)
@@ -11,14 +11,14 @@ namespace System.Net.NameResolution.Tests
 {
     public class ResolveTest
     {
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void DnsObsoleteBeginResolve_BadName_Throws()
         {
             IAsyncResult asyncObject = Dns.BeginResolve("BadName", null, null);
             Assert.ThrowsAny<SocketException>(() => Dns.EndResolve(asyncObject));
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void DnsObsoleteBeginResolve_BadIPv4String_ReturnsOnlyGivenIP()
         {
             IAsyncResult asyncObject = Dns.BeginResolve("0.0.1.1", null, null);
@@ -29,7 +29,7 @@ namespace System.Net.NameResolution.Tests
             Assert.Equal(IPAddress.Parse("0.0.1.1"), entry.AddressList[0]);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void DnsObsoleteBeginResolve_Loopback_MatchesResolve()
         {
             IAsyncResult asyncObject = Dns.BeginResolve(IPAddress.Loopback.ToString(), null, null);
index 4b8e0ae..b600fbd 100644 (file)
@@ -80,7 +80,7 @@ namespace System.Net.NetworkInformation.Tests
             Assert.Contains(pingReply.Address, localIpAddresses); ///, "Reply address {pingReply.Address} is not expected local address.");
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsync_InvalidArgs()
         {
             IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync();
@@ -147,7 +147,7 @@ namespace System.Net.NetworkInformation.Tests
                 });
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(AddressFamily.InterNetwork)]
         [InlineData(AddressFamily.InterNetworkV6)]
         public async Task SendPingAsyncWithIPAddress(AddressFamily addressFamily)
@@ -187,7 +187,7 @@ namespace System.Net.NetworkInformation.Tests
                 });
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithIPAddress_AddressAsString()
         {
             IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync();
@@ -213,7 +213,7 @@ namespace System.Net.NetworkInformation.Tests
                 });
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithIPAddressAndTimeout()
         {
             IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync();
@@ -243,7 +243,7 @@ namespace System.Net.NetworkInformation.Tests
         }
 
         [PlatformSpecific(TestPlatforms.Windows)]  // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply.
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithIPAddressAndTimeoutAndBuffer()
         {
             byte[] buffer = TestSettings.PayloadAsBytes;
@@ -284,7 +284,7 @@ namespace System.Net.NetworkInformation.Tests
         }
 
         [PlatformSpecific(TestPlatforms.AnyUnix)]  // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply.
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithIPAddressAndTimeoutAndBuffer_Unix()
         {
             byte[] buffer = TestSettings.PayloadAsBytes;
@@ -327,7 +327,7 @@ namespace System.Net.NetworkInformation.Tests
         }
 
         [PlatformSpecific(TestPlatforms.Windows)]  // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply.
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithIPAddressAndTimeoutAndBufferAndPingOptions()
         {
             IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync();
@@ -377,7 +377,7 @@ namespace System.Net.NetworkInformation.Tests
         }
 
         [PlatformSpecific(TestPlatforms.AnyUnix)]  // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply.
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(AddressFamily.InterNetwork)]
         [InlineData(AddressFamily.InterNetworkV6)]
         public async Task SendPingAsyncWithIPAddressAndTimeoutAndBufferAndPingOptions_Unix(AddressFamily addressFamily)
@@ -421,7 +421,7 @@ namespace System.Net.NetworkInformation.Tests
                 });
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithHost()
         {
             IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync();
@@ -447,7 +447,7 @@ namespace System.Net.NetworkInformation.Tests
                 });
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithHostAndTimeout()
         {
             IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync();
@@ -477,7 +477,7 @@ namespace System.Net.NetworkInformation.Tests
         }
 
         [PlatformSpecific(TestPlatforms.Windows)]  // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply.
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithHostAndTimeoutAndBuffer()
         {
             IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync();
@@ -518,7 +518,7 @@ namespace System.Net.NetworkInformation.Tests
         }
 
         [PlatformSpecific(TestPlatforms.AnyUnix)]  // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply.
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithHostAndTimeoutAndBuffer_Unix()
         {
             IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync();
@@ -560,7 +560,7 @@ namespace System.Net.NetworkInformation.Tests
         }
 
         [PlatformSpecific(TestPlatforms.Windows)]  // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply.
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions()
         {
             IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync();
@@ -602,7 +602,7 @@ namespace System.Net.NetworkInformation.Tests
         }
 
         [PlatformSpecific(TestPlatforms.AnyUnix)]  // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply.
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions_Unix()
         {
             IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync();
@@ -626,7 +626,7 @@ namespace System.Net.NetworkInformation.Tests
                 });
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendPings_ReuseInstance_Hostname()
         {
             IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync();
@@ -656,7 +656,7 @@ namespace System.Net.NetworkInformation.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task SendAsyncs_ReuseInstance_Hostname()
         {
             IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync();
@@ -714,7 +714,7 @@ namespace System.Net.NetworkInformation.Tests
             p.Dispose();
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static async Task PingAsync_DisposeAfterSend_Success()
         {
             Ping p = new Ping();
@@ -788,7 +788,7 @@ namespace System.Net.NetworkInformation.Tests
             Assert.True(FinalizingPing.WasFinalized);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(true)]
         [InlineData(false)]
         public async Task SendPingAsyncWithHostAndTtlAndFragmentPingOptions(bool fragment)
@@ -809,7 +809,7 @@ namespace System.Net.NetworkInformation.Tests
                 });
         }
 
-        [ConditionalFact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [OuterLoop] // Depends on external host and assumption that network respects and does not change TTL
         public async Task SendPingToExternalHostWithLowTtlTest()
         {
index 662fd8d..2b4cd63 100644 (file)
@@ -41,7 +41,7 @@ namespace System.Net.NetworkInformation.Tests
             Assert.True(stopWatch.ElapsedMilliseconds >= timeout);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(50)]
index 0d70373..d6f98d6 100644 (file)
@@ -88,7 +88,7 @@ namespace System.Net.Tests
         public abstract Task<WebResponse> GetResponseAsync(WebRequest request);
         public abstract Task<Stream> GetRequestStreamAsync(WebRequest request);
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadFile_ContainsExpectedContent()
         {
             string path = Path.GetTempFileName();
@@ -125,7 +125,7 @@ namespace System.Net.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WriteFile_ContainsExpectedContent()
         {
             string path = Path.GetTempFileName();
@@ -151,7 +151,7 @@ namespace System.Net.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WriteThenReadFile_WriteAccessResultsInNullResponseStream()
         {
             string path = Path.GetTempFileName();
@@ -183,7 +183,7 @@ namespace System.Net.Tests
 
         protected virtual bool EnableConcurrentReadWriteTests => true;
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task RequestAfterResponse_throws()
         {
             string path = Path.GetTempFileName();
@@ -203,7 +203,7 @@ namespace System.Net.Tests
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(null)]
         [InlineData(false)]
         [InlineData(true)]
index 91edae8..0a44008 100644 (file)
@@ -69,7 +69,7 @@ namespace System.Xml.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public static void ReadAsyncAfterInitializationWithUriThrows()
         {
             using (XmlReader reader = XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = true }))
@@ -78,7 +78,7 @@ namespace System.Xml.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public static void ReadAfterInitializationWithUriOnAsyncReaderTrows()
         {
             using (XmlReader reader = XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = true }))
@@ -87,7 +87,7 @@ namespace System.Xml.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux), nameof(PlatformDetection.IsThreadingSupported))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/18258")]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/18258")]
         public static void InitializationWithUriOnNonAsyncReaderTrows()
         {
             Assert.Throws<System.Net.Http.HttpRequestException>(() => XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = false }));
index 8ab3f17..069c4cd 100644 (file)
@@ -76,7 +76,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - Basic Test")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc1()
         {
             Load("xslt_multithreading_test.xsl", "foo.xml");
@@ -96,7 +96,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - QFE 505 Repro")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc2()
         {
             AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true);
@@ -118,7 +118,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - AVTs")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc3()
         {
             Load("xslt_multith_AVTs.xsl", "xslt_multith_AVTs.xml");
@@ -138,7 +138,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - xsl:key")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc4()
         {
             Load("xslt_multith_keytest.xsl", "xslt_multith_keytest.xml");
@@ -158,7 +158,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - xsl:sort")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc5()
         {
             Load("xslt_multith_sorting.xsl", "xslt_multith_sorting.xml");
@@ -178,7 +178,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - Attribute Sets")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc6()
         {
             Load("xslt_mutith_attribute_sets.xsl", "xslt_mutith_attribute_sets.xml");
@@ -198,7 +198,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - Boolean Expression AND")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc7()
         {
             Load("xslt_mutith_boolean_expr_and.xsl", "xslt_mutith_boolean_expr_and.xml");
@@ -218,7 +218,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - Boolean Expression OR")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc8()
         {
             Load("xslt_mutith_boolean_expr_or.xsl", "xslt_mutith_boolean_expr_or.xml");
@@ -238,7 +238,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - FormatNubmer function")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc9()
         {
             Load("xslt_mutith_format_number.xsl", "xslt_mutith_format_number.xml");
@@ -258,7 +258,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - Position() function")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc10()
         {
             Load("xslt_mutith_position_func.xsl", "xslt_mutith_position_func.xml");
@@ -278,7 +278,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - preserve space")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc11()
         {
             Load("xslt_mutith_preserve_space.xsl", "xslt_mutith_preserve_space.xml");
@@ -298,7 +298,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): Reader - Variable nodeset")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc12()
         {
             Load("xslt_mutith_variable_nodeset.xsl", "xslt_mutith_variable_nodeset.xml");
@@ -363,7 +363,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - Basic Test")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc1()
         {
             Load("xslt_multithreading_test.xsl", "foo.xml");
@@ -383,7 +383,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - QFE 505 Repro")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc2()
         {
             AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true);
@@ -405,7 +405,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - AVTs")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc3()
         {
             Load("xslt_multith_AVTs.xsl", "xslt_multith_AVTs.xml");
@@ -425,7 +425,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - xsl:key")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc4()
         {
             Load("xslt_multith_keytest.xsl", "xslt_multith_keytest.xml");
@@ -445,7 +445,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - xsl:sort")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc5()
         {
             Load("xslt_multith_sorting.xsl", "xslt_multith_sorting.xml");
@@ -465,7 +465,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - Attribute Sets")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc6()
         {
             Load("xslt_mutith_attribute_sets.xsl", "xslt_mutith_attribute_sets.xml");
@@ -485,7 +485,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - Boolean Expression AND")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc7()
         {
             Load("xslt_mutith_boolean_expr_and.xsl", "xslt_mutith_boolean_expr_and.xml");
@@ -505,7 +505,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - Boolean Expression OR")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc8()
         {
             Load("xslt_mutith_boolean_expr_or.xsl", "xslt_mutith_boolean_expr_or.xml");
@@ -525,7 +525,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - FormatNubmer function")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc9()
         {
             Load("xslt_mutith_format_number.xsl", "xslt_mutith_format_number.xml");
@@ -545,7 +545,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - Position() function")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc10()
         {
             Load("xslt_mutith_position_func.xsl", "xslt_mutith_position_func.xml");
@@ -565,7 +565,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - preserve space")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc11()
         {
             Load("xslt_mutith_preserve_space.xsl", "xslt_mutith_preserve_space.xml");
@@ -585,7 +585,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple Transform(): TextWriter - Variable nodeset")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc12()
         {
             Load("xslt_mutith_variable_nodeset.xsl", "xslt_mutith_variable_nodeset.xml");
index d7663d9..3ac7c8b 100644 (file)
@@ -103,7 +103,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple GetParam for same parameter name")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc1()
         {
             CThreads rThreads = new CThreads(_output);
@@ -121,7 +121,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple GetParam for different parameter name")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc2()
         {
             CThreads rThreads = new CThreads(_output);
@@ -187,7 +187,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple GetExtensionObject for same namespace System.Xml.Tests")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc1()
         {
             CThreads rThreads = new CThreads(_output);
@@ -205,7 +205,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple GetExtensionObject for different namespace System.Xml.Tests")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc2()
         {
             CThreads rThreads = new CThreads(_output);
@@ -272,7 +272,7 @@ namespace System.Xml.Tests
         // Multiple Transform() using shared ArgumentList
         ////////////////////////////////////////////////////////////////
         //[Variation("Multiple transforms using shared ArgumentList")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc1()
         {
             CThreads rThreads = new CThreads(_output);
index 56ac808..d31f6e2 100644 (file)
@@ -76,7 +76,7 @@ namespace System.Xml.Tests
         [InlineData("xslt_mutith_variable_global_forward_ref_deep.xsl", "xslt_mutith_variable_nodeset.xml")]
         //[Variation("Local and global variables", Params = new object[] { "xslt_mutith_variable_local_and_global.xsl", "xslt_mutith_variable_local_and_global.xsl" })]
         [InlineData("xslt_mutith_variable_local_and_global.xsl", "xslt_mutith_variable_local_and_global.xsl")]
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void Variations(object param0, object param1)
         {
             string xslFile = (string)param0;
index 83fc079..a8fffd3 100644 (file)
@@ -106,7 +106,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple GetParam for same parameter name")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc1()
         {
             CThreads rThreads = new CThreads(_output);
@@ -124,7 +124,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple GetParam for different parameter name")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc2()
         {
             CThreads rThreads = new CThreads(_output);
@@ -190,7 +190,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple GetExtensionObject for same namespace System.Xml.Tests")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc1()
         {
             CThreads rThreads = new CThreads(_output);
@@ -208,7 +208,7 @@ namespace System.Xml.Tests
         }
 
         //[Variation("Multiple GetExtensionObject for different namespace System.Xml.Tests")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc2()
         {
             CThreads rThreads = new CThreads(_output);
@@ -276,7 +276,7 @@ namespace System.Xml.Tests
         // Multiple Transform() using shared ArgumentList
         ////////////////////////////////////////////////////////////////
         //[Variation("Multiple transforms using shared ArgumentList")]
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void proc1()
         {
             CThreads rThreads = new CThreads(_output);
index a29572c..6dc8897 100644 (file)
@@ -11,7 +11,7 @@ namespace System.Runtime.Caching.Tests
     // These are the tests to fill in some of the coverage in ported Mono caching tests
     public class AdditionalCacheTests
     {
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void DisposedCacheTest()
         {
             var mc = new MemoryCache("my disposed cache 1");
index b4f9b23..d43d0ab 100644 (file)
@@ -44,7 +44,7 @@ namespace MonoTests.System.Runtime.Caching
 {
     public class MemoryCacheTest
     {
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ConstructorParameters()
         {
             MemoryCache mc;
@@ -156,7 +156,7 @@ namespace MonoTests.System.Runtime.Caching
             });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Defaults()
         {
             var mc = new MemoryCache("MyCache");
@@ -172,7 +172,7 @@ namespace MonoTests.System.Runtime.Caching
                 mc.DefaultCacheCapabilities);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void DefaultInstanceDefaults()
         {
             var mc = MemoryCache.Default;
@@ -211,7 +211,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.Equal(TimeSpan.FromMinutes(70), mc.PollingInterval);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Indexer()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -278,7 +278,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.False(mc.Contains("key"));
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void CreateCacheEntryChangeMonitor()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -328,7 +328,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.True (monitor.HasChanged);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void AddOrGetExisting_String_Object_DateTimeOffset_String()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -365,7 +365,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.Null(value);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void AddOrGetExisting_String_Object_CacheItemPolicy_String()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -446,7 +446,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.Null(value);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void AddOrGetExisting_CacheItem_CacheItemPolicy()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -585,7 +585,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.Equal("AddOrGetExisting (CacheItem item, CacheItemPolicy policy)", mc.Calls[0]);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Set_String_Object_CacheItemPolicy_String()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -668,7 +668,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.Equal("Set (string key, object value, CacheItemPolicy policy, string regionName = null)", mc.Calls[0]);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Set_String_Object_DateTimeOffset_String()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -700,7 +700,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.Equal("Set (string key, object value, CacheItemPolicy policy, string regionName = null)", mc.Calls[1]);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Set_CacheItem_CacheItemPolicy()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -795,7 +795,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.Equal("Set (string key, object value, CacheItemPolicy policy, string regionName = null)", mc.Calls[1]);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Remove()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -881,7 +881,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.False(callbackInvoked);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void GetValues()
         {
             var mc = new PokerMemoryCache("MyCache");
@@ -930,7 +930,7 @@ namespace MonoTests.System.Runtime.Caching
             Assert.False(value.ContainsKey("Key1"));
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ChangeMonitors()
         {
             bool removed = false;
@@ -970,7 +970,7 @@ namespace MonoTests.System.Runtime.Caching
 
         // Due to internal implementation details Trim has very few easily verifiable scenarios
         // ActiveIssue: https://github.com/dotnet/runtime/issues/36488
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process), nameof(PlatformDetection.IsThreadingSupported))]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process))]
         public void Trim()
         {
             var config = new NameValueCollection();
index 94f6d3a..7d09b9b 100644 (file)
@@ -62,7 +62,7 @@ public static class XmlDictionaryWriterTest
         Assert.Equal(expect, actual);
     }
 
-    [Fact]
+    [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
     public static void XmlBaseWriter_FlushAsync()
     {
         string actual = null;
index 069826a..418f828 100644 (file)
@@ -131,7 +131,7 @@ namespace System.Runtime.CompilerServices.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void Concurrent_Add_Read_Remove_DifferentObjects()
         {
             var cwt = new ConditionalWeakTable<object, object>();
@@ -150,7 +150,7 @@ namespace System.Runtime.CompilerServices.Tests
             });
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void Concurrent_GetValue_Read_Remove_DifferentObjects()
         {
             var cwt = new ConditionalWeakTable<object, object>();
@@ -168,7 +168,7 @@ namespace System.Runtime.CompilerServices.Tests
             });
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void Concurrent_GetValue_Read_Remove_SameObject()
         {
             object key = new object();
index e29eb5d..57801a4 100644 (file)
@@ -56,7 +56,7 @@ namespace System.Security.Cryptography.RNG.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public static void ConcurrentAccess()
         {
             const int ParallelTasks = 3;
index ad263e6..a934703 100644 (file)
@@ -32,7 +32,7 @@ namespace System.Security.Cryptography.Hashing.Tests
             Assert.Equal(input.Sum(b => (long)b), BitConverter.ToInt64(output, 0));
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(0)]
         [InlineData(10)]
         [InlineData(4096)]
@@ -59,7 +59,7 @@ namespace System.Security.Cryptography.Hashing.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public async Task ComputeHashAsync_SupportsCancellation()
         {
             using (CancellationTokenSource cancellationSource = new CancellationTokenSource(100))
index b6efd05..e7437c3 100644 (file)
@@ -291,7 +291,7 @@ namespace System.Text.Json.Tests
                     new WrappedMemoryStream(canRead: true, canWrite: false, canSeek: false, bytes)));
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [MemberData(nameof(ReducedTestCases))]
         public static void ParseJson_UnseekableStream_Async(bool compactData, TestCaseType type, string jsonString)
         {
index c879f58..d3f0808 100644 (file)
@@ -22,7 +22,7 @@ namespace System.Text.Json.Serialization.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void MultipleThreads_SameType_DifferentJson()
         {
             // Use local options to avoid obtaining already cached metadata from the default options.
@@ -84,7 +84,7 @@ namespace System.Text.Json.Serialization.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void MultipleThreads_DifferentTypes()
         {
             // Use local options to avoid obtaining already cached metadata from the default options.
@@ -165,7 +165,7 @@ namespace System.Text.Json.Serialization.Tests
         // this options is not the default options instance the tests will not use previously cached metadata.
         private static JsonSerializerOptions s_options = new JsonSerializerOptions();
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(WriteSuccessCases))]
         public static void MultipleTypes(ITestClass testObj)
         {
index d2d6380..c5f50e1 100644 (file)
@@ -103,7 +103,7 @@ namespace System.Text.Json.Serialization.Tests
             Task.WaitAll(tasks);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void Cannot_DeserializeAsync_ObjectWith_Ctor_With_65_Params()
         {
             async Task RunTest<T>()
index 437dc98..bd16318 100644 (file)
@@ -51,7 +51,7 @@ namespace System.Text.Json.Serialization.Tests
             Assert.Contains(type.ToString(), ex.ToString());
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(TypesWithInvalidMembers_WithMembers))]
         public void TypeWithInvalidMember(Type classType, Type invalidMemberType, string invalidMemberName)
         {
@@ -74,7 +74,7 @@ namespace System.Text.Json.Serialization.Tests
             ValidateException(ex, classType, invalidMemberType, invalidMemberName);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(OpenGenericTypes_ToSerialize))]
         public void SerializeOpenGeneric(Type type)
         {
@@ -92,7 +92,7 @@ namespace System.Text.Json.Serialization.Tests
             Assert.Throws<ArgumentException>(() => Serializer.Serialize(obj, type));
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(OpenGenericTypes))]
         public void SerializeInvalidTypes_NullValue(Type type)
         {
@@ -100,7 +100,7 @@ namespace System.Text.Json.Serialization.Tests
             Assert.Contains(type.ToString(), ex.ToString());
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void SerializeOpenGeneric_NullableOfT()
         {
             Type openNullableType = typeof(Nullable<>);
index 65de487..1de6a68 100644 (file)
@@ -226,7 +226,7 @@ namespace System.Text.Json.Serialization.Tests
             Assert.Equal(1, root.ZeroLengthProperty);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static void TestJsonPathDoesNotFailOnMultiThreads()
         {
             const int ThreadCount = 8;
index 1c98439..06d0652 100644 (file)
@@ -20,7 +20,7 @@ namespace System.Text.Json.Serialization.Tests
             await Assert.ThrowsAsync<ArgumentNullException>(async () => await JsonSerializer.DeserializeAsync(new MemoryStream(), (Type)null));
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static async Task ReadSimpleObjectAsync()
         {
             using (MemoryStream stream = new MemoryStream(SimpleTestClass.s_data))
@@ -35,7 +35,7 @@ namespace System.Text.Json.Serialization.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public static async Task ReadSimpleObjectWithTrailingTriviaAsync()
         {
             byte[] data = Encoding.UTF8.GetBytes(SimpleTestClass.s_json + " /* Multi\r\nLine Comment */\t");
index 19c28a2..914eb12 100644 (file)
@@ -177,7 +177,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal(0, result);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task TryWrite_DropNewest_WrappedAroundInternalQueue()
         {
             var c = Channel.CreateBounded<int>(new BoundedChannelOptions(3) { FullMode = BoundedChannelFullMode.DropNewest });
@@ -249,7 +249,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal(0, result);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task CancelPendingWrite_Reading_DataTransferredFromCorrectWriter()
         {
             var c = Channel.CreateBounded<int>(1);
@@ -288,7 +288,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(1)]
         [InlineData(10)]
         [InlineData(10000)]
@@ -314,7 +314,7 @@ namespace System.Threading.Channels.Tests
                 }));
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(1)]
         [InlineData(10)]
         [InlineData(10000)]
@@ -371,7 +371,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal((NumItems * (NumItems + 1L)) / 2, readTotal);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WaitToWriteAsync_AfterFullThenRead_ReturnsTrue()
         {
             var c = Channel.CreateBounded<int>(1);
@@ -389,7 +389,7 @@ namespace System.Threading.Channels.Tests
             Assert.True(await write2);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(ThreeBools))]
         public void AllowSynchronousContinuations_Reading_ContinuationsInvokedAccordingToSetting(bool allowSynchronousContinuations, bool cancelable, bool waitToReadAsync)
         {
@@ -409,7 +409,7 @@ namespace System.Threading.Channels.Tests
             r.GetAwaiter().GetResult();
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(false)]
         [InlineData(true)]
         public void AllowSynchronousContinuations_CompletionTask_ContinuationsInvokedAccordingToSetting(bool allowSynchronousContinuations)
@@ -427,7 +427,7 @@ namespace System.Threading.Channels.Tests
             r.GetAwaiter().GetResult();
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task TryWrite_NoBlockedReaders_WaitingReader_WaiterNotified()
         {
             Channel<int> c = CreateChannel();
index 8932b05..e28a586 100644 (file)
@@ -67,7 +67,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal(TaskStatus.RanToCompletion, completion.Status);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_AfterEmpty_NoWaiters_TriggersCompletion()
         {
             Channel<int> c = CreateChannel();
@@ -75,7 +75,7 @@ namespace System.Threading.Channels.Tests
             await c.Reader.Completion;
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_AfterEmpty_WaitingReader_TriggersCompletion()
         {
             Channel<int> c = CreateChannel();
@@ -85,7 +85,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAnyAsync<InvalidOperationException>(() => r);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_BeforeEmpty_WaitingReaders_TriggersCompletion()
         {
             Channel<int> c = CreateChannel();
@@ -112,7 +112,7 @@ namespace System.Threading.Channels.Tests
             Assert.False(c.Writer.TryComplete());
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task TryComplete_ErrorsPropage()
         {
             Channel<int> c;
@@ -145,7 +145,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void SingleProducerConsumer_ConcurrentReadWrite_Success()
         {
             Channel<int> c = CreateChannel();
@@ -326,7 +326,7 @@ namespace System.Threading.Channels.Tests
             Assert.True(write.Result);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WaitToWriteAsync_ManyConcurrent_SatisifedByReaders()
         {
             if (RequiresSingleReader || RequiresSingleWriter)
@@ -375,7 +375,7 @@ namespace System.Threading.Channels.Tests
             Assert.False(c.Writer.TryWrite(42));
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WriteAsync_AfterComplete_ThrowsException()
         {
             Channel<int> c = CreateChannel();
@@ -383,7 +383,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAnyAsync<InvalidOperationException>(async () => await c.Writer.WriteAsync(42));
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_WithException_PropagatesToCompletion()
         {
             Channel<int> c = CreateChannel();
@@ -392,7 +392,7 @@ namespace System.Threading.Channels.Tests
             Assert.Same(exc, await Assert.ThrowsAsync<FormatException>(() => c.Reader.Completion));
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_WithCancellationException_PropagatesToCompletion()
         {
             Channel<int> c = CreateChannel();
@@ -407,7 +407,7 @@ namespace System.Threading.Channels.Tests
             await AssertCanceled(c.Reader.Completion, cts.Token);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_WithException_PropagatesToExistingWriter()
         {
             Channel<int> c = CreateFullChannel();
@@ -420,7 +420,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_WithException_PropagatesToNewWriter()
         {
             Channel<int> c = CreateChannel();
@@ -430,7 +430,7 @@ namespace System.Threading.Channels.Tests
             Assert.Same(exc, (await Assert.ThrowsAsync<ChannelClosedException>(async () => await write)).InnerException);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_WithException_PropagatesToExistingWaitingReader()
         {
             Channel<int> c = CreateChannel();
@@ -440,7 +440,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAsync<FormatException>(async () => await read);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_WithException_PropagatesToNewWaitingReader()
         {
             Channel<int> c = CreateChannel();
@@ -450,7 +450,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAsync<FormatException>(async () => await read);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task Complete_WithException_PropagatesToNewWaitingWriter()
         {
             Channel<int> c = CreateChannel();
@@ -524,7 +524,7 @@ namespace System.Threading.Channels.Tests
             Assert.True(waitTask.IsCanceled);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(false)]
         [InlineData(true)]
         public async Task WaitToReadAsync_DataWritten_CompletesSuccessfully(bool cancelable)
@@ -540,7 +540,7 @@ namespace System.Threading.Channels.Tests
             Assert.True(await read);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WaitToReadAsync_NoDataWritten_Canceled_CompletesAsCanceled()
         {
             Channel<int> c = CreateChannel();
@@ -552,7 +552,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAnyAsync<OperationCanceledException>(async () => await read);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_ThenWriteAsync_Succeeds()
         {
             Channel<int> c = CreateChannel();
@@ -566,7 +566,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal(42, await r);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WriteAsync_ReadAsync_Succeeds()
         {
             Channel<int> c = CreateChannel();
@@ -594,7 +594,7 @@ namespace System.Threading.Channels.Tests
             Assert.True(readTask.IsCanceled);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_Canceled_CanceledAsynchronously()
         {
             Channel<int> c = CreateChannel();
@@ -613,7 +613,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_WriteAsync_ManyConcurrentReaders_SerializedWriters_Success()
         {
             if (RequiresSingleReader)
@@ -633,7 +633,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal((Items * (Items - 1)) / 2, Enumerable.Sum(await Task.WhenAll(readers.Select(r => r.AsTask()))));
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_TryWrite_ManyConcurrentReaders_SerializedWriters_Success()
         {
             if (RequiresSingleReader)
@@ -658,7 +658,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal((Items * (Items - 1)) / 2, Enumerable.Sum(await Task.WhenAll(readers)));
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_AlreadyCompleted_Throws()
         {
             Channel<int> c = CreateChannel();
@@ -666,7 +666,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAsync<ChannelClosedException>(() => c.Reader.ReadAsync().AsTask());
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_SubsequentlyCompleted_Throws()
         {
             Channel<int> c = CreateChannel();
@@ -676,7 +676,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAsync<ChannelClosedException>(() => r);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_AfterFaultedChannel_Throws()
         {
             Channel<int> c = CreateChannel();
@@ -689,7 +689,7 @@ namespace System.Threading.Channels.Tests
             Assert.Same(e, cce.InnerException);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_AfterCanceledChannel_Throws()
         {
             Channel<int> c = CreateChannel();
@@ -701,7 +701,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAnyAsync<OperationCanceledException>(() => c.Reader.ReadAsync().AsTask());
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_Canceled_WriteAsyncCompletesNextReader()
         {
             Channel<int> c = CreateChannel();
@@ -722,7 +722,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_ConsecutiveReadsSucceed()
         {
             Channel<int> c = CreateChannel();
@@ -734,7 +734,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WaitToReadAsync_ConsecutiveReadsSucceed()
         {
             Channel<int> c = CreateChannel();
@@ -832,7 +832,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WaitToReadAsync_AwaitThenGetResult_Throws()
         {
             Channel<int> c = CreateChannel();
@@ -845,7 +845,7 @@ namespace System.Threading.Channels.Tests
             Assert.Throws<InvalidOperationException>(() => read.GetAwaiter().GetResult());
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAsync_AwaitThenGetResult_Throws()
         {
             Channel<int> c = CreateChannel();
@@ -858,7 +858,7 @@ namespace System.Threading.Channels.Tests
             Assert.Throws<InvalidOperationException>(() => read.GetAwaiter().GetResult());
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WaitToWriteAsync_AwaitThenGetResult_Throws()
         {
             Channel<int> c = CreateFullChannel();
@@ -875,7 +875,7 @@ namespace System.Threading.Channels.Tests
             Assert.Throws<InvalidOperationException>(() => write.GetAwaiter().GetResult());
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task WriteAsync_AwaitThenGetResult_Throws()
         {
             Channel<int> c = CreateFullChannel();
@@ -992,7 +992,7 @@ namespace System.Threading.Channels.Tests
             from setNonDefaultTaskScheduler in new[] { true, false }
             select new object[] { readOrWait, completeBeforeOnCompleted, flowExecutionContext, continueOnCapturedContext, setNonDefaultTaskScheduler };
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(Reader_ContinuesOnCurrentContextIfDesired_MemberData))]
         public async Task Reader_ContinuesOnCurrentSynchronizationContextIfDesired(
             bool readOrWait, bool completeBeforeOnCompleted, bool flowExecutionContext, bool? continueOnCapturedContext, bool setNonDefaultTaskScheduler)
@@ -1088,7 +1088,7 @@ namespace System.Threading.Channels.Tests
             from setDefaultSyncContext in new[] { true, false }
             select new object[] { readOrWait, completeBeforeOnCompleted, flowExecutionContext, continueOnCapturedContext, setDefaultSyncContext };
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [MemberData(nameof(Reader_ContinuesOnCurrentSchedulerIfDesired_MemberData))]
         public async Task Reader_ContinuesOnCurrentTaskSchedulerIfDesired(
             bool readOrWait, bool completeBeforeOnCompleted, bool flowExecutionContext, bool? continueOnCapturedContext, bool setDefaultSyncContext)
index 88e3a1c..15be0c7 100644 (file)
@@ -22,7 +22,7 @@ namespace System.Threading.Channels.Tests
             Assert.NotSame(e, c.Reader.ReadAllAsync());
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(false)]
         [InlineData(true)]
         public async Task ReadAllAsync_UseMoveNextAsyncAfterCompleted_ReturnsFalse(bool completeWhilePending)
@@ -76,7 +76,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAllAsync_UnavailableDataCompletesAsynchronously()
         {
             Channel<int> c = CreateChannel();
@@ -102,7 +102,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(128)]
@@ -140,7 +140,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal(producedTotal, consumedTotal);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAllAsync_MultipleEnumerationsToEnd()
         {
             Channel<int> c = CreateChannel();
@@ -193,7 +193,7 @@ namespace System.Threading.Channels.Tests
             }
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(false)]
         [InlineData(true)]
         public async Task ReadAllAsync_DualConcurrentEnumeration_AllItemsEnumerated(bool sameEnumerable)
@@ -238,7 +238,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal(producerTotal, consumerTotal);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(false)]
         [InlineData(true)]
         public async Task ReadAllAsync_CanceledBeforeMoveNextAsync_Throws(bool dataAvailable)
@@ -260,7 +260,7 @@ namespace System.Threading.Channels.Tests
             Assert.Equal(cts.Token, oce.CancellationToken);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task ReadAllAsync_CanceledAfterMoveNextAsync_Throws()
         {
             Channel<int> c = CreateChannel();
index 964f4bf..1c8ee4b 100644 (file)
@@ -87,7 +87,7 @@ namespace System.Threading.Channels.Tests
         public void CreateBounded_ValidBufferSizes_Success(int bufferedCapacity) =>
             Assert.NotNull(Channel.CreateBounded<int>(bufferedCapacity));
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task DefaultWriteAsync_UsesWaitToWriteAsyncAndTryWrite()
         {
             var c = new TestChannelWriter<int>(10);
@@ -113,7 +113,7 @@ namespace System.Threading.Channels.Tests
             Assert.False(t.IsCompleted);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task DefaultWriteAsync_CatchesTryWriteExceptions()
         {
             var w = new TryWriteThrowingWriter<int>();
@@ -122,7 +122,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAsync<FormatException>(async () => await t);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task DefaultReadAsync_CatchesTryWriteExceptions()
         {
             var r = new TryReadThrowingReader<int>();
@@ -131,7 +131,7 @@ namespace System.Threading.Channels.Tests
             await Assert.ThrowsAsync<FieldAccessException>(() => t);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task TestBaseClassReadAsync()
         {
             WrapperChannel<int> channel = new WrapperChannel<int>(10);
index c295a31..3e8c837 100644 (file)
@@ -137,7 +137,7 @@ namespace System.Threading.Channels.Tests
             await c.Reader.Completion;
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void AllowSynchronousContinuations_WaitToReadAsync_ContinuationsInvokedAccordingToSetting()
         {
             Channel<int> c = CreateChannel();
@@ -153,7 +153,7 @@ namespace System.Threading.Channels.Tests
             r.GetAwaiter().GetResult();
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void AllowSynchronousContinuations_CompletionTask_ContinuationsInvokedAccordingToSetting()
         {
             Channel<int> c = CreateChannel();
index 7e4d69e..ea4818b 100644 (file)
@@ -10,7 +10,7 @@ namespace System.Threading.Tasks.Dataflow.Tests
 {
     public class BroadcastBlockTests
     {
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TestCtor()
         {
             var blocks = new[] {
index 5756dbd..f8b1aa2 100644 (file)
@@ -72,7 +72,7 @@ namespace System.Threading.Tasks.Dataflow.Tests
             DataflowTestHelpers.TestArgumentsExceptions<Tuple<int, int, int>>(new JoinBlock<int, int, int>());
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task TestPostThenReceive()
         {
             const int Iters = 3;
index 74093ac..65d292d 100644 (file)
@@ -169,7 +169,7 @@ namespace System.Threading.Tasks.Dataflow.Tests
             Assert.Equal(expected: Iterations / b.BatchSize, actual: completedCount);
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task BroadcastToActions()
         {
             var b = new BroadcastBlock<int>(i => i);
index 0eb77fb..b229f23 100644 (file)
@@ -207,7 +207,7 @@ namespace System.Threading.Tasks.Dataflow.Tests
             await wob.Completion;
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public async Task TestBroadcasting()
         {
             var wob = new WriteOnceBlock<int>(i => i + 1);
index 86149d6..80eaafb 100644 (file)
@@ -872,7 +872,7 @@ namespace System.Threading.Tasks.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public static void RunUnwrapTests_CancellationTests()
         {
             Task taskRoot = null;
index 6ff3721..fdd8088 100644 (file)
@@ -10,7 +10,7 @@ namespace System.Threading.Tests
     {
         private void EmptyTimerTarget(object o) { }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_Change_DueTime_OutOfRange_Throws()
         {
             using (var t = new Timer(new TimerCallback(EmptyTimerTarget), null, 1, 1))
@@ -24,7 +24,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_Change_Period_OutOfRange_Throws()
         {
             using (var t = new Timer(new TimerCallback(EmptyTimerTarget), null, 1, 1))
@@ -38,7 +38,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_Change_AfterDispose_Throws()
         {
             var t = new Timer(new TimerCallback(EmptyTimerTarget), null, 1, 1);
@@ -49,7 +49,7 @@ namespace System.Threading.Tests
             Assert.Throws<ObjectDisposedException>(() => t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1)));
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(0)]
         [InlineData(1)]
         [InlineData(2)]
index 16caae2..d3e6720 100644 (file)
@@ -50,7 +50,7 @@ namespace System.Threading.Tests
             AssertExtensions.Throws<ArgumentNullException>("callback", () => new Timer(null, new object(), TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1)));
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_AllConstructorsCanBeUsedSuccessfully()
         {
             const int Timeout = 10_000;
index 59ee116..45cc223 100644 (file)
@@ -9,7 +9,7 @@ namespace System.Threading.Tests
 {
     public class TimerDisposeTests
     {
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Dispose_NotFired_WaitHandleSignaledImmediately()
         {
             var t = new Timer(_ => { }, null, int.MaxValue, int.MaxValue);
@@ -50,7 +50,7 @@ namespace System.Threading.Tests
             Assert.True(t.DisposeAsync().IsCompletedSuccessfully);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public async Task DisposeAsync_DisposeDelayedUntilCallbacksComplete()
         {
             using (var b = new Barrier(2))
@@ -72,7 +72,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public async Task DisposeAsync_MultipleDisposesBeforeCompletionReturnSameTask()
         {
             using (var b = new Barrier(2))
@@ -97,7 +97,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public async Task DisposeAsync_AfterDisposeWorks()
         {
             using (var b = new Barrier(2))
@@ -120,7 +120,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public async Task DisposeAsync_AfterDisposeWaitHandleThrows()
         {
             using (var b = new Barrier(2))
@@ -142,7 +142,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public async Task DisposeAsync_ThenDisposeWaitHandleReturnsFalse()
         {
             using (var b = new Barrier(2))
index e26e607..eb4feaf 100644 (file)
@@ -17,7 +17,7 @@ namespace System.Threading.Tests
     {
         internal const int MaxPositiveTimeoutInMs = 30000;
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_Fires_After_DueTime_Ellapses()
         {
             AutoResetEvent are = new AutoResetEvent(false);
@@ -31,7 +31,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_Fires_AndPassesStateThroughCallback()
         {
             AutoResetEvent are = new AutoResetEvent(false);
@@ -47,7 +47,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_Fires_AndPassesNullStateThroughCallback()
         {
             AutoResetEvent are = new AutoResetEvent(false);
@@ -88,7 +88,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_FiresOnlyOnce_OnDueTime_With_InfinitePeriod()
         {
             int count = 0;
@@ -122,7 +122,7 @@ namespace System.Threading.Tests
             });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_CanDisposeSelfInCallback()
         {
             Timer t = null;
@@ -138,7 +138,7 @@ namespace System.Threading.Tests
             GC.KeepAlive(t);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_CanBeDisposedMultipleTimes()
         {
             // There's nothing to validate besides that we don't throw an exception, so rely on xunit
@@ -149,7 +149,7 @@ namespace System.Threading.Tests
                 t.Dispose();
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NonRepeatingTimer_ThatHasAlreadyFired_CanChangeAndFireAgain()
         {
             AutoResetEvent are = new AutoResetEvent(false);
@@ -163,7 +163,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void MultpleTimers_PeriodicTimerIsntBlockedByBlockedCallback()
         {
             int callbacks = 2;
@@ -183,7 +183,7 @@ namespace System.Threading.Tests
             GC.KeepAlive(t);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ManyTimers_EachTimerDoesFire()
         {
             int maxTimers = 10000;
@@ -200,7 +200,7 @@ namespace System.Threading.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_Constructor_CallbackOnly_Change()
         {
             var e = new ManualResetEvent(false);
@@ -217,7 +217,7 @@ namespace System.Threading.Tests
             Assert.Throws<ArgumentNullException>(() => new Timer(s => { }).Dispose(null));
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Timer_Dispose_WaitHandle()
         {
             int tickCount = 0;
index feeed9f..b8a5f36 100644 (file)
@@ -25,7 +25,7 @@ namespace System.Transactions.Tests
             Transaction.Current = null;
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void AsyncFail1()
         {
             Assert.Throws<InvalidOperationException>(() =>
@@ -45,7 +45,7 @@ namespace System.Transactions.Tests
         }
 
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void AsyncFail2()
         {
             Assert.Throws<TransactionAbortedException>(() =>
@@ -92,7 +92,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void AsyncFail3()
         {
             s_delayedException = null;
@@ -116,7 +116,7 @@ namespace System.Transactions.Tests
             Assert.IsType<TransactionAbortedException>(s_delayedException);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Async1()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -138,7 +138,7 @@ namespace System.Transactions.Tests
                 throw new Exception("", s_delayedException);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Async2()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -157,7 +157,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Async3()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -175,7 +175,7 @@ namespace System.Transactions.Tests
             irm.Check(1, 1, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Async4()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -194,7 +194,7 @@ namespace System.Transactions.Tests
             irm.Check(1, 1, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Async5()
         {
             IntResourceManager irm = new IntResourceManager(1);
index 4c8fe5d..874ac35 100644 (file)
@@ -762,7 +762,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void LegacyNestedTxScope()
         {
             string txId1 = null;
@@ -823,7 +823,7 @@ namespace System.Transactions.Tests
             Assert.NotEqual(txId1, txId5);
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         // Async TS nested inside Sync TS
         [InlineData(TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Suppress, TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Enabled)]
         [InlineData(TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Suppress, TransactionScopeOption.RequiresNew, TransactionScopeAsyncFlowOption.Enabled)]
@@ -897,7 +897,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(TransactionScopeAsyncFlowOption.Suppress, TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Suppress, TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Enabled)]
         [InlineData(TransactionScopeAsyncFlowOption.Suppress, TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Enabled, TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Suppress)]
         [InlineData(TransactionScopeAsyncFlowOption.Enabled, TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Suppress, TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Enabled)]
@@ -977,7 +977,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(TransactionScopeAsyncFlowOption.Suppress, TransactionScopeAsyncFlowOption.Enabled, TransactionScopeAsyncFlowOption.Suppress, TransactionScopeOption.Required, false)]
         [InlineData(TransactionScopeAsyncFlowOption.Enabled, TransactionScopeAsyncFlowOption.Suppress, TransactionScopeAsyncFlowOption.Enabled, TransactionScopeOption.Required, false)]
         [InlineData(TransactionScopeAsyncFlowOption.Suppress, TransactionScopeAsyncFlowOption.Enabled, TransactionScopeAsyncFlowOption.Suppress, TransactionScopeOption.Required, true)]
@@ -1077,7 +1077,7 @@ namespace System.Transactions.Tests
             AssertTransactionNull();
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(TransactionScopeAsyncFlowOption.Suppress)]
         [InlineData(TransactionScopeAsyncFlowOption.Enabled)]
         public void VerifyBYOT(TransactionScopeAsyncFlowOption asyncFlowOption)
index eb3c217..89fbae6 100644 (file)
@@ -24,7 +24,7 @@ namespace System.Transactions.Tests
             Transaction.Current = null;
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(CloneType.Normal, IsolationLevel.Serializable, false, TransactionStatus.Committed)]
         [InlineData(CloneType.Normal, IsolationLevel.RepeatableRead, false, TransactionStatus.Committed)]
         [InlineData(CloneType.Normal, IsolationLevel.ReadCommitted, false, TransactionStatus.Committed)]
index 7718b10..a50c5f6 100644 (file)
@@ -24,7 +24,7 @@ namespace System.Transactions.Tests
         #region Vol1_Dur0
 
         /* Single volatile resource, SPC happens */
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol1_Dur0()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -38,7 +38,7 @@ namespace System.Transactions.Tests
             irm.CheckSPC("irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol1_Dur0_2PC()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -53,7 +53,7 @@ namespace System.Transactions.Tests
         }
 
         /* Single volatile resource, SPC happens */
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol1_Dur0_Fail1()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -69,7 +69,7 @@ namespace System.Transactions.Tests
             irm.Check(0, 0, 0, 1, 0, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol1_Dur0_Fail2()
         {
             Assert.Throws<TransactionAbortedException>(() =>
@@ -87,7 +87,7 @@ namespace System.Transactions.Tests
            });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol1_Dur0_Fail3()
         {
             Assert.Throws<TransactionAbortedException>(() =>
@@ -110,7 +110,7 @@ namespace System.Transactions.Tests
         #region Vol2_Dur0
 
         /* >1 volatile, 2PC */
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol2_Dur0_SPC()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -133,7 +133,7 @@ namespace System.Transactions.Tests
 
         #region Vol0_Dur1
         /* 1 durable */
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol0_Dur1()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -172,7 +172,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol0_Dur1_Fail()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -198,7 +198,7 @@ namespace System.Transactions.Tests
 
         #region Vol2_Dur1
         /* >1vol + 1 durable */
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol2_Dur1()
         {
             IntResourceManager[] irm = new IntResourceManager[4];
@@ -231,7 +231,7 @@ namespace System.Transactions.Tests
         /* >1vol + 1 durable
          * Durable fails SPC
          */
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol2_Dur1_Fail1()
         {
             IntResourceManager[] irm = new IntResourceManager[4];
@@ -269,7 +269,7 @@ namespace System.Transactions.Tests
         /* >1vol + 1 durable
          * Volatile fails Prepare
          */
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol2_Dur1_Fail3()
         {
             IntResourceManager[] irm = new IntResourceManager[4];
@@ -309,7 +309,7 @@ namespace System.Transactions.Tests
             irm[3].Check(0, 0, 0, 1, 0, 0, 0, "irm [3]");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol2_Dur1_Fail4()
         {
             IntResourceManager[] irm = new IntResourceManager[2];
@@ -341,7 +341,7 @@ namespace System.Transactions.Tests
             irm[1].Check(0, 1, 0, 1, 0, 0, 0, "irm [1]");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol2_Dur1_Fail5()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -383,7 +383,7 @@ namespace System.Transactions.Tests
         #endregion
 
         #region Promotable Single Phase Enlistment
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol0_Dur0_Pspe1()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -397,7 +397,7 @@ namespace System.Transactions.Tests
             irm.Check(1, 0, 0, 0, 0, 1, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol1_Dur0_Pspe1()
         {
             IntResourceManager irm0 = new IntResourceManager(1);
@@ -413,7 +413,7 @@ namespace System.Transactions.Tests
             irm1.Check(1, 0, 0, 0, 0, 1, 0, "irm1");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol0_Dur1_Pspe1()
         {
             IntResourceManager irm0 = new IntResourceManager(1);
@@ -433,7 +433,7 @@ namespace System.Transactions.Tests
             // an enlistment failure. An exception is not thrown, but the PSPE still "failed"
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol0_Dur0_Pspe2()
         {
             IntResourceManager irm0 = new IntResourceManager(1);
@@ -481,7 +481,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionDispose()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -492,7 +492,7 @@ namespace System.Transactions.Tests
             irm.Check(0, 0, 0, 0, "Dispose transaction");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionDispose2()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -514,7 +514,7 @@ namespace System.Transactions.Tests
             Assert.Equal(1, irm.Value);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionDispose3()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -538,7 +538,7 @@ namespace System.Transactions.Tests
         #endregion
 
         #region TransactionCompleted
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionCompleted_Committed()
         {
             bool called = false;
@@ -552,7 +552,7 @@ namespace System.Transactions.Tests
             Assert.True(called, "TransactionCompleted event handler not called!");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionCompleted_Rollback()
         {
             bool called = false;
@@ -569,7 +569,7 @@ namespace System.Transactions.Tests
 
         #region Success/Failure behavior tests
         #region Success/Failure behavior Vol1_Dur0 Cases
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol1SPC_Committed()
         {
             bool called = false;
@@ -593,7 +593,7 @@ namespace System.Transactions.Tests
             Assert.Equal(TransactionStatus.Committed, status);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol1_Committed()
         {
             bool called = false;
@@ -616,7 +616,7 @@ namespace System.Transactions.Tests
             Assert.Equal(TransactionStatus.Committed, status);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol1_Rollback()
         {
             bool called = false;
@@ -791,7 +791,7 @@ namespace System.Transactions.Tests
         #endregion
 
         #region Success/Failure behavior Vol2_Dur0 Cases
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol2SPC_Committed()
         {
             TransactionStatus status = TransactionStatus.Active;
@@ -825,7 +825,7 @@ namespace System.Transactions.Tests
             Assert.Equal(TransactionStatus.Committed, status);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol2_Committed()
         {
             TransactionStatus status = TransactionStatus.Active;
@@ -854,7 +854,7 @@ namespace System.Transactions.Tests
             Assert.Equal(TransactionStatus.Committed, status);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void Vol2_Rollback()
         {
             TransactionStatus status = TransactionStatus.Active;
index 3b0dd32..19b3861 100644 (file)
@@ -25,7 +25,7 @@ namespace System.Transactions.Tests
             Transaction.Current = null;
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(1, EnlistmentOptions.None, Phase1Vote.Prepared, SinglePhaseVote.Committed, true, EnlistmentOutcome.Committed, TransactionStatus.Committed)]
         [InlineData(2, EnlistmentOptions.None, Phase1Vote.Prepared, SinglePhaseVote.Committed, true, EnlistmentOutcome.Committed, TransactionStatus.Committed)]
         [InlineData(1, EnlistmentOptions.None, Phase1Vote.Prepared, SinglePhaseVote.Aborted, true, EnlistmentOutcome.Aborted, TransactionStatus.Aborted)]
@@ -76,7 +76,7 @@ namespace System.Transactions.Tests
             Assert.Equal(expectedTxStatus, tx.TransactionInformation.Status);
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         // This test needs to change once we have promotion support.
         // Right now any attempt to create a two phase durable enlistment will attempt to promote and will fail because promotion is not supported. This results in the transaction being
         // aborted.
@@ -129,7 +129,7 @@ namespace System.Transactions.Tests
             Assert.Equal(expectedTxStatus, tx.TransactionInformation.Status);
         }
 
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(EnlistmentOptions.EnlistDuringPrepareRequired, Phase1Vote.Prepared, true, true, EnlistmentOutcome.Committed, TransactionStatus.Committed)]
         [InlineData(EnlistmentOptions.None, Phase1Vote.Prepared, false, true, EnlistmentOutcome.Committed, TransactionStatus.Committed)]
         public void EnlistDuringPhase0(EnlistmentOptions enlistmentOption, Phase1Vote phase1Vote, bool expectPhase0EnlistSuccess, bool commit, EnlistmentOutcome expectedOutcome, TransactionStatus expectedTxStatus)
index 0b1ef2d..3ab51aa 100644 (file)
@@ -2122,7 +2122,7 @@ namespace System.Transactions.Tests
         /// <summary>
         /// PSPE Non-MSDTC Abort From Volatile.
         /// </summary>
-        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Theory]
         [InlineData(false, EnlistmentOptions.EnlistDuringPrepareRequired)]
         [InlineData(true, EnlistmentOptions.EnlistDuringPrepareRequired)]
         [InlineData(false, EnlistmentOptions.None)]
@@ -2216,7 +2216,7 @@ namespace System.Transactions.Tests
         /// <summary>
         /// PSPE Non-MSDTC Completed Event.
         /// </summary>
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         [InlineData(false)]
         [InlineData(true)]
         public void PSPENonMsdtcCompletedEvent(bool promote)
@@ -2258,7 +2258,7 @@ namespace System.Transactions.Tests
         /// <summary>
         /// Make SetDistributedTransactionIdentifier calls at the wrong time - negative test.
         /// </summary>
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void PSPENonMsdtcInCorrectSetDistributedTransactionIdentifierCalls()
         {
             // Call SetDistributedTransactionIdentifier at the wrong time.
index 007d3d9..be2f480 100644 (file)
@@ -29,7 +29,7 @@ namespace System.Transactions.Tests
             AssertExtensions.Throws<ArgumentOutOfRangeException>("scopeTimeout", () => new TransactionScope(TransactionScopeOption.Required, TimeSpan.FromSeconds(-1)));
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionScopeCommit()
         {
             Assert.Null(Transaction.Current);
@@ -42,7 +42,7 @@ namespace System.Transactions.Tests
             Assert.Null(Transaction.Current);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionScopeAbort()
         {
             Assert.Null(Transaction.Current);
@@ -60,7 +60,7 @@ namespace System.Transactions.Tests
             Assert.Null(Transaction.Current);
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionScopeCompleted1()
         {
             Assert.Throws<InvalidOperationException>(() =>
@@ -74,7 +74,7 @@ namespace System.Transactions.Tests
             });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionScopeCompleted2()
         {
             using (TransactionScope scope = new TransactionScope())
@@ -87,7 +87,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void TransactionScopeCompleted3()
         {
             Assert.Throws<InvalidOperationException>(() =>
@@ -101,7 +101,7 @@ namespace System.Transactions.Tests
         }
 
         #region NestedTransactionScope tests
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope1()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -121,7 +121,7 @@ namespace System.Transactions.Tests
             irm.Check(1, 1, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope2()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -139,7 +139,7 @@ namespace System.Transactions.Tests
             irm.Check(0, 0, 1, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope3()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -168,7 +168,7 @@ namespace System.Transactions.Tests
             irm2.Check(1, 1, 0, 0, "irm2");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope4()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -200,7 +200,7 @@ namespace System.Transactions.Tests
             irm.Check(0, 0, 1, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope5()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -230,7 +230,7 @@ namespace System.Transactions.Tests
             irm2.Check(0, 0, 1, 0, "irm2");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope6()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -260,7 +260,7 @@ namespace System.Transactions.Tests
             irm.Check(1, 1, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope7()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -293,7 +293,7 @@ namespace System.Transactions.Tests
             irm.Check(1, 1, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope8()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -322,7 +322,7 @@ namespace System.Transactions.Tests
             irm.Check(1, 1, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope8a()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -349,7 +349,7 @@ namespace System.Transactions.Tests
             irm.Check(0, 0, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope9()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -388,7 +388,7 @@ namespace System.Transactions.Tests
             irm.Check(2, 2, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope10()
         {
             Assert.Throws<TransactionAbortedException>(() =>
@@ -418,7 +418,7 @@ namespace System.Transactions.Tests
            });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope12()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -446,7 +446,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void NestedTransactionScope13()
         {
             Assert.Throws<TransactionAbortedException>(() =>
@@ -474,7 +474,7 @@ namespace System.Transactions.Tests
 
         /* Tests using IntResourceManager */
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void RMFail1()
         {
             IntResourceManager irm = new IntResourceManager(1);
@@ -539,7 +539,7 @@ namespace System.Transactions.Tests
 
         #region Explicit Transaction Tests
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransactionCommit()
         {
             Assert.Null(Transaction.Current);
@@ -557,7 +557,7 @@ namespace System.Transactions.Tests
             Transaction.Current = oldTransaction;
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransactionRollback()
         {
             Assert.Null(Transaction.Current);
@@ -581,7 +581,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction1()
         {
             Assert.Null(Transaction.Current);
@@ -616,7 +616,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction2()
         {
             Assert.Null(Transaction.Current);
@@ -650,7 +650,7 @@ namespace System.Transactions.Tests
             Assert.Throws<TransactionAbortedException>(() => ct.Commit());
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction3()
         {
             Assert.Null(Transaction.Current);
@@ -684,7 +684,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction4()
         {
             Assert.Null(Transaction.Current);
@@ -716,7 +716,7 @@ namespace System.Transactions.Tests
             irm.Check(1, 1, 0, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction5()
         {
             Assert.Null(Transaction.Current);
@@ -746,7 +746,7 @@ namespace System.Transactions.Tests
             irm.Check(0, 0, 1, 0, "irm");
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction6()
         {
             Assert.Throws<InvalidOperationException>(() =>
@@ -761,7 +761,7 @@ namespace System.Transactions.Tests
             });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction6a()
         {
             Assert.Throws<InvalidOperationException>(() =>
@@ -779,7 +779,7 @@ namespace System.Transactions.Tests
             });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction6b()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -806,7 +806,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction6c()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -831,7 +831,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction6d()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -855,7 +855,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction6e()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -879,7 +879,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction7()
         {
             Assert.Throws<TransactionException>(() =>
@@ -894,7 +894,7 @@ namespace System.Transactions.Tests
             });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction8()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -908,7 +908,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction8a()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -923,7 +923,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction9()
         {
             Assert.Throws<InvalidOperationException>(() =>
@@ -936,7 +936,7 @@ namespace System.Transactions.Tests
             });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction10()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -958,7 +958,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction10a()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -983,7 +983,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction10b()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -1007,7 +1007,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction12()
         {
             AssertExtensions.Throws<ArgumentException>("asyncResult", () =>
@@ -1021,7 +1021,7 @@ namespace System.Transactions.Tests
             });
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction13()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -1044,7 +1044,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction14()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -1067,7 +1067,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction15()
         {
             CommittableTransaction ct = new CommittableTransaction();
@@ -1096,7 +1096,7 @@ namespace System.Transactions.Tests
             }
         }
 
-        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+        [Fact]
         public void ExplicitTransaction16()
         {
             CommittableTransaction ct = new CommittableTransaction();