diff --git a/.editorconfig b/.editorconfig
index db85dde7fd..b2014e3974 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -169,3 +169,7 @@ dotnet_code_quality.ca1802.api_surface = private, internal
[*.cs]
dotnet_code_quality.CA2100.excluded_type_names_with_derived_types = Microsoft.Data.SqlClient.ManualTesting.Tests.*
+dotnet_diagnostic.xUnit1031.severity=none
+dotnet_diagnostic.xUnit1030.severity=none
+
+
diff --git a/build.proj b/build.proj
index 465f9264c3..d9e0146ba7 100644
--- a/build.proj
+++ b/build.proj
@@ -53,7 +53,6 @@
-
@@ -64,7 +63,6 @@
-
diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln
index c5b34945a0..327b6f4ff9 100644
--- a/src/Microsoft.Data.SqlClient.sln
+++ b/src/Microsoft.Data.SqlClient.sln
@@ -72,8 +72,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.SqlClient.Al
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "add-ons", "add-ons", "{C9726AED-D6A3-4AAC-BA04-92DD1F079594}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.XUnitExtensions", "Microsoft.Data.SqlClient\tests\tools\Microsoft.DotNet.XUnitExtensions\Microsoft.DotNet.XUnitExtensions.csproj", "{FDA6971D-9F57-4DA4-B10A-261C91684CFC}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{ED952CF7-84DF-437A-B066-F516E9BE1C2C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "snippets", "snippets", "{71F356DC-DFA3-4163-8BFE-D268722CE189}"
diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/SqlColumnEncryptionCertificateStoreProviderShould.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/SqlColumnEncryptionCertificateStoreProviderShould.cs
index 5b7dd192ef..31c3504d84 100644
--- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/SqlColumnEncryptionCertificateStoreProviderShould.cs
+++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/SqlColumnEncryptionCertificateStoreProviderShould.cs
@@ -303,7 +303,7 @@ public void TestAeadEncryptionReversal(string dataType, object data, Utility.CCo
break;
default:
- Assert.True(false, "unexpected data type.");
+ Assert.Fail("unexpected data type.");
break;
}
diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AmbientTransactionFailureTest.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AmbientTransactionFailureTest.cs
index 94cd0b8ddf..ed70dbd07d 100644
--- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AmbientTransactionFailureTest.cs
+++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AmbientTransactionFailureTest.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
+using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Transactions;
using Xunit;
@@ -11,7 +12,7 @@ namespace Microsoft.Data.SqlClient.Tests
{
public class AmbientTransactionFailureTest
{
-
+ private static readonly bool s_isNotArmProcess = TestUtility.IsNotArmProcess;
private static readonly string s_servername = Guid.NewGuid().ToString();
private static readonly string s_connectionStringWithEnlistAsDefault = $"Data Source={s_servername}; Integrated Security=true; Connect Timeout=1;";
private static readonly string s_connectionStringWithEnlistOff = $"Data Source={s_servername}; Integrated Security=true; Connect Timeout=1;Enlist=False";
@@ -73,7 +74,7 @@ public class AmbientTransactionFailureTest
new object[] { EnlistConnectionInTransaction, s_connectionStringWithEnlistOff }
};
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArmProcess))] // https://github.com/dotnet/corefx/issues/21598
+ [ConditionalTheory(nameof(s_isNotArmProcess))] // https://github.com/dotnet/corefx/issues/21598
[MemberData(nameof(ExceptionTestDataForSqlException))]
public void TestSqlException(Action connectAction, string connectionString)
{
diff --git a/src/Microsoft.Data.SqlClient/tests/tools/Microsoft.DotNet.XUnitExtensions/Extensions/AssertExtensions.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs
similarity index 87%
rename from src/Microsoft.Data.SqlClient/tests/tools/Microsoft.DotNet.XUnitExtensions/Extensions/AssertExtensions.cs
rename to src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs
index 3368aec05a..d9fbb94ca3 100644
--- a/src/Microsoft.Data.SqlClient/tests/tools/Microsoft.DotNet.XUnitExtensions/Extensions/AssertExtensions.cs
+++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs
@@ -1,10 +1,11 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
+using Microsoft.Data.SqlClient.Tests;
using Xunit;
using Xunit.Sdk;
@@ -12,7 +13,7 @@ namespace System
{
public static class AssertExtensions
{
- private static bool IsFullFramework => RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.Ordinal);
+ private static bool IsFullFramework => TestUtility.IsFullFramework;
public static void Throws(Action action, string message)
where T : Exception
@@ -35,7 +36,7 @@ public static void Throws(string netCoreParamName, string netFxParamName, Act
IsFullFramework ?
netFxParamName : netCoreParamName;
- if (!RuntimeInformation.FrameworkDescription.StartsWith(".NET Native", StringComparison.Ordinal))
+ if (!TestUtility.NetNative)
Assert.Equal(expectedParamName, exception.ParamName);
}
@@ -54,7 +55,7 @@ public static void Throws(string netCoreParamName, string netFxParamName, Fun
IsFullFramework ?
netFxParamName : netCoreParamName;
- if (!RuntimeInformation.FrameworkDescription.StartsWith(".NET Native", StringComparison.Ordinal))
+ if (!TestUtility.NetNative)
Assert.Equal(expectedParamName, exception.ParamName);
}
@@ -63,7 +64,7 @@ public static T Throws(string paramName, Action action)
{
T exception = Assert.Throws(action);
- if (!RuntimeInformation.FrameworkDescription.StartsWith(".NET Native", StringComparison.Ordinal))
+ if (!TestUtility.NetNative)
Assert.Equal(paramName, exception.ParamName);
return exception;
@@ -82,7 +83,7 @@ public static T Throws(string paramName, Func