Use the Xunit assert library instead of CoreCLRTestLibrary for most asserts (#61226)
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Sat, 6 Nov 2021 19:46:50 +0000 (12:46 -0700)
committerGitHub <noreply@github.com>
Sat, 6 Nov 2021 19:46:50 +0000 (20:46 +0100)
commit544532a5018aaff48915a629462cdc99a30b7b10
treed7baf11cb40cd7343224116b08b38b14ddaa81a6
parentaefb0fc63b6fceef35039c3d5bf61b7d03fd99a0
Use the Xunit assert library instead of CoreCLRTestLibrary for most asserts (#61226)

Asserts not provided by Xunit are provided by an AssertExtensions class.

Tests that reference System.Private.Corelib directly will use a polyfill implementation based off the old CoreCLRTestLibrary asserts.

All assert methods provided by CoreCLRTestLibrary have been changed to follow Xunit conventions.
252 files changed:
src/tests/Common/Assert.cs [new file with mode: 0644]
src/tests/Common/CoreCLRTestLibrary/AssertExtensions.cs [new file with mode: 0644]
src/tests/Common/CoreCLRTestLibrary/Assertion.cs [deleted file]
src/tests/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj
src/tests/Common/CoreCLRTestLibrary/Utilities.cs
src/tests/Directory.Build.targets
src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs
src/tests/Interop/COM/Activator/Program.cs
src/tests/Interop/COM/ComWrappers/API/Program.cs
src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs
src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs
src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.cs
src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.cs
src/tests/Interop/COM/Dynamic/BasicTest.cs
src/tests/Interop/COM/Dynamic/CollectionTest.cs
src/tests/Interop/COM/Dynamic/EventTest.cs
src/tests/Interop/COM/Dynamic/NETServerTest.cs
src/tests/Interop/COM/Dynamic/ParametersTest.cs
src/tests/Interop/COM/Dynamic/Program.cs
src/tests/Interop/COM/NETClients/Aggregation/Program.cs
src/tests/Interop/COM/NETClients/ConsumeNETServer/Program.cs
src/tests/Interop/COM/NETClients/Events/Program.cs
src/tests/Interop/COM/NETClients/IDispatch/Program.cs
src/tests/Interop/COM/NETClients/IInspectable/Program.cs
src/tests/Interop/COM/NETClients/Licensing/Program.cs
src/tests/Interop/COM/NETClients/Lifetime/Program.cs
src/tests/Interop/COM/NETClients/Primitives/ArrayTests.cs
src/tests/Interop/COM/NETClients/Primitives/ColorTests.cs
src/tests/Interop/COM/NETClients/Primitives/ErrorTests.cs
src/tests/Interop/COM/NETClients/Primitives/NumericTests.cs
src/tests/Interop/COM/NETClients/Primitives/Program.cs
src/tests/Interop/COM/NETClients/Primitives/StringTests.cs
src/tests/Interop/COM/Reflection/Reflection.cs
src/tests/Interop/Directory.Build.targets
src/tests/Interop/DllImportAttribute/ExactSpelling/ExactSpellingTest.cs
src/tests/Interop/ICustomMarshaler/ConflictingNames/RunInALC.cs
src/tests/Interop/ICustomMarshaler/ConflictingNames/SameNameDifferentAssembly.cs
src/tests/Interop/IDynamicInterfaceCastable/Program.cs
src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.cs
src/tests/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded.cs
src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.cs
src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.cs
src/tests/Interop/LayoutClass/LayoutClassTest.cs
src/tests/Interop/MarshalAPI/FunctionPointer/FunctionPointer.cs
src/tests/Interop/MarshalAPI/FunctionPointer/SingleMulticastTest.cs
src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs
src/tests/Interop/NativeLibrary/API/NativeLibraryTests.cs
src/tests/Interop/NativeLibrary/AssemblyLoadContext/ResolveUnmanagedDllTests.cs
src/tests/Interop/NativeLibrary/Callback/CallbackTests.cs
src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs
src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/Program.cs
src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs
src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs
src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs
src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs
src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs
src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs
src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFF/AFF_PFF.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFT/AFF_PFT.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTF/AFF_PTF.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTT/AFF_PTT.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFF/AFT_PFF.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFT/AFT_PFT.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTF/AFT_PTF.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTT/AFT_PTT.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFF/ATF_PFF.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFT/ATF_PFT.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTF/ATF_PTF.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTT/ATF_PTT.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFF/ATT_PFF.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFT/ATT_PFT.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTF/ATT_PTF.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTT/ATT_PTT.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_False/Assembly_False_False.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_True/Assembly_False_True.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_False/Assembly_True_False.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_True/Assembly_True_True.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_False/Pinvoke_False_False.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_True/Pinvoke_False_True.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_False/Pinvoke_True_False.cs
src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_True/Pinvoke_True_True.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFF/AFF_PFF.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFT/AFF_PFT.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTF/AFF_PTF.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTT/AFF_PTT.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFF/AFT_PFF.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFT/AFT_PFT.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTF/AFT_PTF.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTT/AFT_PTT.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFF/ATF_PFF.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFT/ATF_PFT.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTF/ATF_PTF.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTT/ATF_PTT.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFF/ATT_PFF.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFT/ATT_PFT.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTF/ATT_PTF.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTT/ATT_PTT.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_False/Assembly_False_False.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_True/Assembly_False_True.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_False/Assembly_True_False.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_True/Assembly_True_True.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_False/Pinvoke_False_False.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_True/Pinvoke_False_True.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_False/Pinvoke_True_False.cs
src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_True/Pinvoke_True_True.cs
src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs
src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.cs
src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs
src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs
src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs
src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs
src/tests/Interop/PInvoke/Decimal/DecimalTest.cs
src/tests/Interop/PInvoke/Delegate/DelegateTest.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.NullableB.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.NullableC.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.NullableD.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.NullableF.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.NullableL.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.NullableU.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point1B.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point1C.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point1D.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point1F.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point1L.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point1U.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point2B.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point2C.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point2D.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point2F.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point2L.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point2U.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point3B.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point3C.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point3D.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point3F.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point3L.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point3U.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point4B.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point4C.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point4D.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point4F.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point4L.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Point4U.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanB.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanC.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassB.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassC.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassD.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassF.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassL.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassU.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SpanB.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SpanC.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs
src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs
src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs
src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs
src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.cs
src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.cs
src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs
src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs
src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs
src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs
src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs
src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs
src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs
src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs
src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.cs
src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs
src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs
src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs
src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs
src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs
src/tests/Interop/PInvoke/Varargs/VarargsTest.cs
src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs
src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs
src/tests/Interop/PInvoke/Variant/VariantTest.cs
src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.cs
src/tests/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs
src/tests/Interop/ReadMe.md
src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.cs
src/tests/Interop/StringMarshalling/BSTR/BSTRTest.cs
src/tests/Interop/StringMarshalling/Common/CommonStringTests.cs
src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs
src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs
src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.cs
src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest.cs
src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest.cs
src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs
src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs
src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs
src/tests/Interop/UnmanagedCallConv/PInvokesCS.cs
src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvTest.cs
src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs
src/tests/Interop/WinRT/Program.cs
src/tests/Interop/common/CheckGCMode.cs
src/tests/JIT/Directed/callconv/CdeclMemberFunction/CdeclMemberFunctionTest.cs
src/tests/JIT/Directed/callconv/PlatformDefaultMemberFunction/PlatformDefaultMemberFunctionTest.cs
src/tests/JIT/Directed/callconv/StdCallMemberFunction/StdCallMemberFunctionTest.cs
src/tests/JIT/Directed/callconv/ThisCall/ThisCallTest.cs
src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/AssemblyDependencyResolverTests.cs
src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/NativeDependencyTests.cs
src/tests/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs
src/tests/Loader/ContextualReflection/ContextualReflection.cs
src/tests/Loader/ContextualReflection/ContextualReflectionDependency.cs
src/tests/Loader/binding/tracing/BinderEventListener.cs
src/tests/Loader/binding/tracing/BinderTracingTest.Basic.cs
src/tests/Loader/binding/tracing/BinderTracingTest.DefaultProbing.cs
src/tests/Loader/binding/tracing/BinderTracingTest.EventHandlers.cs
src/tests/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.cs
src/tests/Loader/binding/tracing/BinderTracingTest.cs
src/tests/Loader/binding/tracing/Helpers.cs
src/tests/Loader/classloader/DictionaryExpansion/DictionaryExpansion.cs
src/tests/baseservices/callconvs/TestCallingConventions.cs
src/tests/baseservices/typeequivalence/simple/Simple.cs