diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index 666641354bf5a6..d8e8281fb7a535 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -179,6 +179,45 @@ jobs: eq(variables['monoContainsChange'], true), eq(variables['isFullMatrix'], true)) +# +# Build the whole product using Mono and run libraries tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Android_arm64 + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_AOT_Mono + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:EnableAggressiveTrimming=true + timeoutInMinutes: 180 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isFullMatrix'], true)) + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isFullMatrix'], true)) + - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 83d95eae00859f..f3c69aca3b1a41 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -80,6 +80,9 @@ AndroidTestRunner.dll + + true + @(MonoAOTCompilerDefaultAotArguments, ';') diff --git a/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs b/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs index d61144d0e43138..d66ae1cb13072a 100644 --- a/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs +++ b/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs @@ -37,7 +37,7 @@ public void RootDisposesProviders() Assert.True(provider5.IsDisposed); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void RootDisposesChangeTokenRegistrations() { var changeToken = new ChangeToken(); diff --git a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs index 43451d45301128..bac8b0ada9c1cc 100644 --- a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs +++ b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs @@ -2416,7 +2416,7 @@ public static IEnumerable CopyToAsync_AllDataCopied_MemberData() => public virtual async Task CopyToAsync_AllDataCopied_Large(bool useAsync) => await CopyToAsync_AllDataCopied(1024 * 1024, useAsync); - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : Specified method is not supported. [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51371", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index aa44cfe53f1b02..cf75f892372dc3 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -29,8 +29,11 @@ public static partial class PlatformDetection public static bool IsFreeBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")); public static bool IsNetBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")); public static bool IsAndroid => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID")); + public static bool IsAndroidAOT => IsAndroid && IsMonoAOT; + public static bool IsNotAndroidAOT => !IsAndroidAOT; public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")); + public static bool IsNotDeviceAOT => !((IsAndroid || IsiOS || IstvOS) && IsMonoAOT); public static bool IsMacCatalyst => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST")); public static bool Isillumos => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ILLUMOS")); public static bool IsSolaris => RuntimeInformation.IsOSPlatform(OSPlatform.Create("SOLARIS")); diff --git a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs index 1913f764d0c307..cddeaa1a8edf79 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs @@ -11,6 +11,7 @@ namespace Microsoft.Extensions.Configuration.FileExtensions.Test { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class FileConfigurationProviderTest { [Fact] diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs index 50f6bbdd54642b..d8c29af8d97209 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.IO; using System.Text; diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs index e7e5ce6ecb8167..c168143d538c29 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using FluentAssertions; +using System; using System.IO; using System.Reflection; using Xunit; diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs index 0c570d6a441f25..4b6c4fc85b3a31 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using FluentAssertions; +using System; using System.IO; using System.Linq; using Xunit; diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs index da09149c1adbbc..0e20c846f9e89f 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs @@ -93,7 +93,7 @@ public void GetDirectoryContents_ReturnsNonExistingEmptySequence_IfResourcesDoNo Assert.Empty(files); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDirectoryContents_ReturnsCombinaisionOFFiles() { // Arrange @@ -121,7 +121,7 @@ public void GetDirectoryContents_ReturnsCombinaisionOFFiles() file => Assert.Same(file3, file)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDirectoryContents_ReturnsCombinaitionOFFiles_WhenSomeFileProviderRetunsNoContent() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs index 72d89b17f8ab56..3ffff35afc91c2 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs @@ -82,7 +82,7 @@ public void Factory_MultipleCalls_CachesHandler() Assert.NotSame(client1, client2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Factory_DisposeClient_DoesNotDisposeHandler() { // Arrange @@ -107,7 +107,7 @@ public void Factory_DisposeClient_DoesNotDisposeHandler() // Assert (does not throw) } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Factory_DisposeHandler_DoesNotDisposeInnerHandler() { // Arrange @@ -170,7 +170,7 @@ public void Factory_CreateClient_WithName_UsesNamedOptions() Assert.Equal(1, count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Factory_CreateClient_FiltersCanDecorateBuilder() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs index 426bf7195ebd4f..df866433c45c8a 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs @@ -32,7 +32,7 @@ public void Ctor_SetsPrimaryHandler() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Build_NoAdditionalHandlers_ReturnsPrimaryHandler() { // Arrange @@ -48,7 +48,7 @@ public void Build_NoAdditionalHandlers_ReturnsPrimaryHandler() Assert.Same(builder.PrimaryHandler, handler); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Build_SomeAdditionalHandlers_PutsTogetherDelegatingHandlers() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs index 9aa83a8f34dd03..7db07192481e65 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs @@ -143,7 +143,7 @@ public void AddHttpClient_WithName_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_ConfiguresNamedClient() { // Arrange @@ -166,7 +166,7 @@ public void AddHttpClient_WithTypedClient_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithGenericTypedClient_ConfiguresNamedClient() { // Arrange @@ -189,7 +189,7 @@ public void AddHttpClient_WithGenericTypedClient_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_ConfiguresNamedClient() { // Arrange @@ -212,7 +212,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_ConfiguresNamedClient Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndName_ConfiguresNamedClient() { // Arrange @@ -235,7 +235,7 @@ public void AddHttpClient_WithTypedClient_AndName_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_AndName_ConfiguresNamedClient() { // Arrange @@ -258,7 +258,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndName_ConfiguresNam Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndDelegate_ConfiguresNamedClient() { // Arrange @@ -285,7 +285,7 @@ public void AddHttpClient_WithTypedClient_AndDelegate_ConfiguresNamedClient() Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_AndDelegate_ConfiguresNamedClient() { // Arrange @@ -312,7 +312,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndDelegate_Configure Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddTypedClient_ConfiguresNamedClient() { // Arrange @@ -335,7 +335,7 @@ public void AddHttpClient_AddTypedClient_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddTypedClientAndImplementation_ConfiguresNamedClient() { // Arrange @@ -499,7 +499,7 @@ public void AddHttpClient_WithTypedClient_WithFactoryServicesAndName_ConfiguresN Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameTypedClientTwice_WithSameName_Works() { // Arrange @@ -521,7 +521,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithSameName_Works() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameTypedClientTwice_WithSameName_WithAddTypedClient_Works() { // Arrange @@ -544,7 +544,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithSameName_WithAddTypedClien Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_IsAllowed() { // Arrange @@ -561,7 +561,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_IsAllowed() Assert.Equal(2, clients.Count()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_WithAddTypedClient_IsAllowed() { // Arrange @@ -596,7 +596,7 @@ public void AddHttpClient_AddSameNameWithTypedClientTwice_ThrowsError() ex.Message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameNameWithTypedClientTwice_WithAddTypedClient_IsAllowed() { // Arrange @@ -624,7 +624,7 @@ public void AddHttpClient_AddSameNameWithTypedClientTwice_WithAddTypedClient_IsA Assert.Equal("http://example.com/", client2.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameNameWithTypedClientTwice_WithExplicitName_IsAllowed() { // Arrange @@ -652,7 +652,7 @@ public void AddHttpClient_AddSameNameWithTypedClientTwice_WithExplicitName_IsAll Assert.Equal("http://example.com/", client2.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_RegisteringMultipleTypes_WithAddTypedClient_IsAllowed() { // Arrange @@ -709,7 +709,7 @@ public void AddHttpClient_AddTypedClient_WithServiceDelegate_ConfiguresNamedClie Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndName_AndDelegate_ConfiguresNamedClient() { // Arrange @@ -736,7 +736,7 @@ public void AddHttpClient_WithTypedClient_AndName_AndDelegate_ConfiguresNamedCli Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHttpClient() { // Arrange @@ -770,7 +770,7 @@ public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHt h => Assert.IsType(h)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresClient() { // Arrange @@ -797,7 +797,7 @@ public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_ConfiguresClient() { // Arrange @@ -824,7 +824,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_Co Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresNamedClient() { // Arrange @@ -851,7 +851,7 @@ public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresNamedClie Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_ConfiguresNamedClient() { // Arrange @@ -878,7 +878,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_Co Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHttpMessageHandler() { var serviceCollection = new ServiceCollection(); @@ -929,7 +929,7 @@ public void AddHttpClient_ProvidesSameImplementationForClientsAndHandlers() Assert.Same(clientFactory, handlerFactory); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_SingletonDependency() { // Arrange @@ -971,7 +971,7 @@ public async Task AddHttpClient_MessageHandler_SingletonDependency() #endif } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_Scope_SingletonDependency() { // Arrange @@ -1025,7 +1025,7 @@ public async Task AddHttpClient_MessageHandler_Scope_SingletonDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_MessageHandler_ScopedDependency() { // Arrange @@ -1045,7 +1045,7 @@ public void AddHttpClient_MessageHandler_ScopedDependency() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_Scope_ScopedDependency() { // Arrange @@ -1098,7 +1098,7 @@ public async Task AddHttpClient_MessageHandler_Scope_ScopedDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_TransientDependency() { // Arrange @@ -1140,7 +1140,7 @@ public async Task AddHttpClient_MessageHandler_TransientDependency() #endif } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_Scope_TransientDependency() { // Arrange @@ -1185,7 +1185,7 @@ public async Task AddHttpClient_MessageHandler_Scope_TransientDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationContext_ShouldNotHangs() { // Arrange @@ -1229,7 +1229,7 @@ public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationCon } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void SuppressScope_False_CreatesNewScope() { // Arrange @@ -1257,7 +1257,7 @@ public void SuppressScope_False_CreatesNewScope() Assert.NotSame(services, capturedServices); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void SuppressScope_False_InScope_CreatesNewScope() { // Arrange @@ -1289,7 +1289,7 @@ public void SuppressScope_False_InScope_CreatesNewScope() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void SuppressScope_True_DoesNotCreateScope() { // Arrange @@ -1317,7 +1317,7 @@ public void SuppressScope_True_DoesNotCreateScope() Assert.NotSame(services, capturedServices); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void SuppressScope_True_InScope_DoesNotCreateScope() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs index e31d7e8c26c135..cfde5b3adc9cee 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.Logging.Test { public class LoggerFactoryTest { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddProvider_ThrowsAfterDisposed() { var factory = new LoggerFactory(); @@ -52,7 +52,7 @@ public void Dispose_MultipleCallsNoop() factory.Dispose(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Dispose_ProvidersAreDisposed() { // Arrange @@ -82,7 +82,7 @@ private static ILoggerProvider CreateProvider() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Dispose_ThrowException_SwallowsException() { // Arrange @@ -493,7 +493,7 @@ public void BeginScope_ReturnsCompositeToken_ForMultipleLoggers() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateDisposeDisposesInnerServiceProvider() { var disposed = false; diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs index 52632e471466cc..08bea33562f180 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs @@ -58,10 +58,10 @@ public static void MultipleLoggers_IsEnabledReturnsCorrectValue(SourceLevels fir Assert.Equal(expected, logger.IsEnabled(LogLevel.Information)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true)] [InlineData(false)] - public static void Log_Shoud_Add_Exception_To_Message_Whether_Formatter_Is_Null_Or_Not(bool shouldFormatterBeNull) + public static void Log_Should_Add_Exception_To_Message_Whether_Formatter_Is_Null_Or_Not(bool shouldFormatterBeNull) { // Arrange Mock traceListener = new Mock(); diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs index 07bb99b3ffc3f8..ff9ee7030f1a9c 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs @@ -42,7 +42,7 @@ public void RegisteredCallbacks_AreInvokedExactlyOnce() Assert.Equal(1, count2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void HasChanged_IsTrue_IfAnyTokenHasChanged() { // Arrange @@ -59,7 +59,7 @@ public void HasChanged_IsTrue_IfAnyTokenHasChanged() Assert.True(compositeChangeToken.HasChanged); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void HasChanged_IsFalse_IfNoTokenHasChanged() { // Arrange @@ -73,7 +73,7 @@ public void HasChanged_IsFalse_IfNoTokenHasChanged() Assert.False(compositeChangeToken.HasChanged); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ActiveChangeCallbacks_IsTrue_IfAnyTokenHasActiveChangeCallbacks() { // Arrange @@ -89,7 +89,7 @@ public void ActiveChangeCallbacks_IsTrue_IfAnyTokenHasActiveChangeCallbacks() Assert.True(compositeChangeToken.ActiveChangeCallbacks); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ActiveChangeCallbacks_IsFalse_IfNoTokenHasActiveChangeCallbacks() { // Arrange diff --git a/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs b/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs index 53bc785e09deee..30f35e026efd74 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs +++ b/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Linq; using System.Runtime.CompilerServices; using Microsoft.Build.Evaluation; @@ -12,6 +13,7 @@ namespace Microsoft.NETCore.Platforms.BuildTasks.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/53999", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class GenerateRuntimeGraphTests { private Log _log; @@ -192,7 +194,6 @@ public void CanAddArchitectureToExistingGroups() AssertRuntimeGraphAdditions(additionalRIDs, expectedAdditions); } - [Fact] public void CanAddArchitectureAndVersionToExistingGroups() { @@ -236,6 +237,5 @@ public void CanAddNewGroups() AssertRuntimeGraphAdditions(additionalRIDs, expectedAdditions, "linux-musl"); } - } } diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs index a2f8632f98f395..0c235e5c883605 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs @@ -483,7 +483,7 @@ public void GetDirectoryInfo_Directory() Assert.Equal(info.Root.Name, infoFromIO.Root.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDriveInfo_Drive() { var Drives = System.IO.DriveInfo.GetDrives(); diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs index 5437590241a625..fae5009835f1f4 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs @@ -94,7 +94,7 @@ public static IEnumerable LateCall_OptionalValues_Data() static object[] CreateData(string memberName, object[] arguments, Type[] typeArguments, string expectedValue) => new object[] { memberName, arguments, typeArguments, expectedValue }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51834", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] [MemberData(nameof(LateCall_OptionalValues_Data))] public void LateCall_OptionalValues(string memberName, object[] arguments, Type[] typeArguments, string expectedValue) diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs index ce3be6dd778f0e..31aed29b3e1e9d 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs @@ -793,7 +793,7 @@ public static void TestDebuggerAttributes_Null() } #if NETCOREAPP - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void UsableWithCollectibleAssemblies() { var assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("dynamic_assembly"), AssemblyBuilderAccess.RunAndCollect); diff --git a/src/libraries/System.Collections.Immutable/tests/System.Collections.Immutable.Tests.csproj b/src/libraries/System.Collections.Immutable/tests/System.Collections.Immutable.Tests.csproj index 5dc59a38382154..3102debb7c3a13 100644 --- a/src/libraries/System.Collections.Immutable/tests/System.Collections.Immutable.Tests.csproj +++ b/src/libraries/System.Collections.Immutable/tests/System.Collections.Immutable.Tests.csproj @@ -2,7 +2,7 @@ 0436 $(NetCoreAppCurrent);net461 - true + true true $(NetCoreAppCurrent) - true + true diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/ExportBuilderUnitTests.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/ExportBuilderUnitTests.cs index 2fa7eb493cc6a0..e29b2acac80d97 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/ExportBuilderUnitTests.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/ExportBuilderUnitTests.cs @@ -8,6 +8,7 @@ namespace System.ComponentModel.Composition.Registration.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ExportBuilderUnitTests { public interface IFoo {} diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderInterfaceTests.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderInterfaceTests.cs index 252a5c1f8b53b8..8a861ce1ecd479 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderInterfaceTests.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderInterfaceTests.cs @@ -46,7 +46,7 @@ public class Importer [Import(AllowDefault=true)] public BareClass BareClass; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StandardExportInterfacesShouldWork() { var builder = new RegistrationBuilder(); diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderUnitTests.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderUnitTests.cs index f63ac12f11dd1a..84f02047ffc794 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderUnitTests.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderUnitTests.cs @@ -122,6 +122,7 @@ public ManyConstructorsController( } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class PartBuilderUnitTests { [Fact] diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationContextUnitTests.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationContextUnitTests.cs index 25a18f1bcbd46d..72000dece321eb 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationContextUnitTests.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationContextUnitTests.cs @@ -11,6 +11,7 @@ public interface IFoo { } public class FooImplementation1 : IFoo { } public class FooImplementation2 : IFoo { } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class RegistrationBuilderUnitTests { [Fact] diff --git a/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs b/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs index e0b058085c32cb..da4b236ef01141 100644 --- a/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs +++ b/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs @@ -59,7 +59,7 @@ public class Importer public BareClass BareClass { get; set; } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StandardExportInterfacesShouldWork() { // Export all interfaces except IDisposable, Export contracts on types without interfaces. except for disposable types @@ -97,7 +97,7 @@ public void StandardExportInterfacesShouldWork() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StandardExportInterfacesInterfaceFilterDefaultContractShouldWork() { //Same test as above only using default export builder @@ -134,7 +134,7 @@ public void StandardExportInterfacesInterfaceFilterDefaultContractShouldWork() Assert.NotNull(importer.BareClass); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StandardExportInterfacesInterfaceFilterConfiguredContractShouldWork() { //Same test as above only using default export builder diff --git a/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs b/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs index f981b7639f393d..2be596c49267f2 100644 --- a/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs +++ b/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs @@ -468,7 +468,7 @@ private static ConstructorInfo GetSelectedConstructor(ConventionBuilder builder, return reply; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfied_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -484,7 +484,7 @@ public void NotifyImportsSatisfied_ShouldSucceed() Assert.Equal(1, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -500,7 +500,7 @@ public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() Assert.Equal(1, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -516,7 +516,7 @@ public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() Assert.Equal(1, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAppliedToDerivedClassExportBase_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -533,7 +533,7 @@ public void NotifyImportsSatisfiedAttributeAppliedToDerivedClassExportBase_Shoul Assert.Equal(0, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedTwice_ShouldSucceed() { var builder = new ConventionBuilder(); diff --git a/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs b/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs index 966218048d1127..f1ced4774569ab 100644 --- a/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs +++ b/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs @@ -468,7 +468,7 @@ public void ExportSelectorNull_ShouldThrowArgumentNull() AssertExtensions.Throws("propertyFilter", () => builder.ForTypesMatching((t) => true).ExportProperties(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void InsideTheLambdaCallGetCustomAttributesShouldSucceed() { var builder = new ConventionBuilder(); @@ -486,7 +486,7 @@ public void InsideTheLambdaCallGetCustomAttributesShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -503,7 +503,7 @@ public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -520,7 +520,7 @@ public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedMultipleNotifications_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -536,7 +536,7 @@ public void NotifyImportsSatisfiedMultipleNotifications_ShouldSucceed() Assert.Equal(2, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedTwice_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -553,7 +553,7 @@ public void NotifyImportsSatisfiedTwice_ShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedInvalidMethod_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -569,7 +569,7 @@ public void NotifyImportsSatisfiedInvalidMethod_ShouldSucceed() Assert.Equal(0, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedPropertiesAndFields_ShouldSucceed() { var builder = new ConventionBuilder(); diff --git a/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs b/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs index a30aa0a5045be0..32fbf932b03713 100644 --- a/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs +++ b/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs @@ -61,7 +61,7 @@ public void WithProvider_NullProvider_ThrowsArgumentNullException() AssertExtensions.Throws("exportDescriptorProvider", () => configuration.WithProvider(null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithDefaultConventions_PartWithNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -75,7 +75,7 @@ public void WithDefaultConventions_PartWithNoMatchingConvention_Success() Assert.Equal("A", container.GetExport()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithDefaultConventions_IEnumerablePartsWithNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -89,7 +89,7 @@ public void WithDefaultConventions_IEnumerablePartsWithNoMatchingConvention_Succ Assert.Equal("A", container.GetExport()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithDefaultConventions_PartsArrayWithNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -103,7 +103,7 @@ public void WithDefaultConventions_PartsArrayWithNoMatchingConvention_Success() Assert.Equal("A", container.GetExport()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithDefaultConventions_PartTNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -138,7 +138,7 @@ public void WithDefaultConventions_AlreadyHasDefaultConventions_ThrowsInvalidOpe Assert.Throws(() => configuration.WithDefaultConventions(new ConventionBuilder())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithPartT_Convention_Success() { var conventions = new ConventionBuilder(); @@ -151,7 +151,7 @@ public void WithPartT_Convention_Success() Assert.Equal("A", container.GetExport()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithPart_Convention_Success() { var conventions = new ConventionBuilder(); @@ -172,7 +172,7 @@ public void WithPart_NullPartType_ThrowsArgumentNullException() AssertExtensions.Throws("partType", () => configuration.WithPart(null, new ConventionBuilder())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithParts_Convention_Success() { var conventions = new ConventionBuilder(); @@ -254,7 +254,7 @@ public void WithAssemby_Null_ThrowsNullReferenceExceptionOnCreation() Assert.Throws(() => configuration.CreateContainer()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_ExportedSubClass_Success() { CompositionHost container = new ContainerConfiguration() @@ -274,7 +274,7 @@ public class Base public object Prop { get; set; } = "Derived"; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_OpenGenericTypes_Success() { var conventions = new ConventionBuilder(); @@ -303,7 +303,7 @@ public EFRepository(IContainer test) { } public T Fetch() => default(T); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_ImportConventionsWithInheritedProperties_Success() { var conventions = new ConventionBuilder(); @@ -330,7 +330,7 @@ public class BaseWithImport public class DerivedFromBaseWithImport : BaseWithImport { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_ExportConventionsWithInheritedProperties_Success() { var conventions = new ConventionBuilder(); @@ -351,7 +351,7 @@ public class BaseWithExport public class DerivedFromBaseWithExport : BaseWithExport { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_ExportsToInheritedProperties_DontInterfereWithBase() { var conventions = new ConventionBuilder(); @@ -419,7 +419,7 @@ public class BaseWithCustomExport { } public class DerivedFromBaseWithCustomExport : BaseWithCustomExport { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_OpenGenericTypePart_Success() { ContainerConfiguration configuration = new ContainerConfiguration().WithParts(typeof(GenericExportedType<>)); @@ -593,7 +593,7 @@ public void DebuggerAttributes_GetViaReflection_Success(ContainerConfiguration c } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContiner_GenericExportWithDependencyConstructorHasConvention_Success() { var conventions = new ConventionBuilder(); diff --git a/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs b/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs index 291a1e5bbf13a4..8ce2092f04b240 100644 --- a/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs +++ b/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs @@ -11,6 +11,7 @@ namespace System.Composition.TypedParts.Tests /// /// Tests dealing with reflection usage in System.Composition /// + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ReflectionTests { public static bool HasMultiplerProcessors { get; } = Environment.ProcessorCount > 1; diff --git a/src/libraries/System.Composition.TypedParts/tests/System.Composition.TypedParts.Tests.csproj b/src/libraries/System.Composition.TypedParts/tests/System.Composition.TypedParts.Tests.csproj index 293590ae99aff9..5b39779f33d912 100644 --- a/src/libraries/System.Composition.TypedParts/tests/System.Composition.TypedParts.Tests.csproj +++ b/src/libraries/System.Composition.TypedParts/tests/System.Composition.TypedParts.Tests.csproj @@ -1,7 +1,7 @@ $(NetCoreAppCurrent);net461 - true + true diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs index a095dc87007c08..7605c60f17180f 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs @@ -10,7 +10,7 @@ namespace System.Diagnostics.SymbolStore.Tests public class StackTraceSymbolsTests { [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51399", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51399", TestPlatforms.Android | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void StackTraceSymbolsDoNotLockFile() { var asmPath = AssemblyPathHelper.GetAssemblyLocation(typeof(StackTraceSymbolsTests).Assembly); diff --git a/src/libraries/System.Drawing.Primitives/tests/DataContractSerializerTests.cs b/src/libraries/System.Drawing.Primitives/tests/DataContractSerializerTests.cs index 037e05a3f33e1f..c2a4af2613de2a 100644 --- a/src/libraries/System.Drawing.Primitives/tests/DataContractSerializerTests.cs +++ b/src/libraries/System.Drawing.Primitives/tests/DataContractSerializerTests.cs @@ -12,6 +12,7 @@ namespace System.Drawing.Primitives.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class DataContractSerializerTests { [Fact] diff --git a/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj b/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj index 53f60dbcb90928..68b3955aae7cd1 100644 --- a/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj +++ b/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj @@ -1,7 +1,7 @@ $(NetCoreAppCurrent) - true + true diff --git a/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs b/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs index d265baec831d56..db55cab9f27c1a 100644 --- a/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs +++ b/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs @@ -9,6 +9,11 @@ namespace System.Formats.Cbor.Tests { + // TODO Find out the way to skip individual tests failing with "Attempting to JIT compile method ... while running in aot-only mode.": + // - CborDocument_SkipValue + // - CborDocument_SkipToParent + // - CborDocument_Roundtrip + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static class CborPropertyTests { private const string? ReplaySeed = "(42,42)"; // set a seed for deterministic runs, null for randomized runs diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs index c922752d447572..8f6ca2b0164791 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs @@ -22,7 +22,7 @@ public void TestConstructor() Assert.Equal("/", new DriveInfo("/").Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [PlatformSpecific(TestPlatforms.AnyUnix)] public void TestGetDrives() { diff --git a/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs b/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs index 1570fd1ed91474..7f7cb678b5eb1d 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs @@ -11,6 +11,7 @@ namespace System.IO.Pipelines.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/53679", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class PipeWriterStreamTests { public delegate Task WriteAsyncDelegate(Stream stream, byte[] data); diff --git a/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs b/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs index 7c0d860c34c0d9..24498e1385380e 100644 --- a/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs +++ b/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs @@ -9,6 +9,7 @@ namespace System.IO.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/53679", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class StreamCopyToTests { [Fact] diff --git a/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs b/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs index 3eca83cf8fbb12..34a798e7a64ff6 100644 --- a/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs +++ b/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Threading.Tasks; +using Xunit; namespace System.IO.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/53679", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class SyncStreamConformanceTests : StandaloneStreamConformanceTests { protected override bool NopFlushCompletesSynchronously => false; diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs index 8b81af1ff87afe..ccd7b51ed7d267 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs @@ -7,6 +7,7 @@ namespace System.Linq.Parallel.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static class GroupJoinTests { private const int KeyFactor = 8; diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs index 31f55759e4f8c2..90054ceb1d8ceb 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs @@ -7,6 +7,7 @@ namespace System.Linq.Parallel.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static class JoinTests { private const int KeyFactor = 8; diff --git a/src/libraries/System.Linq/tests/OrderByTests.cs b/src/libraries/System.Linq/tests/OrderByTests.cs index 095e5cc81ebdee..9c5dc16d981d97 100644 --- a/src/libraries/System.Linq/tests/OrderByTests.cs +++ b/src/libraries/System.Linq/tests/OrderByTests.cs @@ -428,7 +428,7 @@ public void OrderByIsCovariantTestWithAssignToArgument() Assert.Equal(expected, covariantOrdered); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CanObtainFromCovariantIOrderedQueryable() { // If an ordered queryable is cast covariantly and then has ThenBy() called on it, diff --git a/src/libraries/System.Linq/tests/System.Linq.Tests.csproj b/src/libraries/System.Linq/tests/System.Linq.Tests.csproj index cd15cfbbf59d5d..91617d8d5f2910 100644 --- a/src/libraries/System.Linq/tests/System.Linq.Tests.csproj +++ b/src/libraries/System.Linq/tests/System.Linq.Tests.csproj @@ -1,7 +1,7 @@ $(NetCoreAppCurrent) - true + true diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs index 580806a40aac31..6a9f99826232b2 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs @@ -13,7 +13,7 @@ namespace System.Net.Http.Json.Functional.Tests { public class HttpClientJsonExtensionsTests { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadFromJsonTestData))] public async Task TestGetFromJsonAsync(string json, bool containsQuotedNumbers) { @@ -80,7 +80,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(statusCode: HttpStatusCode.InternalServerError)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestPostAsJsonAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -123,7 +123,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestPutAsJsonAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -231,7 +231,7 @@ private void ValidateRequest(HttpRequestData requestData) Assert.Equal("application/json; charset=utf-8", contentType.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AllowNullRequesturlAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpContentJsonExtensionsTests.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpContentJsonExtensionsTests.cs index ebc3dc4dcc071b..d58ab3beb879d3 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpContentJsonExtensionsTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpContentJsonExtensionsTests.cs @@ -22,7 +22,7 @@ public void ThrowOnNull() AssertExtensions.Throws("content", () => content.ReadFromJsonAsync(typeof(Person))); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadFromJsonTestData))] public async Task HttpContentGetThenReadFromJsonAsync(string json) { @@ -53,7 +53,7 @@ public static IEnumerable ReadFromJsonTestData() yield return new object[] { per.SerializeWithNumbersAsStrings() }; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task HttpContentReturnValueIsNull() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -75,7 +75,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: _headers, content: "null")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestReadFromJsonNoMessageBodyAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -94,7 +94,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: _headers)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestGetFromJsonQuotedCharSetAsync() { List customHeaders = new List @@ -117,7 +117,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: customHeaders, content: Person.Create().Serialize())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestGetFromJsonThrowOnInvalidCharSetAsync() { List customHeaders = new List @@ -140,7 +140,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: customHeaders, content: Person.Create().Serialize())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestGetFromJsonAsyncTextPlainUtf16Async() { string json = Person.Create().Serialize(); @@ -168,7 +168,8 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( await server.HandleRequestAsync(statusCode: HttpStatusCode.OK, headers: headers, bytes: Encoding.Unicode.GetBytes(json)); }); } - [Fact] + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task EnsureDefaultJsonSerializerOptionsAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -184,7 +185,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: _headers, content: "{}")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData("application/json")] [InlineData("Application/Json")] [InlineData("application/foo+json")] // Structured Syntax Json Suffix diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs index 3fac43d3511c1a..6fbf27f420f7bf 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs @@ -69,7 +69,7 @@ public void TestJsonContentMediaType() Assert.Same(mediaType, content.Headers.ContentType); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task SendQuotedCharsetAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -103,7 +103,7 @@ public void TestJsonContentContentTypeIsNotTheSameOnMultipleInstances() Assert.NotSame(jsonContent1.Headers.ContentType, jsonContent2.Headers.ContentType); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task JsonContentMediaTypeValidateOnServerAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -161,7 +161,7 @@ public void JsonContentThrowsOnIncompatibleTypeAsync() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task ValidateUtf16IsTranscodedAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -184,7 +184,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task EnsureDefaultJsonSerializerOptionsAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -202,7 +202,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestJsonContentNullContentTypeAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs index 698a4187a87c59..8e71bd742550e5 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs @@ -16,13 +16,13 @@ public class JsonContentTests_Sync : JsonContentTestsBase { protected override Task SendAsync(HttpClient client, HttpRequestMessage request) => Task.Run(() => client.Send(request)); - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void JsonContent_CopyTo_Succeeds() { Person person = Person.Create(); using JsonContent content = JsonContent.Create(person); using MemoryStream stream = new MemoryStream(); - // HttpContent.CopyTo internally calls overriden JsonContent.SerializeToStream, which is the targeted method of this test. + // HttpContent.CopyTo internally calls overridden JsonContent.SerializeToStream, which is the targeted method of this test. content.CopyTo(stream, context: null, cancellationToken: default); stream.Seek(0, SeekOrigin.Begin); using StreamReader reader = new StreamReader(stream); diff --git a/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingReadStreamTests.cs b/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingReadStreamTests.cs index 67fa25cd519789..7378ef46ce14ef 100644 --- a/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingReadStreamTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingReadStreamTests.cs @@ -213,7 +213,7 @@ internal static TheoryData GetUnicodeText(int maxCharBufferSize) }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadAsyncInputLatin), "utf-32")] [MemberData(nameof(ReadAsyncInputUnicode), "utf-32")] public Task ReadAsync_Works_WhenInputIs_UTF32(string message) @@ -222,7 +222,7 @@ public Task ReadAsync_Works_WhenInputIs_UTF32(string message) return ReadAsyncTest(sourceEncoding, message); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadAsyncInputLatin), "utf-16")] [MemberData(nameof(ReadAsyncInputUnicode), "utf-16")] public Task ReadAsync_Works_WhenInputIs_Unicode(string message) @@ -231,7 +231,7 @@ public Task ReadAsync_Works_WhenInputIs_Unicode(string message) return ReadAsyncTest(sourceEncoding, message); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadAsyncInputLatin), "iso-8859-1")] public Task ReadAsync_Works_WhenInputIs_WesternEuropeanEncoding(string message) { @@ -240,7 +240,7 @@ public Task ReadAsync_Works_WhenInputIs_WesternEuropeanEncoding(string message) return ReadAsyncTest(sourceEncoding, message); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadAsyncInputLatin), "us-ascii")] public Task ReadAsync_Works_WhenInputIs_ASCII(string message) { diff --git a/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingWriteStreamTests.cs b/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingWriteStreamTests.cs index f9e7126fe49b18..851a266a19ee5f 100644 --- a/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingWriteStreamTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingWriteStreamTests.cs @@ -15,6 +15,7 @@ namespace System.Net.Http.Json.Functional.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class TranscodingWriteStreamTest { public static TheoryData WriteAsyncInputLatin => diff --git a/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs b/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs index 2a25ea71961915..bfd03f54e2f710 100644 --- a/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs +++ b/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs @@ -1502,6 +1502,7 @@ public void NonValidated_SetMultipleValuesOnSingleValueHeader_AllHeaderValuesRet } [ActiveIssue("https://github.com/dotnet/runtime/issues/53647", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53647", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [Fact] public void NonValidated_ValidAndInvalidValues_DictionaryMembersWork() { @@ -1540,6 +1541,7 @@ public void NonValidated_ValidAndInvalidValues_DictionaryMembersWork() } [ActiveIssue("https://github.com/dotnet/runtime/issues/53647", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53647", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [Fact] public void NonValidated_ValidInvalidAndRaw_AllReturned() { diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs index 364c4f880082b8..a6c6e58ddff125 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs @@ -16,6 +16,7 @@ using System.Xml.Serialization; using Xunit; +[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static partial class XmlSerializerTests { #if ReflectionOnly|| XMLSERIALIZERGENERATORTESTS diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit1Tests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit1Tests.cs index c7bfc39baeb58e..c0479c6162b48f 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit1Tests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit1Tests.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Emit.Tests { public class ILGeneratorEmit1 { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest1() { ModuleBuilder module = Helpers.DynamicModule(); @@ -42,7 +42,7 @@ public void PosTest1() Assert.Equal(expectedRet, createdMethod2.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest2() { ModuleBuilder module = Helpers.DynamicModule(); @@ -76,7 +76,7 @@ public void PosTest2() Assert.Equal(expectedRet, createdMethod2.Invoke(Activator.CreateInstance(createdType2), null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest3() { ModuleBuilder modbuild = Helpers.DynamicModule(); @@ -114,7 +114,7 @@ public void PosTest3() Assert.Equal(expectedRet, createdMethod2.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest4() { ModuleBuilder module = Helpers.DynamicModule(); @@ -152,7 +152,7 @@ public void PosTest4() Assert.Equal(expectedRet, createdMethod2.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest5() { ModuleBuilder module = Helpers.DynamicModule(); diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit3Tests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit3Tests.cs index 2a1d4e9501930e..7a53af41b3d652 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit3Tests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit3Tests.cs @@ -9,7 +9,7 @@ public struct EmitStruct3 { } public class ILGeneratorEmit3 { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest1() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); @@ -87,7 +87,7 @@ public void PosTest1() Assert.True((bool)createdMethod.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest2() { TypeBuilder tb = Helpers.DynamicType(TypeAttributes.Public); @@ -111,7 +111,7 @@ public void PosTest2() Assert.True((bool)createdMethod.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest3() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); @@ -132,7 +132,7 @@ public void PosTest3() Assert.True((bool)createdMethod.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest4() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit4Tests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit4Tests.cs index 96aae7540ae3ea..fea9c57ec4f5ef 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit4Tests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit4Tests.cs @@ -10,7 +10,7 @@ namespace System.Reflection.Emit.Tests [ActiveIssue("https://github.com/dotnet/runtime/issues/2383", TestPlatforms.Browser)] public class ILGeneratorEmit4 { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestEmitCalliBlittable() { int a = 1, b = 1, result = 2; @@ -45,7 +45,7 @@ public void TestEmitCalliBlittable() Assert.Equal(result, resultValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestEmitCalliManagedBlittable() { int a = 1, b = 1, result = 2; @@ -78,7 +78,7 @@ public void TestEmitCalliManagedBlittable() Assert.Equal(result, resultValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestDynamicMethodEmitCalliBlittable() { int a = 1, b = 1, result = 2; @@ -141,7 +141,7 @@ public void TestEmitCalliNonBlittable() Assert.Equal(result, resultValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestDynamicMethodEmitCalliNonBlittable() { string input = "Test string!", result = "!gnirts tseT"; diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitMethodInfo.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitMethodInfo.cs index 3940c1559b8040..c1f8357b6f25aa 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitMethodInfo.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitMethodInfo.cs @@ -15,6 +15,8 @@ public interface IWithIn { void Method(in int arg); } + + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ILGeneratorEmitMethodInfo { [Fact] diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitWriteLineTests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitWriteLineTests.cs index 392ecfda7fa2b9..50064318d3734d 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitWriteLineTests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitWriteLineTests.cs @@ -5,6 +5,7 @@ namespace System.Reflection.Emit.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ILGeneratorEmitWriteLine { [Fact] diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs index e99a27e5470e73..743c806a190009 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs @@ -5,9 +5,9 @@ namespace System.Reflection.Emit.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ExceptionEmitTests { - [Fact] public void TestExceptionEmitCalls() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.NotPublic); diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs index be0568e20ee1f0..942efd8d10d784 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs @@ -95,6 +95,7 @@ private IEnumerable GetTags() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public void ValidateTagToTokenConversion() { foreach (var tag in GetTags()) diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs index 464a925598097c..b9e30ac12dca2f 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs @@ -324,6 +324,7 @@ public static void DuplicateSignedAndUnsignedAssemblies() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53680", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public static void RelocatableAssembly() { string coreAssemblyPath = TestUtils.GetPathToCoreAssembly(); diff --git a/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs b/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs index 378a416210d620..bf134a587f7e7d 100644 --- a/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs +++ b/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs @@ -339,7 +339,8 @@ public static void BinaryFormattedResourcesWithoutTypeName() } } } - [Fact] + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed [ActiveIssue("https://github.com/dotnet/runtime/issues/34495", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static void TypeConverterByteArrayResources() { @@ -372,7 +373,7 @@ public static void TypeConverterByteArrayResources() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed public static void TypeConverterStringResources() { var values = TestData.StringConverter; @@ -402,7 +403,7 @@ public static void TypeConverterStringResources() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed [ActiveIssue("https://github.com/dotnet/runtime/issues/34495", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtime/issues/34008", TestPlatforms.Linux, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static void StreamResources() @@ -468,7 +469,7 @@ public static void CanReadViaResourceManager() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed public static void ResourceManagerLoadsCorrectReader() { ResourceManager resourceManager = new ResourceManager(typeof(TestData)); diff --git a/src/libraries/System.Resources.Reader/tests/ResourceReaderUnitTest.cs b/src/libraries/System.Resources.Reader/tests/ResourceReaderUnitTest.cs index ec22708125ab66..65c9bd6bbaadc8 100644 --- a/src/libraries/System.Resources.Reader/tests/ResourceReaderUnitTest.cs +++ b/src/libraries/System.Resources.Reader/tests/ResourceReaderUnitTest.cs @@ -263,7 +263,7 @@ public static void Exception_Enumerator_Value() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed [ActiveIssue("https://github.com/dotnet/runtime/issues/51833", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public static void ReadV1Resources() { diff --git a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs index 7360975078abae..dc3d3b8504625a 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs @@ -262,6 +262,7 @@ public void ExecuteAssemblyByName() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53681", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public void ExecuteAssembly() { CopyTestAssemblies(); diff --git a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs index ed12573ab7d988..3735112962e34e 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs @@ -546,7 +546,7 @@ public unsafe void GetFolderPath_Windows(Environment.SpecialFolder folder) Assert.Equal(folderPath, knownFolder); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invokes public void GetLogicalDrives_Unix_AtLeastOneIsRoot() { diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs index 59274bd8a298f8..07d4e850dfa55a 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs @@ -13,6 +13,7 @@ public class IDispatchImplAttributeTests [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/50717", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50717", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [InlineData(-1)] [InlineData(0)] [InlineData(2)] diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs index c11c75545d10f9..0c558ce5ccc273 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs @@ -13,7 +13,7 @@ namespace System.Runtime.InteropServices.Tests [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public class GetDelegateForFunctionPointerTests { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(typeof(NonGenericDelegate))] [InlineData(typeof(MulticastDelegate))] [InlineData(typeof(OtherNonGenericDelegate))] @@ -28,7 +28,7 @@ public void GetDelegateForFunctionPointer_NonGeneric_ReturnsExpected(Type t) VerifyDelegate(functionDelegate, targetMethod); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDelegateForFunctionPointer_CollectibleType_ReturnsExpected() { MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); @@ -51,7 +51,7 @@ public void GetDelegateForFunctionPointer_CollectibleType_ReturnsExpected() VerifyDelegate(functionDelegate, targetMethod); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDelegateForFunctionPointer_Generic_ReturnsExpected() { MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); @@ -63,7 +63,7 @@ public void GetDelegateForFunctionPointer_Generic_ReturnsExpected() VerifyDelegate(functionDelegate, targetMethod); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDelegateForFunctionPointer_GenericInvalidType_ReturnsExpected() { MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); @@ -139,7 +139,7 @@ public void GetDelegateForFunctionPointer_InvalidType_ThrowsArgumentException(Ty AssertExtensions.Throws("t", () => Marshal.GetDelegateForFunctionPointer((IntPtr)1, t)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDelegateForFunctionPointer_CantCast_ThrowsInvalidCastException() { MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs index 85328ac8026965..2114bb06f2d0c8 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs @@ -10,7 +10,7 @@ namespace System.Runtime.InteropServices.Tests { public class GetFunctionPointerForDelegateTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_NormalDelegateNonGeneric_ReturnsExpected() { @@ -23,7 +23,7 @@ public void GetFunctionPointerForDelegate_NormalDelegateNonGeneric_ReturnsExpect Assert.Equal(pointer1, pointer2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_MarshalledDelegateNonGeneric_ReturnsExpected() { @@ -40,7 +40,7 @@ public void GetFunctionPointerForDelegate_MarshalledDelegateNonGeneric_ReturnsEx Assert.Equal(pointer1, pointer2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_NormalDelegateGeneric_ReturnsExpected() { @@ -53,7 +53,7 @@ public void GetFunctionPointerForDelegate_NormalDelegateGeneric_ReturnsExpected( Assert.Equal(pointer1, pointer2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_MarshalledDelegateGeneric_ReturnsExpected() { diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/IsComObjectTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/IsComObjectTests.cs index 456f68f7ad797d..ec00bb1d4dbfaf 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/IsComObjectTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/IsComObjectTests.cs @@ -53,7 +53,7 @@ public static IEnumerable IsComObject_TestData() yield return new object[] { collectibleComImportObject }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(IsComObject_TestData))] public void IsComObject_NonComObject_ReturnsFalse(object value) { diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs index f2a6c2b5d80084..5531409b892f4c 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs @@ -12,7 +12,7 @@ namespace System.Runtime.InteropServices.Tests { public class PtrToStructureTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StructureToPtr_NonGenericType_ReturnsExpected() { var structure = new SequentialClass @@ -63,7 +63,7 @@ public void StructureToPtr_GenericType_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StructureToPtr_NonGenericObject_ReturnsExpected() { var structure = new SomeTestStruct @@ -89,7 +89,7 @@ public void StructureToPtr_NonGenericObject_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StructureToPtr_GenericObject_ReturnsExpected() { var structure = new SomeTestStruct diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs index 10149bdc8e007f..c2a7807f9f145f 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs @@ -12,6 +12,7 @@ public class SetWin32ContextInIDispatchAttributeTests [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public void Ctor_Default_ExistsInSrc() { Type type = typeof(HandleCollector).Assembly.GetType(TypeName); diff --git a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs index 87cd3085c99e3f..4aa88302ef0fe7 100644 --- a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs @@ -1389,7 +1389,7 @@ public static void DCJS_EmptyString_Throws() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCJS_ClassWithDatetimeOffsetTypeProperty() { var value = new TypeWithDateTimeOffsetTypeProperty() { ModifiedTime = new DateTimeOffset(new DateTime(2013, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc)) }; @@ -1457,7 +1457,7 @@ public static void DCJS_TypeWithGenericDictionaryAsKnownType() Assert.StrictEqual(2, deserializedValue.Foo[20].LevelNo); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCJS_TypeWithKnownTypeAttributeAndInterfaceMember() { TypeWithKnownTypeAttributeAndInterfaceMember value = new TypeWithKnownTypeAttributeAndInterfaceMember(); @@ -1468,7 +1468,7 @@ public static void DCJS_TypeWithKnownTypeAttributeAndInterfaceMember() Assert.Equal("Foo News", deserializedValue.HeadLine.Title); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCJS_TypeWithKnownTypeAttributeAndListOfInterfaceMember() { TypeWithKnownTypeAttributeAndListOfInterfaceMember value = new TypeWithKnownTypeAttributeAndListOfInterfaceMember(); @@ -2559,7 +2559,7 @@ public static void DCJS_VerifyDateTimeForFormatStringDCJsonSerSetting() Assert.Equal(value, actual); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCJS_VerifyDateTimeForFormatStringDCJsonSerSettings() { var jsonTypes = new JsonTypes(); diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs index 2a39358aa09bb5..ea571396b886e7 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs @@ -33,7 +33,7 @@ static DataContractSerializerTests() method.Invoke(null, new object[] { 1 }); } #endif - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DateTimeOffsetAsRoot() { // Assume that UTC offset doesn't change more often than once in the day 2013-01-02 @@ -260,7 +260,7 @@ public static void DCS_UriAsRoot() Assert.StrictEqual(DataContractSerializerHelper.SerializeAndDeserialize(new Uri("http://abc/def/x.aspx?p1=12&p2=34"), @"http://abc/def/x.aspx?p1=12&p2=34"), new Uri("http://abc/def/x.aspx?p1=12&p2=34")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayAsRoot() { SimpleType[] x = new SimpleType[] { new SimpleType { P1 = "abc", P2 = 11 }, new SimpleType { P1 = "def", P2 = 12 } }; @@ -269,7 +269,7 @@ public static void DCS_ArrayAsRoot() Utils.Equal(x, y, (a, b) => { return SimpleType.AreEqual(a, b); }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayAsGetSet() { TypeWithGetSetArrayMembers x = new TypeWithGetSetArrayMembers @@ -288,7 +288,7 @@ public static void DCS_ArrayAsGetSet() Assert.Equal(x.P2, y.P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayAsGetOnly() { TypeWithGetOnlyArrayProperties x = new TypeWithGetOnlyArrayProperties(); @@ -304,7 +304,7 @@ public static void DCS_ArrayAsGetOnly() Assert.Equal(x.P2, y.P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryGenericRoot() { Dictionary x = new Dictionary(); @@ -319,7 +319,7 @@ public static void DCS_DictionaryGenericRoot() Assert.True(y["two"] == 2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryGenericMembers() { TypeWithDictionaryGenericMembers x = new TypeWithDictionaryGenericMembers @@ -378,7 +378,7 @@ public static void DCS_DictionaryGenericMembers() Assert.True(y.RO2[false] == 'b'); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryRoot() { MyDictionary x = new MyDictionary(); @@ -393,7 +393,7 @@ public static void DCS_DictionaryRoot() Assert.True((string)y[2] == "two"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryMembers() { TypeWithDictionaryMembers x = new TypeWithDictionaryMembers(); @@ -454,7 +454,7 @@ public static void DCS_DictionaryMembers() Assert.True((char)y.RO2[false] == 'b'); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithIDictionaryPropertyInitWithConcreteType() { // Test for Bug 876869 : [Serialization] Concrete type not inferred for DCS @@ -472,7 +472,7 @@ public static void DCS_TypeWithIDictionaryPropertyInitWithConcreteType() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ListGenericRoot() { List x = new List(); @@ -487,7 +487,7 @@ public static void DCS_ListGenericRoot() Assert.True(y[1] == "one"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ListGenericMembers() { TypeWithListGenericMembers x = new TypeWithListGenericMembers(); @@ -548,7 +548,7 @@ public static void DCS_ListGenericMembers() Assert.True(y.RO2[1] == 'd'); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionGenericRoot() { MyCollection x = new MyCollection("a1", "a2"); @@ -562,7 +562,7 @@ public static void DCS_CollectionGenericRoot() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionGenericMembers() { TypeWithCollectionGenericMembers x = new TypeWithCollectionGenericMembers @@ -613,7 +613,7 @@ public static void DCS_CollectionGenericMembers() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ListRoot() { MyList x = new MyList("a1", "a2"); @@ -628,7 +628,7 @@ public static void DCS_ListRoot() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ListMembers() { TypeWithListMembers x = new TypeWithListMembers @@ -662,7 +662,7 @@ public static void DCS_ListMembers() Assert.True((string)x.RO2[0] == (string)y.RO2[0], getCheckFailureMsg("RO2")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableGenericRoot() { MyEnumerable x = new MyEnumerable("a1", "a2"); @@ -675,7 +675,7 @@ public static void DCS_EnumerableGenericRoot() Assert.Equal("a1a2", actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableGenericMembers() { TypeWithEnumerableGenericMembers x = new TypeWithEnumerableGenericMembers @@ -697,7 +697,7 @@ public static void DCS_EnumerableGenericMembers() Assert.True(y.RO1.Count == 1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionRoot() { MyCollection x = new MyCollection('a', 45); @@ -709,7 +709,7 @@ public static void DCS_CollectionRoot() Assert.True((int)y[1] == 45); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionMembers() { TypeWithCollectionMembers x = new TypeWithCollectionMembers @@ -746,7 +746,7 @@ public static void DCS_CollectionMembers() Assert.True((string)y.RO1[0] == "abc"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableRoot() { MyEnumerable x = new MyEnumerable("abc", 3); @@ -758,7 +758,7 @@ public static void DCS_EnumerableRoot() Assert.True((int)y[1] == 3); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableMembers() { TypeWithEnumerableMembers x = new TypeWithEnumerableMembers @@ -793,7 +793,7 @@ public static void DCS_EnumerableMembers() Assert.True((char)y.RO1[0] == 'x'); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableMemberConcreteTypeWithoutDefaultContructor() { TypeWithEnumerableMembers x = new TypeWithEnumerableMembers @@ -820,7 +820,7 @@ public static void DCS_EnumerableMemberConcreteTypeWithoutDefaultContructor() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CustomType() { MyTypeA x = new MyTypeA @@ -838,7 +838,7 @@ public static void DCS_CustomType() Assert.StrictEqual(x.PropY, y.PropY); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithPrivateFieldAndPrivateGetPublicSetProperty() { TypeWithPrivateFieldAndPrivateGetPublicSetProperty x = new TypeWithPrivateFieldAndPrivateGetPublicSetProperty @@ -850,7 +850,7 @@ public static void DCS_TypeWithPrivateFieldAndPrivateGetPublicSetProperty() Assert.Null(y.GetName()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractAttribute() { DataContractSerializerHelper.SerializeAndDeserialize(new DCA_1 { P1 = "xyz" }, @""); @@ -860,13 +860,13 @@ public static void DCS_DataContractAttribute() DataContractSerializerHelper.SerializeAndDeserialize(new DCA_5 { P1 = "xyz" }, @""); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataMemberAttribute() { DataContractSerializerHelper.SerializeAndDeserialize(new DMA_1 { P1 = "abc", P2 = 12, P3 = true, P4 = 'a', P5 = 10, MyDataMemberInAnotherNamespace = new MyDataContractClass04_1() { MyDataMember = "Test" }, Order100 = true, OrderMaxValue = false }, @"Testabc971012truetruefalse"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_IgnoreDataMemberAttribute() { IDMA_1 x = new IDMA_1 { MyDataMember = "MyDataMember", MyIgnoreDataMember = "MyIgnoreDataMember", MyUnsetDataMember = "MyUnsetDataMember" }; @@ -891,7 +891,7 @@ public static void DCS_EnumAsRoot() Assert.StrictEqual(ULongEnum.Option1, DataContractSerializerHelper.SerializeAndDeserialize(ULongEnum.Option1, @"Option1")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumAsMember() { TypeWithEnumMembers x = new TypeWithEnumMembers { F1 = MyEnum.Three, P1 = MyEnum.Two }; @@ -902,7 +902,7 @@ public static void DCS_EnumAsMember() Assert.StrictEqual(x.P1, y.P1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DCClassWithEnumAndStruct() { var x = new DCClassWithEnumAndStruct(true); @@ -912,7 +912,7 @@ public static void DCS_DCClassWithEnumAndStruct() Assert.StrictEqual(x.MyEnum1, y.MyEnum1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SuspensionManager() { var x = new Dictionary(); @@ -927,7 +927,7 @@ public static void DCS_SuspensionManager() Assert.Equal("subkey1value", ((y["Key1"] as Dictionary)["subkey1"]) as string); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BuiltInTypes() { BuiltInTypes x = new BuiltInTypes @@ -940,14 +940,14 @@ public static void DCS_BuiltInTypes() Assert.Equal(x.ByteArray, y.ByteArray); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CircularLink() { CircularLinkDerived circularLinkDerived = new CircularLinkDerived(true); DataContractSerializerHelper.SerializeAndDeserialize(circularLinkDerived, @""); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataMemberNames() { var obj = new AppEnvironment() @@ -960,7 +960,7 @@ public static void DCS_DataMemberNames() Assert.Equal(obj.ScreenOrientation, actual.ScreenOrientation); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericBase() { var actual = DataContractSerializerHelper.SerializeAndDeserialize>(new GenericBase2(true), @""); @@ -969,13 +969,13 @@ public static void DCS_GenericBase() Assert.True(actual.genericData2 is SimpleBaseDerived2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericContainer() { DataContractSerializerHelper.SerializeAndDeserialize(new GenericContainer(true), @""); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryWithVariousKeyValueTypes() { var x = new DictionaryWithVariousKeyValueTypes(true); @@ -991,7 +991,7 @@ public static void DCS_DictionaryWithVariousKeyValueTypes() Assert.Null(y.WithNullables[short.MaxValue]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypesWithArrayOfOtherTypes() { var x = new TypeHasArrayOfASerializedAsB(true); @@ -1001,7 +1001,7 @@ public static void DCS_TypesWithArrayOfOtherTypes() Assert.Equal(x.Items[1].Name, y.Items[1].Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithDuplicateNames() { var x = new WithDuplicateNames(true); @@ -1014,7 +1014,7 @@ public static void DCS_WithDuplicateNames() Assert.StrictEqual(x.StructA2, y.StructA2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_XElementAsRoot() { var original = new XElement("ElementName1"); @@ -1025,7 +1025,7 @@ public static void DCS_XElementAsRoot() VerifyXElementObject(original, actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithXElement() { var original = new WithXElement(true); @@ -1045,7 +1045,7 @@ private static void VerifyXElementObject(XElement x1, XElement x2, bool checkFir } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithXElementWithNestedXElement() { var original = new WithXElementWithNestedXElement(true); @@ -1055,7 +1055,7 @@ public static void DCS_WithXElementWithNestedXElement() VerifyXElementObject((XElement)original.e1.FirstNode, (XElement)actual.e1.FirstNode); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithArrayOfXElement() { var original = new WithArrayOfXElement(true); @@ -1067,7 +1067,7 @@ public static void DCS_WithArrayOfXElement() VerifyXElementObject(original.a[2], actual.a[2], checkFirstAttribute: false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithListOfXElement() { var original = new WithListOfXElement(true); @@ -1079,7 +1079,7 @@ public static void DCS_WithListOfXElement() VerifyXElementObject(original.list[2], actual.list[2], checkFirstAttribute: false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51679", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] public static void DCS_DerivedTypeWithDifferentOverrides() { @@ -1093,7 +1093,7 @@ public static void DCS_DerivedTypeWithDifferentOverrides() Assert.Equal(x.Name5, y.Name5); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeNamesWithSpecialCharacters() { var x = new __TypeNameWithSpecialCharacters\u6F22\u00F1() { PropertyNameWithSpecialCharacters\u6F22\u00F1 = "Test" }; @@ -1102,7 +1102,7 @@ public static void DCS_TypeNamesWithSpecialCharacters() Assert.Equal(x.PropertyNameWithSpecialCharacters\u6F22\u00F1, y.PropertyNameWithSpecialCharacters\u6F22\u00F1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_JaggedArrayAsRoot() { int[][] jaggedIntegerArray = new int[][] { new int[] { 1, 3, 5, 7, 9 }, new int[] { 0, 2, 4, 6 }, new int[] { 11, 22 } }; @@ -1139,7 +1139,7 @@ public static void DCS_JaggedArrayAsRoot() Assert.True(actualJaggedIntegerArray2[2][0].Length == 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyDataContractResolver() { var myresolver = new MyResolver(); @@ -1156,7 +1156,7 @@ public static void DCS_MyDataContractResolver() Assert.True(output.OnDeserializedMethodInvoked, "output.OnDeserializedMethodInvoked is false"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WriteObject_Use_DataContractResolver() { var settings = new DataContractSerializerSettings() { DataContractResolver = null, KnownTypes = new Type[] { typeof(MyOtherType) } }; @@ -1197,7 +1197,7 @@ public static void DCS_DataContractResolver_Property() Assert.Equal(myresolver, dcs.DataContractResolver); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableStruct() { var original = new EnumerableStruct(); @@ -1209,7 +1209,7 @@ public static void DCS_EnumerableStruct() Assert.Equal((IEnumerable)actual, (IEnumerable)original); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableCollection() { var original = new EnumerableCollection(); @@ -1222,7 +1222,7 @@ public static void DCS_EnumerableCollection() Assert.Equal((IEnumerable)actual, (IEnumerable)original); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BaseClassAndDerivedClassWithSameProperty() { var value = new DerivedClassWithSameProperty() { DateTimeProperty = new DateTime(100), IntProperty = 5, StringProperty = "TestString", ListProperty = new List() }; @@ -1239,7 +1239,7 @@ public static void DCS_BaseClassAndDerivedClassWithSameProperty() Assert.Equal("three", actual.ListProperty[2]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ContainsLinkedList() { var value = new ContainsLinkedList(true); @@ -1247,7 +1247,7 @@ public static void DCS_ContainsLinkedList() DataContractSerializerHelper.SerializeAndDeserialize(value, @"23:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:59"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SimpleCollectionDataContract() { var value = new SimpleCDC(true); @@ -1259,7 +1259,7 @@ public static void DCS_SimpleCollectionDataContract() Assert.Contains("Three", actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyDerivedCollectionContainer() { var value = new MyDerivedCollectionContainer(); @@ -1277,7 +1277,7 @@ public static void DCS_EnumFlags() Assert.StrictEqual(value1, value2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SerializeClassThatImplementsInteface() { ClassImplementsInterface value = new ClassImplementsInterface() { ClassID = "ClassID", DisplayName = "DisplayName", Id = "Id", IsLoaded = true }; @@ -1288,7 +1288,7 @@ public static void DCS_SerializeClassThatImplementsInteface() Assert.Equal(value.Id, actual.Id); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_Nullables() { // Arrange @@ -1314,7 +1314,7 @@ public static void DCS_Nullables() Assert.StrictEqual(item.Struct1.Value.B, actual.Struct1.Value.B); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SimpleStructWithProperties() { SimpleStructWithProperties x = new SimpleStructWithProperties() { Num = 1, Text = "Foo" }; @@ -1324,7 +1324,7 @@ public static void DCS_SimpleStructWithProperties() Assert.True(x.Text == y.Text, "x.Text != y.Text"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_InternalTypeSerialization() { var value = new InternalType() { InternalProperty = 12 }; @@ -1333,7 +1333,7 @@ public static void DCS_InternalTypeSerialization() Assert.StrictEqual(deserializedValue.GetPrivatePropertyValue(), value.GetPrivatePropertyValue()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_PrivateTypeSerialization() { var value = new PrivateType(); @@ -1370,7 +1370,7 @@ public int GetPrivatePropertyValue() } #endregion - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_RootNameAndNamespaceThroughConstructorAsString() { //Constructor# 3 @@ -1381,7 +1381,7 @@ public static void DCS_RootNameAndNamespaceThroughConstructorAsString() Assert.Equal("Hello", result.Str); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_RootNameAndNamespaceThroughConstructorAsXmlDictionary() { //Constructor# 4 @@ -1417,7 +1417,7 @@ public static void DCS_RootNameWithoutNamespaceThroughSettings() Assert.Equal("Hello", result.Str); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_KnownTypesThroughConstructor() { //Constructor# 5 @@ -1431,7 +1431,7 @@ public static void DCS_KnownTypesThroughConstructor() Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DuplicatedKnownTypesWithAdapterThroughConstructor() { //Constructor# 5 @@ -1446,7 +1446,7 @@ public static void DCS_DuplicatedKnownTypesWithAdapterThroughConstructor() Assert.StrictEqual((DateTimeOffset)actual.SimpleTypeValue, (DateTimeOffset)actual.SimpleTypeValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_KnownTypesThroughSettings() { //Constructor# 2.1 @@ -1460,7 +1460,7 @@ public static void DCS_KnownTypesThroughSettings() Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_RootNameNamespaceAndKnownTypesThroughConstructorAsStrings() { //Constructor# 6 @@ -1474,7 +1474,7 @@ public static void DCS_RootNameNamespaceAndKnownTypesThroughConstructorAsStrings Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_RootNameNamespaceAndKnownTypesThroughConstructorAsXmlDictionary() { //Constructor# 7 @@ -1489,7 +1489,7 @@ public static void DCS_RootNameNamespaceAndKnownTypesThroughConstructorAsXmlDict Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ExceptionObject() { var value = new Exception("Test Exception"); @@ -1502,7 +1502,7 @@ public static void DCS_ExceptionObject() Assert.Equal(value.HelpLink, actual.HelpLink); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyArgumentExceptionObject() { var value = new MyArgumentException("Test Exception", "paramName"); @@ -1516,7 +1516,7 @@ public static void DCS_MyArgumentExceptionObject() Assert.Equal(value.HelpLink, actual.HelpLink); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ExceptionMessageWithSpecialChars() { var value = new Exception("Test Exception<>&'\""); @@ -1529,7 +1529,7 @@ public static void DCS_ExceptionMessageWithSpecialChars() Assert.Equal(value.HelpLink, actual.HelpLink); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_InnerExceptionMessageWithSpecialChars() { var value = new Exception("", new Exception("Test Exception<>&'\"")); @@ -1548,7 +1548,7 @@ public static void DCS_InnerExceptionMessageWithSpecialChars() Assert.Equal(value.InnerException.HelpLink, actual.InnerException.HelpLink); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithUriTypeProperty() { var value = new TypeWithUriTypeProperty() { ConfigUri = new Uri("http://www.bing.com") }; @@ -1558,7 +1558,7 @@ public static void DCS_TypeWithUriTypeProperty() Assert.StrictEqual(value.ConfigUri, actual.ConfigUri); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithDatetimeOffsetTypeProperty() { var value = new TypeWithDateTimeOffsetTypeProperty() { ModifiedTime = new DateTimeOffset(new DateTime(2013, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc)) }; @@ -1578,7 +1578,7 @@ public static void DCS_TypeWithDatetimeOffsetTypeProperty() Assert.StrictEqual(value.ModifiedTime, actual.ModifiedTime); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_Tuple() { DCS_Tuple1(); @@ -1647,7 +1647,7 @@ private static void DCS_Tuple8() Assert.StrictEqual>>(value, deserializedValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericQueue() { Queue value = new Queue(); @@ -1660,7 +1660,7 @@ public static void DCS_GenericQueue() Assert.StrictEqual(a1[0], a2[0]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericStack() { var value = new Stack(); @@ -1675,7 +1675,7 @@ public static void DCS_GenericStack() Assert.StrictEqual(a1[1], a2[1]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_Queue() { var value = new Queue(); @@ -1689,7 +1689,7 @@ public static void DCS_Queue() Assert.StrictEqual(a1[0], a2[0]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_Stack() { var value = new Stack(); @@ -1704,7 +1704,7 @@ public static void DCS_Stack() Assert.StrictEqual(a1[1], a2[1]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SortedList() { var value = new SortedList(); @@ -1716,7 +1716,7 @@ public static void DCS_SortedList() Assert.StrictEqual(value[1], deserializedValue[1]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SystemVersion() { Version value = new Version(1, 2, 3, 4); @@ -1728,7 +1728,7 @@ public static void DCS_SystemVersion() Assert.StrictEqual(value.Revision, deserializedValue.Revision); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithCommonTypeProperties() { TypeWithCommonTypeProperties value = new TypeWithCommonTypeProperties { Ts = new TimeSpan(1, 1, 1), Id = new Guid("ad948f1e-9ba9-44c8-8e2e-b6ba969ec987") }; @@ -1736,7 +1736,7 @@ public static void DCS_TypeWithCommonTypeProperties() Assert.StrictEqual(value, deserializedValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithTypeProperty() { TypeWithTypeProperty value = new TypeWithTypeProperty { Id = 123, Name = "Jon Doe" }; @@ -1746,7 +1746,7 @@ public static void DCS_TypeWithTypeProperty() Assert.StrictEqual(value.Type, deserializedValue.Type); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithExplicitIEnumerableImplementation() { TypeWithExplicitIEnumerableImplementation value = new TypeWithExplicitIEnumerableImplementation { }; @@ -1761,7 +1761,7 @@ public static void DCS_TypeWithExplicitIEnumerableImplementation() Assert.Equal("Bar", (string)enumerator.Current); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithGenericDictionaryAsKnownType() { TypeWithGenericDictionaryAsKnownType value = new TypeWithGenericDictionaryAsKnownType { }; @@ -1776,7 +1776,7 @@ public static void DCS_TypeWithGenericDictionaryAsKnownType() Assert.StrictEqual(2, deserializedValue.Foo[20].LevelNo); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithKnownTypeAttributeAndInterfaceMember() { TypeWithKnownTypeAttributeAndInterfaceMember value = new TypeWithKnownTypeAttributeAndInterfaceMember(); @@ -1787,7 +1787,7 @@ public static void DCS_TypeWithKnownTypeAttributeAndInterfaceMember() Assert.Equal("Foo News", deserializedValue.HeadLine.Title); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithKnownTypeAttributeAndListOfInterfaceMember() { TypeWithKnownTypeAttributeAndListOfInterfaceMember value = new TypeWithKnownTypeAttributeAndListOfInterfaceMember(); @@ -1803,7 +1803,7 @@ public static void DCS_TypeWithKnownTypeAttributeAndListOfInterfaceMember() * Begin tests of the InvalidDataContract generated for illegal types */ - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_InvalidDataContract_Write_And_Read_Empty_Collection_Of_Invalid_Type_Succeeds() { // Collections of invalid types can be serialized and deserialized if they are empty. @@ -1838,7 +1838,7 @@ public static void DCS_InvalidDataContract_Write_NonEmpty_Collection_Of_Invalid_ * End tests of the InvalidDataContract generated for illegal types */ - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DerivedTypeWithBaseTypeWithDataMember() { DerivedTypeWithDataMemberInBaseType value = new DerivedTypeWithDataMemberInBaseType() { EmbeddedDataMember = new TypeAsEmbeddedDataMember { Name = "Foo" } }; @@ -1847,7 +1847,7 @@ public static void DCS_DerivedTypeWithBaseTypeWithDataMember() Assert.Equal("Foo", deserializedValue.EmbeddedDataMember.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_PocoDerivedTypeWithBaseTypeWithDataMember() { PocoDerivedTypeWithDataMemberInBaseType value = new PocoDerivedTypeWithDataMemberInBaseType() { EmbeddedDataMember = new PocoTypeAsEmbeddedDataMember { Name = "Foo" } }; @@ -1856,7 +1856,7 @@ public static void DCS_PocoDerivedTypeWithBaseTypeWithDataMember() Assert.Equal("Foo", deserializedValue.EmbeddedDataMember.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ClassImplementingIXmlSerialiable() { ClassImplementingIXmlSerialiable value = new ClassImplementingIXmlSerialiable() { StringValue = "Foo" }; @@ -1864,7 +1864,7 @@ public static void DCS_ClassImplementingIXmlSerialiable() Assert.Equal(value.StringValue, deserializedValue.StringValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithNestedGenericClassImplementingIXmlSerialiable() { TypeWithNestedGenericClassImplementingIXmlSerialiable.NestedGenericClassImplementingIXmlSerialiable value = new TypeWithNestedGenericClassImplementingIXmlSerialiable.NestedGenericClassImplementingIXmlSerialiable() { StringValue = "Foo" }; @@ -1872,7 +1872,7 @@ public static void DCS_TypeWithNestedGenericClassImplementingIXmlSerialiable() Assert.Equal(value.StringValue, deserializedValue.StringValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericTypeWithNestedGenerics() { GenericTypeWithNestedGenerics.InnerGeneric value = new GenericTypeWithNestedGenerics.InnerGeneric() @@ -1885,7 +1885,7 @@ public static void DCS_GenericTypeWithNestedGenerics() Assert.StrictEqual(value.data2, deserializedValue.data2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DuplicatedKeyDateTimeOffset() { DateTimeOffset value = new DateTimeOffset(new DateTime(2013, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc).AddMinutes(7)); @@ -1896,7 +1896,7 @@ public static void DCS_DuplicatedKeyDateTimeOffset() dcjs.WriteObject(stream, value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DuplicatedKeyXmlQualifiedName() { XmlQualifiedName qname = new XmlQualifiedName("abc", "def"); @@ -1905,7 +1905,7 @@ public static void DCS_DuplicatedKeyXmlQualifiedName() Assert.StrictEqual(value.Value, deserialized.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DeserializeTypeWithInnerInvalidDataContract() { DataContractSerializer dcs = new DataContractSerializer(typeof(TypeWithPropertyWithoutDefaultCtor)); @@ -1921,7 +1921,7 @@ public static void DCS_DeserializeTypeWithInnerInvalidDataContract() Assert.Null(deserializedValue.MemberWithInvalidDataContract); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ReadOnlyCollection() { List list = new List() { "Foo", "Bar" }; @@ -1932,7 +1932,7 @@ public static void DCS_ReadOnlyCollection() Assert.Equal(value[1], deserializedValue[1]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ReadOnlyDictionary() { var dict = new Dictionary(); @@ -1946,7 +1946,7 @@ public static void DCS_ReadOnlyDictionary() Assert.StrictEqual(value["Bar"], deserializedValue["Bar"]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_KeyValuePair() { var value = new KeyValuePair("FooKey", "FooValue"); @@ -1956,7 +1956,7 @@ public static void DCS_KeyValuePair() Assert.StrictEqual(value.Value, deserializedValue.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ConcurrentDictionary() { var value = new ConcurrentDictionary(); @@ -1970,7 +1970,7 @@ public static void DCS_ConcurrentDictionary() Assert.True(deserializedValue["two"] == 2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractWithDotInName() { DataContractWithDotInName value = new DataContractWithDotInName() { Name = "Foo" }; @@ -1980,7 +1980,7 @@ public static void DCS_DataContractWithDotInName() Assert.Equal(value.Name, deserializedValue.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractWithMinusSignInName() { DataContractWithMinusSignInName value = new DataContractWithMinusSignInName() { Name = "Foo" }; @@ -1990,7 +1990,7 @@ public static void DCS_DataContractWithMinusSignInName() Assert.Equal(value.Name, deserializedValue.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractWithOperatorsInName() { DataContractWithOperatorsInName value = new DataContractWithOperatorsInName() { Name = "Foo" }; @@ -2000,7 +2000,7 @@ public static void DCS_DataContractWithOperatorsInName() Assert.Equal(value.Name, deserializedValue.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractWithOtherSymbolsInName() { DataContractWithOtherSymbolsInName value = new DataContractWithOtherSymbolsInName() { Name = "Foo" }; @@ -2010,7 +2010,7 @@ public static void DCS_DataContractWithOtherSymbolsInName() Assert.Equal(value.Name, deserializedValue.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionDataContractWithCustomKeyName() { CollectionDataContractWithCustomKeyName value = new CollectionDataContractWithCustomKeyName(); @@ -2023,7 +2023,7 @@ public static void DCS_CollectionDataContractWithCustomKeyName() Assert.StrictEqual(value[200], deserializedValue[200]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionDataContractWithCustomKeyNameDuplicate() { CollectionDataContractWithCustomKeyNameDuplicate value = new CollectionDataContractWithCustomKeyNameDuplicate(); @@ -2036,7 +2036,7 @@ public static void DCS_CollectionDataContractWithCustomKeyNameDuplicate() Assert.StrictEqual(value[200], deserializedValue[200]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithCollectionWithoutDefaultConstructor() { TypeWithCollectionWithoutDefaultConstructor value = new TypeWithCollectionWithoutDefaultConstructor(); @@ -2080,7 +2080,7 @@ public static void DCS_DeserializeEmptyString() Assert.True(exceptionThrown, "An expected exception was not thrown."); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(XmlDictionaryReaderQuotasData))] public static void DCS_XmlDictionaryQuotas(XmlDictionaryReaderQuotas quotas, bool shouldSucceed) { @@ -2115,7 +2115,7 @@ public static IEnumerable XmlDictionaryReaderQuotasData } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionInterfaceGetOnlyCollection() { var obj = new TypeWithCollectionInterfaceGetOnlyCollection(new List() { "item1", "item2", "item3" }); @@ -2123,7 +2123,7 @@ public static void DCS_CollectionInterfaceGetOnlyCollection() Assert.Equal(obj.Items, deserializedObj.Items); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableInterfaceGetOnlyCollection() { // Expect exception in deserialization process @@ -2155,7 +2155,7 @@ public static void DCS_XmlElementAsRoot() Assert.Equal(expected.InnerText, actual.InnerText); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithXmlElementProperty() { XmlDocument xDoc = new XmlDocument(); @@ -2174,7 +2174,7 @@ public static void DCS_TypeWithXmlElementProperty() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfSimpleType_PreserveObjectReferences_True() { var x = new SimpleType[3]; @@ -2202,7 +2202,7 @@ public static void DCS_ArrayOfSimpleType_PreserveObjectReferences_True() Assert.True(x[2].P2 == y[2].P2, "x[2].P2 != y[2].P2"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfSimpleType_PreserveObjectReferences_False() { var x = new SimpleType[3]; @@ -2232,7 +2232,7 @@ public static void DCS_ArrayOfSimpleType_PreserveObjectReferences_False() Assert.True(x[2].P2 == y[2].P2, "x[2].P2 != y[2].P2"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CircularTypes_PreserveObjectReferences_True() { var root = new TypeWithListOfReferenceChildren(); @@ -2262,7 +2262,7 @@ public static void DCS_CircularTypes_PreserveObjectReferences_True() Assert.True(root2.Children[0] == root2.Children[2], "root2.Children[0] != root2.Children[2]"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CircularTypes_PreserveObjectReferences_False() { var root = new TypeWithListOfReferenceChildren(); @@ -2292,7 +2292,7 @@ public static void DCS_CircularTypes_PreserveObjectReferences_False() Assert.True(root2.Children[0] == root2.Children[2], "root2.Children[0] != root2.Children[2]"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithPrimitiveProperties() { TypeWithPrimitiveProperties x = new TypeWithPrimitiveProperties { P1 = "abc", P2 = 11 }; @@ -2301,7 +2301,7 @@ public static void DCS_TypeWithPrimitiveProperties() Assert.StrictEqual(x.P2, y.P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithPrimitiveFields() { TypeWithPrimitiveFields x = new TypeWithPrimitiveFields { P1 = "abc", P2 = 11 }; @@ -2310,7 +2310,7 @@ public static void DCS_TypeWithPrimitiveFields() Assert.StrictEqual(x.P2, y.P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithAllPrimitiveProperties() { TypeWithAllPrimitiveProperties x = new TypeWithAllPrimitiveProperties @@ -2342,7 +2342,7 @@ public static void DCS_TypeWithAllPrimitiveProperties() #region Array of primitive types - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfBoolean() { var value = new bool[] { true, false, true }; @@ -2351,7 +2351,7 @@ public static void DCS_ArrayOfBoolean() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfDateTime() { var value = new DateTime[] { new DateTime(2000, 1, 2, 3, 4, 5, DateTimeKind.Utc), new DateTime(2011, 2, 3, 4, 5, 6, DateTimeKind.Utc) }; @@ -2360,7 +2360,7 @@ public static void DCS_ArrayOfDateTime() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfDecimal() { var value = new decimal[] { new decimal(1, 2, 3, false, 1), new decimal(4, 5, 6, true, 2) }; @@ -2369,7 +2369,7 @@ public static void DCS_ArrayOfDecimal() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfInt32() { var value = new int[] { 123, int.MaxValue, int.MinValue }; @@ -2378,7 +2378,7 @@ public static void DCS_ArrayOfInt32() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfInt64() { var value = new long[] { 123, long.MaxValue, long.MinValue }; @@ -2387,7 +2387,7 @@ public static void DCS_ArrayOfInt64() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfSingle() { var value = new float[] { 1.23f, 4.56f, 7.89f }; @@ -2396,7 +2396,7 @@ public static void DCS_ArrayOfSingle() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfDouble() { var value = new double[] { 1.23, 4.56, 7.89 }; @@ -2405,7 +2405,7 @@ public static void DCS_ArrayOfDouble() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfString() { var value = new string[] { "abc", "def", "xyz" }; @@ -2414,7 +2414,7 @@ public static void DCS_ArrayOfString() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfTypeWithPrimitiveProperties() { var value = new TypeWithPrimitiveProperties[] @@ -2427,7 +2427,7 @@ public static void DCS_ArrayOfTypeWithPrimitiveProperties() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfSimpleType() { // Intentionally set count to 64 to test array resizing functionality during de-serialization. @@ -2445,7 +2445,7 @@ public static void DCS_ArrayOfSimpleType() Assert.StrictEqual(count-1, deserialized[count-1].P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithEmitDefaultValueFalse() { var value = new TypeWithEmitDefaultValueFalse(); @@ -2461,7 +2461,7 @@ public static void DCS_TypeWithEmitDefaultValueFalse() #region Collection - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfBoolean() { var value = new TypeImplementsGenericICollection() { true, false, true }; @@ -2470,7 +2470,7 @@ public static void DCS_GenericICollectionOfBoolean() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfDecimal() { var value = new TypeImplementsGenericICollection() { new decimal(1, 2, 3, false, 1), new decimal(4, 5, 6, true, 2) }; @@ -2479,7 +2479,7 @@ public static void DCS_GenericICollectionOfDecimal() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfInt32() { TypeImplementsGenericICollection x = new TypeImplementsGenericICollection(123, int.MaxValue, int.MinValue); @@ -2490,7 +2490,7 @@ public static void DCS_GenericICollectionOfInt32() Assert.True(x.SequenceEqual(y)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfInt64() { var value = new TypeImplementsGenericICollection() { 123, long.MaxValue, long.MinValue }; @@ -2499,7 +2499,7 @@ public static void DCS_GenericICollectionOfInt64() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfSingle() { var value = new TypeImplementsGenericICollection() { 1.23f, 4.56f, 7.89f }; @@ -2508,7 +2508,7 @@ public static void DCS_GenericICollectionOfSingle() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfDouble() { var value = new TypeImplementsGenericICollection() { 1.23, 4.56, 7.89 }; @@ -2517,7 +2517,7 @@ public static void DCS_GenericICollectionOfDouble() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfString() { TypeImplementsGenericICollection value = new TypeImplementsGenericICollection("a1", "a2"); @@ -2528,7 +2528,7 @@ public static void DCS_GenericICollectionOfString() Assert.True(value.SequenceEqual(deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfTypeWithPrimitiveProperties() { var value = new TypeImplementsGenericICollection() @@ -2541,7 +2541,7 @@ public static void DCS_GenericICollectionOfTypeWithPrimitiveProperties() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionOfTypeWithNonDefaultNamcespace() { var value = new CollectionOfTypeWithNonDefaultNamcespace(); @@ -2557,7 +2557,7 @@ public static void DCS_CollectionOfTypeWithNonDefaultNamcespace() #region Generic Dictionary - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericDictionaryOfInt32Boolean() { var value = new Dictionary(); @@ -2568,7 +2568,7 @@ public static void DCS_GenericDictionaryOfInt32Boolean() Assert.True(Enumerable.SequenceEqual(value.ToArray(), deserialized.ToArray())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericDictionaryOfInt32String() { var value = new Dictionary(); @@ -2579,7 +2579,7 @@ public static void DCS_GenericDictionaryOfInt32String() Assert.True(Enumerable.SequenceEqual(value.ToArray(), deserialized.ToArray())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericDictionaryOfStringInt32() { var value = new Dictionary(); @@ -2594,7 +2594,7 @@ public static void DCS_GenericDictionaryOfStringInt32() #region Non-Generic Dictionary - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_NonGenericDictionaryOfInt32Boolean() { var value = new MyNonGenericDictionary(); @@ -2606,7 +2606,7 @@ public static void DCS_NonGenericDictionaryOfInt32Boolean() Assert.True(Enumerable.SequenceEqual(value.Values.Cast().ToArray(), deserialized.Values.Cast().ToArray())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_NonGenericDictionaryOfInt32String() { var value = new MyNonGenericDictionary(); @@ -2618,7 +2618,7 @@ public static void DCS_NonGenericDictionaryOfInt32String() Assert.True(Enumerable.SequenceEqual(value.Values.Cast().ToArray(), deserialized.Values.Cast().ToArray())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_NonGenericDictionaryOfStringInt32() { var value = new MyNonGenericDictionary(); @@ -2632,7 +2632,7 @@ public static void DCS_NonGenericDictionaryOfStringInt32() #endregion - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundTripResolveDTOTypes() { ObjectContainer instance = new ObjectContainer(new DTOContainer()); @@ -2652,7 +2652,7 @@ public static void DCS_BasicRoundTripResolveDTOTypes() Assert.Equal(DateTimeOffset.MaxValue, ((DTOContainer)deserialized.Data).nDTO); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ExtensionDataObjectTest() { var p2 = new PersonV2(); @@ -2695,7 +2695,7 @@ public static void DCS_ExtensionDataObjectTest() Assert.True(result2.Equal, $"{nameof(actualOutput2)} was not as expected: {Environment.NewLine}Expected: {baseline2}{Environment.NewLine}Actual: {actualOutput2}"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_XPathQueryGeneratorTest() { Type t = typeof(Order); @@ -2727,7 +2727,7 @@ public static void XsdDataContractExporterTest() Assert.Throws(() => exporter.Export(typeof(Employee))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyISerializableType() { var value = new MyISerializableType(); @@ -2739,7 +2739,7 @@ public static void DCS_MyISerializableType() Assert.Equal(value.StringValue, actual.StringValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithNonSerializedField() { var value = new TypeWithSerializableAttributeAndNonSerializedField(); @@ -2759,7 +2759,7 @@ public static void DCS_TypeWithNonSerializedField() Assert.Null(actual.Member4); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithOptionalField() { var value = new TypeWithOptionalField(); @@ -2778,7 +2778,7 @@ public static void DCS_TypeWithOptionalField() Assert.Equal(0, deserialized.Member2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SerializableEnumWithNonSerializedValue() { var value1 = new TypeWithSerializableEnum(); @@ -2792,7 +2792,7 @@ public static void DCS_SerializableEnumWithNonSerializedValue() Assert.Throws(() => DataContractSerializerHelper.SerializeAndDeserialize(value2, "")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SquareWithDeserializationCallback() { var value = new SquareWithDeserializationCallback(2); @@ -2801,7 +2801,7 @@ public static void DCS_SquareWithDeserializationCallback() Assert.Equal(value.Area, actual.Area); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithDelegate() { var value = new TypeWithDelegate(); @@ -2814,7 +2814,7 @@ public static void DCS_TypeWithDelegate() #region DesktopTest - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ResolveNameReturnsEmptyNamespace() { SerializationTestTypes.EmptyNsContainer instance = new SerializationTestTypes.EmptyNsContainer(new SerializationTestTypes.EmptyNSAddress()); @@ -2833,7 +2833,7 @@ public static void DCS_ResolveNameReturnsEmptyNamespace() Assert.True(result.address == null, "Address not null"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ResolveDatacontractBaseType() { SerializationTestTypes.Customer customerInstance = new SerializationTestTypes.PreferredCustomerProxy(); @@ -2875,7 +2875,7 @@ private static void DCS_BasicRoundTripResolvePrimitiveTypes(string baseline) /// Roundtrips a Datacontract type which contains Primitive types assigned to member of type object. /// Resolver is plugged in and resolves the primitive types. Verify resolver called during ser and deser /// - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundTripResolvePrimitiveTypes_NotNetFramework() { string baseline = @"<_data i:type=""a:PrimitiveContainer_foo"" xmlns:a=""http://www.default.com"">false25506553579228162514264337593543950335-19999-12-31T23:59:59.9999999-792281625142643375935439503354bc848b1-a541-40bf-8aa9-dd6ccb6d0e5610005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaN-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150AQIDBA==<_data2 i:type=""a:PrimitiveContainer_foo"" xmlns:a=""http://www.default.com"">false25506553579228162514264337593543950335-19999-12-31T23:59:59.9999999-792281625142643375935439503354bc848b1-a541-40bf-8aa9-dd6ccb6d0e5610005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaN-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150AQIDBA==
"; @@ -2887,7 +2887,7 @@ public static void DCS_BasicRoundTripResolvePrimitiveTypes_NotNetFramework() /// Some enums are resolved by Resolver and others by the KT attribute. /// Enum and struct members are of base enum type and ValueTyperespecitively /// - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundTripResolveEnumStructTypes() { var dataContractSerializerSettings = new DataContractSerializerSettings() @@ -2906,7 +2906,7 @@ public static void DCS_BasicRoundTripResolveEnumStructTypes() SerializationTestTypes.ComparisonHelper.CompareRecursively(value, actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVariation1() { SerializationTestTypes.DCRVariations dcrVariationsGoing = new SerializationTestTypes.DCRVariations(); @@ -2934,7 +2934,7 @@ public static void DCS_BasicRoundtripDCRVariation1() SerializationTestTypes.ComparisonHelper.CompareRecursively(dcrVariationsGoing, dcrVariationsReturning); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVariation2() { SerializationTestTypes.DCRVariations dcrVariationsGoing = new SerializationTestTypes.DCRVariations(); @@ -2960,7 +2960,7 @@ public static void DCS_BasicRoundtripDCRVariation2() SerializationTestTypes.ComparisonHelper.CompareRecursively(dcrVariationsGoing, dcrVariationsReturning); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVariation3() { SerializationTestTypes.DCRVariations dcrVariationsGoing = new SerializationTestTypes.DCRVariations(); @@ -2987,7 +2987,7 @@ public static void DCS_BasicRoundtripDCRVariation3() SerializationTestTypes.ComparisonHelper.CompareRecursively(dcrVariationsGoing, dcrVariationsReturning); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVariation4() { SerializationTestTypes.DCRVariations dcrVariationsGoing = new SerializationTestTypes.DCRVariations(); @@ -3023,7 +3023,7 @@ private static void CompareBaseline(string baseline, MemoryStream ms) Environment.NewLine, result.ErrorMessage, baseline, actualOutput)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundTripPOCOWithIgnoreDM() { var dataContractSerializerSettings = new DataContractSerializerSettings() @@ -3044,7 +3044,7 @@ public static void DCS_BasicRoundTripPOCOWithIgnoreDM() SerializationTestTypes.ComparisonHelper.CompareRecursively(value, actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVerifyWireformatScenarios() { var dataContractSerializerSettings = new DataContractSerializerSettings() @@ -3074,7 +3074,7 @@ public static void DCS_BasicRoundtripDCRVerifyWireformatScenarios() SerializationTestTypes.ComparisonHelper.CompareRecursively(value3, actual3); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ResolveNameVariationTest() { SerializationTestTypes.ObjectContainer instance = new SerializationTestTypes.ObjectContainer(new SerializationTestTypes.UserTypeContainer()); @@ -3088,7 +3088,7 @@ public static void DCS_ResolveNameVariationTest() SerializationTestTypes.ComparisonHelper.CompareRecursively(instance, result); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRDefaultCollections() { var defaultCollections = new SerializationTestTypes.DefaultCollections(); @@ -3103,7 +3103,7 @@ public static void DCS_BasicRoundtripDCRDefaultCollections() SerializationTestTypes.ComparisonHelper.CompareRecursively(defaultCollections, actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_IObjectRef() { @@ -3120,7 +3120,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_IObjectRef() TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.DCIObjRefReturnsPrivate(), @"<_data i:type=""a:SerializationTestTypes.DCIObjRefReturnsPrivate***"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.DCIObjRefReturnsPrivate***""><_data z:Id=""i1"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/"">7b4ac88f-972b-43e5-8f6a-5ae64480eaad<_data2 i:type=""a:SerializationTestTypes.DCIObjRefReturnsPrivate***"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.DCIObjRefReturnsPrivate***""><_data z:Ref=""i1"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/""/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3445,7 +3445,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_DataSet() { @@ -3488,7 +3488,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_DataSet() Assert.Equal(valueDataSetPrivate.dataTable.Rows[0][0], resultDataSetPrivate.dataTable.Rows[0][0]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_TypeInheritedFromIListT() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3502,7 +3502,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_TypeInheritedFromIL TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.SampleListTExplicitWithCDCContainsPrivateDC(true), $@"<_data z:Id=""i1"" i:type=""a:SerializationTestTypes.SampleListTExplicitWithCDCContainsPrivateDC***"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.SampleListTExplicitWithCDCContainsPrivateDC***"">7b4ac88f-972b-43e5-8f6a-5ae64480eaad7b4ac88f-972b-43e5-8f6a-5ae64480eaad<_data2 z:Ref=""i1"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/""/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_InheritedFromIList() { TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.SampleListExplicitWithoutDC(true), @"<_data i:type=""a:SerializationTestTypes.SampleListExplicitWithoutDC***"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.SampleListExplicitWithoutDC***"">0001-01-01T00:00:00P10675199DT2H48M5.4775807S1.7976931348623157E+308-INF0c9e174e-cdd8-4b68-a70d-aaeb26c7deeb<_data2 i:type=""a:SerializationTestTypes.SampleListExplicitWithoutDC***"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.SampleListExplicitWithoutDC***"">0001-01-01T00:00:00P10675199DT2H48M5.4775807S1.7976931348623157E+308-INF0c9e174e-cdd8-4b68-a70d-aaeb26c7deeb"); @@ -3516,7 +3516,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_InheritedFromIList( TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.SampleListExplicitWithCDCContainsPrivateDC(true), @"<_data z:Id=""i1"" i:type=""a:SerializationTestTypes.SampleListExplicitWithCDCContainsPrivateDC***"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.SampleListExplicitWithCDCContainsPrivateDC***"">0001-01-01T00:00:00P10675199DT2H48M5.4775807S1.7976931348623157E+308-INF0c9e174e-cdd8-4b68-a70d-aaeb26c7deeb7b4ac88f-972b-43e5-8f6a-5ae64480eaad<_data2 z:Ref=""i1"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/""/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes_SampleICollectionTExplicit() { var setting = new DataContractSerializerSettings() @@ -3541,7 +3541,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes_SampleI TestObjectWithDifferentPayload(valueSampleICollectionTExplicitWithCDCContainsPrivateDC, netcorePayloadSampleICollectionTExplicitWithCDCContainsPrivateDC, desktopPayloadSampleICollectionTExplicitWithCDCContainsPrivateDC, setting); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_Collections() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3560,7 +3560,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_Collections() TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.DMWithRefInCollection1(true), "<_data z:Id=\"i1\" i:type=\"a:SerializationTestTypes.DMWithRefInCollection1***\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.DMWithRefInCollection1***\">This is a stringThis is a stringa6d053ed-f7d4-42fb-8e56-e4b425f26fa9a6d053ed-f7d4-42fb-8e56-e4b425f26fa9This is a string<_data2 z:Ref=\"i1\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\"/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_CollectionDataContract() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3575,7 +3575,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_CollectionDataContr TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.DMWithRefInDict1(true), $"<_data z:Id=\"i1\" i:type=\"a:SerializationTestTypes.DMWithRefInDict1***\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.DMWithRefInDict1***\">This is a stringThis is a stringThis is a string6d807157-536f-4794-a157-e463a11029aaThis is a stringThis is a string6d807157-536f-4794-a157-e463a11029aa<_data2 z:Ref=\"i1\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\"/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_ItRef() { TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.TestInheritence9(true), "<_data i:type=\"a:SerializationTestTypes.TestInheritence9***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.TestInheritence9***\">TestStringTestString2TestString0TestString1TestString3TestString00TestString122TestString4TestStringTestString2Base1Base2Base3Base4Base5Base6Base7TestString0TestString1TestString3TestStringTestString2TestString0TestString1TestString3TestString00TestString122TestString4TestStringTestString2Base1Base2Base3Base4Base5Base6Base7TestString0TestString1TestString3<_data2 i:type=\"a:SerializationTestTypes.TestInheritence9***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.TestInheritence9***\">TestStringTestString2TestString0TestString1TestString3TestString00TestString122TestString4TestStringTestString2Base1Base2Base3Base4Base5Base6Base7TestString0TestString1TestString3TestStringTestString2TestString0TestString1TestString3TestString00TestString122TestString4TestStringTestString2Base1Base2Base3Base4Base5Base6Base7TestString0TestString1TestString3"); @@ -3708,7 +3708,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_ItRef() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_SelfRefCycles() { TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.SelfRef1(true), "<_data z:Id=\"i1\" i:type=\"a:SerializationTestTypes.SelfRef1***\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.SelfRef1***\"><_data2 z:Ref=\"i1\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\"/>"); @@ -3761,7 +3761,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_SelfRefCycles() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3844,7 +3844,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct_NotNetFramework() { TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.AllTypes(), "<_data i:type=\"a:SerializationTestTypes.AllTypes***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.AllTypes***\">false25506553579228162514264337593543950335redred-10001-01-01T00:00:00-792281625142643375935439503355642b5d2-87c3-a724-2390-997062f3f7a210005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaNData-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150<_data2 i:type=\"a:SerializationTestTypes.AllTypes***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.AllTypes***\">false25506553579228162514264337593543950335redred-10001-01-01T00:00:00-792281625142643375935439503355642b5d2-87c3-a724-2390-997062f3f7a210005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaNData-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150
"); @@ -3855,7 +3855,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct_NotNetFr #endregion - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithVirtualGenericProperty() { var value1 = new TypeWithVirtualGenericProperty() { Value = 1 }; @@ -3869,7 +3869,7 @@ public static void DCS_TypeWithVirtualGenericProperty() Assert.Equal(value2.Value, actual2.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyPersonSurrogate() { DataContractSerializer dcs = new DataContractSerializer(typeof(Family)); @@ -3894,7 +3894,7 @@ public static void DCS_MyPersonSurrogate() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_FileStreamSurrogate() { using (var testFile = TempFile.Create()) @@ -3931,7 +3931,7 @@ public static void DCS_FileStreamSurrogate() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_KnownTypeMethodName() { var emp1 = new EmployeeC("Steve"); @@ -3951,7 +3951,7 @@ public static void DCS_KnownTypeMethodName() Assert.Equal(value.emps[1].Name, actual.emps[1].Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SampleICollectionTExplicitWithoutDC() { var value = new SerializationTestTypes.SampleICollectionTExplicitWithoutDC(true); @@ -3960,7 +3960,7 @@ public static void DCS_SampleICollectionTExplicitWithoutDC() TestObjectWithDifferentPayload(value, netcorePayload, desktopPayload); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MemoryStream_Serialize_UsesBuiltInAdapter() { ValidateObject( @@ -4018,7 +4018,7 @@ static void ValidateObject(MemoryStream original, string expectedXml, byte[] exp } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MemoryStream_Deserialize_CompatibleWithFullFramework() { // The payloads in this test were generated by a Full Framework application. @@ -4158,7 +4158,7 @@ public static void DCS_InvalidDataContract_Read_Invalid_Types_Throws() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ValidateExceptionOnUnspecifiedRootSerializationType() { var value = new UnspecifiedRootSerializationType(); @@ -4169,7 +4169,7 @@ public static void DCS_ValidateExceptionOnUnspecifiedRootSerializationType() Assert.Equal(value.MyStringProperty, actual.MyStringProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithCollectionAndDateTimeOffset() { // Adding offsetMinutes so the DateTime component in serialized strings are time-zone independent @@ -4184,7 +4184,7 @@ public static void DCS_TypeWithCollectionAndDateTimeOffset() Assert.True(Enumerable.SequenceEqual(value.AnIntList, actual.AnIntList)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithCollectionAndDateTimeOffset_ListIsNull() { // Adding offsetMinutes so the DateTime component in serialized strings are time-zone independent @@ -4199,7 +4199,7 @@ public static void DCS_TypeWithCollectionAndDateTimeOffset_ListIsNull() Assert.Equal(0, actual.AnIntList.Count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithPrimitiveKnownTypes() { var list = new TypeWithPrimitiveKnownTypes(); @@ -4240,7 +4240,7 @@ public static void DCS_TypeWithPrimitiveKnownTypes() } [ActiveIssue("https://github.com/dotnet/runtime/issues/1417", TestPlatforms.OSX)] - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DeeplyLinkedData() { TypeWithLinkedProperty head = new TypeWithLinkedProperty(); @@ -4263,7 +4263,7 @@ public static void DCS_DifferentCollectionsOfSameTypeAsKnownTypes() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ReadObject_XmlDictionaryReaderMaxStringContentLengthExceedsQuota() { DataContractSerializer dcs = new DataContractSerializer(typeof(TypeA)); diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs index 719a06d6e48cf9..965a9d7b36b746 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs @@ -279,7 +279,7 @@ public static void StreamProvoiderTest() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void IXmlBinaryReaderWriterInitializerTest() { DataContractSerializer serializer = new DataContractSerializer(typeof(TestData)); diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlSerializerTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlSerializerTests.cs index 089e45de113109..7668b9e52c5a86 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlSerializerTests.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlSerializerTests.cs @@ -12,7 +12,7 @@ public static class XmlSerializerTests public const string FakeNS = "http://example.com/XmlSerializerTests"; - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void FlagEnums_With_Different_Namespaces() { StringWriter sw = new StringWriter(); diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10FeedFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10FeedFormatterTests.cs index 1899ad8f636279..45abe444da96f7 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10FeedFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10FeedFormatterTests.cs @@ -383,7 +383,7 @@ SyndicationLink CreateLink(string prefix) }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void Write_HasFeed_SerializesExpected(SyndicationFeed feed, string expected) { @@ -619,7 +619,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true, true)] [InlineData(false, false)] public void Read_FullItem_ReturnsExpected(bool preserveAttributeExtensions, bool preserveElementExtensions) diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10ItemFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10ItemFormatterTests.cs index 8ef2f8decda9fd..767cc2285615a7 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10ItemFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10ItemFormatterTests.cs @@ -281,7 +281,7 @@ TextSyndicationContent CreateContent(string prefix) }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void WriteTo_HasItem_SerializesExpected(SyndicationItem item, string expected) { @@ -402,7 +402,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true, true)] [InlineData(false, false)] public void Read_FullItem_ReturnsExpected(bool preserveAttributeExtensions, bool preserveElementExtensions) diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatterTests.cs index db1f33bb5d3f7f..f666ee72ba0c9c 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatterTests.cs @@ -168,7 +168,7 @@ public static IEnumerable WriteTo_TestData() }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void WriteTo_HasDocument_SerializesExpected(CategoriesDocument document, string expected) { @@ -245,7 +245,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadFrom_InlineCategoriesDocument_ReturnsExpected() { string xmlString = @@ -341,7 +341,7 @@ public void Read_InlineCategoriesDocumentTryParseTrue_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadFrom_ReferencedCategoriesDocument_ReturnsExpected() { string xmlString = diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatterTests.cs index 55fca752091a26..e34a7ef3a55ab0 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatterTests.cs @@ -241,7 +241,7 @@ public static IEnumerable WriteTo_TestData() }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void WriteTo_HasDocument_SerializesExpected(ServiceDocument document, string expected) { @@ -328,7 +328,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadFrom_FullDocument_ReturnsExpected() { string xmlString = @" diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/InlineCategoriesDocumentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/InlineCategoriesDocumentTests.cs index 071a74d94a5254..a772abdfa8d4ec 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/InlineCategoriesDocumentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/InlineCategoriesDocumentTests.cs @@ -174,7 +174,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => document.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ReferencedCategoriesDocumentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ReferencedCategoriesDocumentTests.cs index a06d9bee7216d0..a61b356d2b4b17 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ReferencedCategoriesDocumentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ReferencedCategoriesDocumentTests.cs @@ -167,7 +167,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => document.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ResourceCollectionInfoTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ResourceCollectionInfoTests.cs index b301dadedabd05..6f0c9514bad50b 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ResourceCollectionInfoTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ResourceCollectionInfoTests.cs @@ -291,7 +291,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => collectionInfo.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Rss20ItemFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Rss20ItemFormatterTests.cs index ea5952745aca8c..a86f7fea06daf9 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Rss20ItemFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Rss20ItemFormatterTests.cs @@ -537,7 +537,7 @@ TextSyndicationContent CreateContent(string prefix) }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void WriteTo_Invoke_SerializesExpected(SyndicationItem item, bool serializeExtensionsAsAtom, string expected) { @@ -631,7 +631,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true, true)] [InlineData(false, false)] public void ReadFrom_FullItem_ReturnsExpected(bool preserveAttributeExtensions, bool preserveElementExtensions) diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentFormatterTests.cs index 5464381762e9c7..0d64a7c66c1c05 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentFormatterTests.cs @@ -142,7 +142,7 @@ public void CreateWorkspace_NullDocument_ThrowsArgumentNullException() AssertExtensions.Throws("document", () => Formatter.CreateWorkspaceEntryPoint(null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Categories_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -169,7 +169,7 @@ public void LoadElementExtensions_NullCategories_ThrowsArgumentNullException() AssertExtensions.Throws("categories", () => Formatter.LoadElementExtensionsEntryPoint(reader, (CategoriesDocument)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Collection_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -196,7 +196,7 @@ public void LoadElementExtensions_NullCollection_ThrowsArgumentNullException() AssertExtensions.Throws("collection", () => Formatter.LoadElementExtensionsEntryPoint(reader, (ResourceCollectionInfo)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Workspace_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -223,7 +223,7 @@ public void LoadElementExtensions_NullWorkspace_ThrowsArgumentNullException() AssertExtensions.Throws("workspace", () => Formatter.LoadElementExtensionsEntryPoint(reader, (Workspace)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_ServiceDocument_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -412,7 +412,7 @@ public static IEnumerable Version_TestData() yield return new object[] { "version" }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Categories_Success(string version) { @@ -440,7 +440,7 @@ public void WriteElementExtensions_NullCategories_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Collection_Success(string version) { @@ -468,7 +468,7 @@ public void WriteElementExtensions_NullCollection_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Workspace_Success(string version) { @@ -496,7 +496,7 @@ public void WriteElementExtensions_NullWorkspace_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_ServiceDocument_Success(string version) { diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentTests.cs index bc39ffaba44a63..578ca06d3329f1 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentTests.cs @@ -145,7 +145,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => document.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationCategoryTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationCategoryTests.cs index a7ca29f8b99e62..b05594cbc3f9d0 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationCategoryTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationCategoryTests.cs @@ -173,7 +173,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => category.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationContentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationContentTests.cs index 9b07ba9340e6b2..fdefe5cf198c82 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationContentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationContentTests.cs @@ -158,7 +158,7 @@ public void CreateUrlContent_NullUrl_ThrowsArgumentNullException() AssertExtensions.Throws("url", () => SyndicationContent.CreateUrlContent(null, "mediaType")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateXmlContent_Reader_NoAttributes() { XmlSyndicationContent content = SyndicationContent.CreateXmlContent( @@ -178,7 +178,7 @@ public void CreateXmlContent_Reader_NoAttributes() Assert.Equal(10, content.ReadContent((XmlSerializer)null).Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateXmlContent_Reader_Attributes() { XmlSyndicationContent content = SyndicationContent.CreateXmlContent( diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionCollectionTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionCollectionTests.cs index a8b352822cfc7a..2760de324a8a50 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionCollectionTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionCollectionTests.cs @@ -13,7 +13,7 @@ namespace System.ServiceModel.Syndication.Tests { public class SyndicationElementExtensionCollectionTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Add_Invoke_ReturnsExpected() { SyndicationElementExtensionCollection elementExtensions = new SyndicationCategory().ElementExtensions; diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionTests.cs index e7d57bb2c2d214..7cab5d05ba2e83 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionTests.cs @@ -14,7 +14,7 @@ namespace System.ServiceModel.Syndication.Tests { public class ServiceElementExtensionTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Ctor_Reader() { var extension = new SyndicationElementExtension(new XElement("ExtensionObject", new XElement("Value", 10)).CreateReader()); @@ -25,7 +25,7 @@ public void Ctor_Reader() Assert.Equal(10, extension.GetObject(new XmlSerializer(typeof(ExtensionObject))).Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Ctor_ReaderNotAtStart_ReturnsExpected() { using (XmlReader reader = new XElement("parent", new XElement("ExtensionObject", new XElement("Value", 10))).CreateReader()) @@ -219,7 +219,7 @@ public void GetReader_WithReader_ReturnsExpected() Assert.Equal(@"10", reader.ReadOuterXml()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetReader_ObjectWithXmlObjectSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject() { Value = 10 }; @@ -228,7 +228,7 @@ public void GetReader_ObjectWithXmlObjectSerializer_ReturnsExpected() Assert.Equal(@"10", reader.ReadOuterXml()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void GetReader_ObjectWithXmlSerializer_ReturnsExpected() { @@ -268,7 +268,7 @@ public void WriteTo_WithReader_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WriteTo_ObjectWithXmlObjectSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject { Value = 10 }; @@ -285,7 +285,7 @@ public void WriteTo_ObjectWithXmlObjectSerializer_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void WriteTo_ObjectWithXmlSerializer_ReturnsExpected() { @@ -320,7 +320,7 @@ public void ISerializableIsAny_XmlObjectSerializer_OuterNameReturnsExpected() Assert.NotNull(extension.GetObject(new DataContractSerializer(typeof(XmlSerializabWithIsAnyNull)))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ISerializableIsAny_XmlSerializer_OuterNameReturnsExpected() { var extensionObject = new XmlSerializabWithIsAny(); diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedFormatterTests.cs index 5a5d6b3d2f0139..74cdb73608d0c7 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedFormatterTests.cs @@ -224,7 +224,7 @@ public void CreatePerson_FeedReturnsNull_ThrowsInvalidOperationException() Assert.Throws(() => Formatter.CreatePersonEntryPoint(feed)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Categories_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -251,7 +251,7 @@ public void LoadElementExtensions_NullCategories_ThrowsArgumentNullException() AssertExtensions.Throws("category", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationCategory)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Feed_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -278,7 +278,7 @@ public void LoadElementExtensions_NullFeed_ThrowsArgumentNullException() AssertExtensions.Throws("feed", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationFeed)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Item_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -305,7 +305,7 @@ public void LoadElementExtensions_NullItem_ThrowsArgumentNullException() AssertExtensions.Throws("item", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationItem)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Link_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -332,7 +332,7 @@ public void LoadElementExtensions_NullLink_ThrowsArgumentNullException() AssertExtensions.Throws("link", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationLink)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Person_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -692,7 +692,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => Formatter.WriteAttributeExtensionsEntryPoint(null, new SyndicationPerson(), "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Category_Success(string version) { @@ -722,7 +722,7 @@ public void WriteElementExtensions_NullCategory_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Item_Success(string version) { @@ -750,7 +750,7 @@ public void WriteElementExtensions_NullFeed_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Feed_Success(string version) { @@ -778,7 +778,7 @@ public void WriteElementExtensions_NullItem_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Link_Success(string version) { @@ -808,7 +808,7 @@ public void WriteElementExtensions_NullLink_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Person_Success(string version) { diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedTests.cs index 280929d010f955..ed1d743ba60694 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedTests.cs @@ -356,7 +356,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => feed.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemFormatterTests.cs index 4c1cd210c654bd..bac020e4a26744 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemFormatterTests.cs @@ -111,7 +111,7 @@ public void CreatePerson_ItemReturnsNull_ThrowsInvalidOperationException() Assert.Throws(() => Formatter.CreatePersonEntryPoint(item)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Categories_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -138,7 +138,7 @@ public void LoadElementExtensions_NullCategories_ThrowsArgumentNullException() AssertExtensions.Throws("category", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationCategory)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Item_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -165,7 +165,7 @@ public void LoadElementExtensions_NullItem_ThrowsArgumentNullException() AssertExtensions.Throws("item", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationItem)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Link_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -192,7 +192,7 @@ public void LoadElementExtensions_NullLink_ThrowsArgumentNullException() AssertExtensions.Throws("link", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationLink)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Person_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -500,7 +500,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => Formatter.WriteAttributeExtensionsEntryPoint(null, new SyndicationPerson(), "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Category_Success(string version) { @@ -530,7 +530,7 @@ public void WriteElementExtensions_NullCategory_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Item_Success(string version) { @@ -558,7 +558,7 @@ public void WriteElementExtensions_NullItem_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Link_Success(string version) { @@ -588,7 +588,7 @@ public void WriteElementExtensions_NullLink_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Person_Success(string version) { diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemTests.cs index e5f8f7842d8bde..b8418a06e94803 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemTests.cs @@ -565,7 +565,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => item.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationLinkTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationLinkTests.cs index 6ed01307e0cfa4..b4bcb5c825378c 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationLinkTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationLinkTests.cs @@ -362,7 +362,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => link.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationPersonTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationPersonTests.cs index 0e1f1c84091f62..e9b25a2678064b 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationPersonTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationPersonTests.cs @@ -173,7 +173,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => person.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/WorkspaceTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/WorkspaceTests.cs index 78e30ffea3b39a..1e4c4c53fc6f49 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/WorkspaceTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/WorkspaceTests.cs @@ -177,7 +177,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => workspace.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/XmlSyndicationContentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/XmlSyndicationContentTests.cs index 72653c47447200..8c1d6fa26e5eaa 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/XmlSyndicationContentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/XmlSyndicationContentTests.cs @@ -13,7 +13,7 @@ namespace System.ServiceModel.Syndication.Tests { public class XmlSyndicationContentTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Ctor_Reader_NoAttributes() { var content = new XmlSyndicationContent( @@ -33,7 +33,7 @@ public void Ctor_Reader_NoAttributes() Assert.Equal(10, content.ReadContent((XmlSerializer)null).Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Ctor_Reader_Attributes() { var content = new XmlSyndicationContent( @@ -219,7 +219,7 @@ public void WriteTo_WithEmptyReader_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WriteTo_ObjectWithXmlObjectSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject() { Value = 10 }; @@ -232,7 +232,7 @@ public void WriteTo_ObjectWithXmlObjectSerializer_ReturnsExpected() ", writer => content.WriteTo(writer, "OuterElementName", "OuterElementNamespace")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void WriteTo_ObjectWithXmlSerializer_ReturnsExpected() { @@ -268,7 +268,7 @@ public void GetReaderAtContent_WithReader_ReturnsExpected() CompareHelper.AssertEqualLongString(@"10", reader.ReadOuterXml()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetReaderAtContent_ObjectWithXmlObjectSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject() { Value = 10 }; @@ -279,7 +279,7 @@ public void GetReaderAtContent_ObjectWithXmlObjectSerializer_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void GetReaderAtContent_ObjectWithXmlSerializer_ReturnsExpected() { diff --git a/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs b/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs index ffb9f86903c574..ff40b1752ede91 100644 --- a/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs +++ b/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs @@ -39,7 +39,7 @@ public static IEnumerable ReadWriteTestBufferLengths } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void AsyncMethods_ReturnCanceledTaskIfCancellationTokenTripped() { // Arrange @@ -77,7 +77,7 @@ public void CreateTranscodingStream_InvalidArgs() Assert.Throws("outerStreamEncoding", () => Encoding.CreateTranscodingStream(Stream.Null, Encoding.UTF8, null)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true)] [InlineData(false)] public void CanRead_DelegatesToInnerStream(bool expectedCanRead) @@ -100,7 +100,7 @@ public void CanRead_DelegatesToInnerStream(bool expectedCanRead) Assert.False(actualCanReadAfterDispose); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true)] [InlineData(false)] public void CanWrite_DelegatesToInnerStream(bool expectedCanWrite) @@ -198,7 +198,7 @@ public void Dispose_WithLeaveOpenTrue_DoesNotDisposeInnerStream() innerStream.Read(Span.Empty); // shouldn't throw } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Flush_FlushesInnerStreamButNotDecodedState() { // Arrange @@ -391,7 +391,7 @@ void RunOneTestIteration(int stringLength) } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public Task ReadApm() { // Tests TranscodingStream.BeginRead / EndRead @@ -432,7 +432,7 @@ public Task ReadApm() suppressExpectedCancellationTokenAsserts: true); // APM pattern doesn't allow flowing CancellationToken } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadWriteTestBufferLengths))] public Task ReadAsync_ByteArray(int bufferLength) { @@ -451,7 +451,7 @@ public Task ReadAsync_ByteArray(int bufferLength) }); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadWriteTestBufferLengths))] public async Task ReadAsync_Memory(int bufferLength) { @@ -631,7 +631,7 @@ async Task RunOneTestIteration(int stringLength) } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadTimeout_WriteTimeout_NotSupported() { // Arrange - allow inner stream to support ReadTimeout + WriteTimeout @@ -765,7 +765,7 @@ public void Write_WithInvalidArgs_Throws() Assert.Throws(() => transcodingStream.Write(new byte[5], 6, 0)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task WriteAsync_WithFullData() { MemoryStream sink = new MemoryStream(); @@ -824,7 +824,7 @@ public async Task WriteAsync_WithFullData() Assert.Equal(0, sink.Position); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task WriteAsync_WithPartialData() { MemoryStream sink = new MemoryStream(); @@ -879,7 +879,7 @@ public void WriteAsync_WithInvalidArgs_Throws() Assert.Throws(() => (object)transcodingStream.WriteAsync(new byte[5], 6, 0)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WriteApm() { // Arrange diff --git a/src/libraries/System.Threading.Channels/tests/System.Threading.Channels.Tests.csproj b/src/libraries/System.Threading.Channels/tests/System.Threading.Channels.Tests.csproj index 45be5f85721731..3f1345d7446e05 100644 --- a/src/libraries/System.Threading.Channels/tests/System.Threading.Channels.Tests.csproj +++ b/src/libraries/System.Threading.Channels/tests/System.Threading.Channels.Tests.csproj @@ -1,7 +1,7 @@ $(NetCoreAppCurrent);net461 - true + true diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/System.Threading.Tasks.Dataflow.Tests.csproj b/src/libraries/System.Threading.Tasks.Dataflow/tests/System.Threading.Tasks.Dataflow.Tests.csproj index d78224779d494a..78d2ab1d3d659f 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/System.Threading.Tasks.Dataflow.Tests.csproj +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/System.Threading.Tasks.Dataflow.Tests.csproj @@ -2,6 +2,7 @@ true $(NetCoreAppCurrent);net461 + true diff --git a/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs b/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs index d93053de7d1472..aa9cfa8a21f95c 100644 --- a/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs +++ b/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs @@ -1168,6 +1168,7 @@ public void Generic_ToString_Success() [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [InlineData(typeof(ValueTask))] public void NonGeneric_AsyncMethodBuilderAttribute_ValueTaskAttributed(Type valueTaskType) { @@ -1181,6 +1182,7 @@ public void NonGeneric_AsyncMethodBuilderAttribute_ValueTaskAttributed(Type valu [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [InlineData(typeof(ValueTask<>))] [InlineData(typeof(ValueTask))] [InlineData(typeof(ValueTask))] diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index c405468695244e..d2bd1f00d59d54 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -177,6 +177,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tasks/AndroidAppBuilder/Templates/monodroid.c b/src/tasks/AndroidAppBuilder/Templates/monodroid.c index 7bd0464075ebf9..a463bf64f27785 100644 --- a/src/tasks/AndroidAppBuilder/Templates/monodroid.c +++ b/src/tasks/AndroidAppBuilder/Templates/monodroid.c @@ -272,6 +272,7 @@ mono_droid_runtime_init (const char* executable, int managed_argc, char* managed #elif FORCE_AOT register_aot_modules(); mono_jit_set_aot_mode(MONO_AOT_MODE_FULL); + setenv("MONO_AOT_MODE", "aot", true); #endif MonoDomain *domain = mono_jit_init_version ("dotnet.android", "mobile"); diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.props b/src/tasks/AotCompilerTask/MonoAOTCompiler.props index 159c01ff3f27bb..8799a9c2646488 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.props +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.props @@ -20,10 +20,10 @@ - + - + diff --git a/src/tasks/AppleAppBuilder/Templates/runtime.m b/src/tasks/AppleAppBuilder/Templates/runtime.m index e0eb0a7e81d835..9733908a16c937 100644 --- a/src/tasks/AppleAppBuilder/Templates/runtime.m +++ b/src/tasks/AppleAppBuilder/Templates/runtime.m @@ -307,6 +307,7 @@ mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP); #else mono_jit_set_aot_mode (MONO_AOT_MODE_FULL); + setenv("MONO_AOT_MODE", "aot", TRUE); #endif #endif diff --git a/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj b/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj index 49fd6653dde851..10b451529ec828 100644 --- a/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj +++ b/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj @@ -3,6 +3,7 @@ Exe false true + false true $(NetCoreAppCurrent) Android.Device_Emulator.Aot.Test.dll