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)
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

diff --git a/src/tests/Common/Assert.cs b/src/tests/Common/Assert.cs
new file mode 100644 (file)
index 0000000..a4ab602
--- /dev/null
@@ -0,0 +1,238 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+// This file is used to provide some basic Assert functionality for assemblies that directly reference System.Private.CoreLib
+// and not the ref pack.
+
+// Note: Exception messages call ToString instead of Name to avoid MissingMetadataException when just outputting basic info
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace Xunit
+{
+    /// <summary>
+    ///    A collection of helper classes to test various conditions within
+    /// unit tests. If the condition being tested is not met, an exception
+    /// is thrown.
+    /// </summary>
+    public static class Assert
+    {
+        /// <summary>
+        ///     Asserts that the given delegate throws an <see cref="Exception"/> of type <typeparam name="T" />.
+        /// </summary>
+        /// <param name="action">
+        ///     The delagate of type <see cref="Action"/> to execute.
+        /// </param>
+        /// <param name="message">
+        ///     A <see cref="String"/> containing additional information for when the assertion fails.
+        /// </param>
+        /// <returns>
+        ///     The thrown <see cref="Exception"/>.
+        /// </returns>
+        /// <exception cref="AssertFailedException">
+        ///     <see cref="Exception"/> of type <typeparam name="T"/> was not thrown.
+        /// </exception>
+        public static T Throws<T>(Action action) where T : Exception
+        {
+            Exception exception = RunWithCatch(action);
+
+            if (exception == null)
+                Assert.True(false, $"Expected '{typeof(T)}' to be thrown.");
+
+            if (exception is not T)
+                Assert.True(false, $"Expected '{typeof(T)}' to be thrown, however '{exception.GetType()}' was thrown.");
+
+            return (T)exception;
+        }
+
+        /// <summary>
+        /// Tests whether the specified condition is true and throws an exception
+        /// if the condition is false.
+        /// </summary>
+        /// <param name="condition">The condition the test expects to be true.</param>
+        /// <param name="message">
+        /// The message to include in the exception when <paramref name="condition"/>
+        /// is false. The message is shown in test results.
+        /// </param>
+        /// <exception cref="AssertFailedException">
+        /// Thrown if <paramref name="condition"/> is false.
+        /// </exception>
+        public static void True(bool condition, string message = "")
+        {
+            if (!condition)
+            {
+                Assert.HandleFail("Assert.True", message);
+            }
+        }
+
+        /// <summary>
+        /// Tests whether the specified condition is false and throws an exception
+        /// if the condition is true.
+        /// </summary>
+        /// <param name="condition">The condition the test expects to be false.</param>
+        /// <param name="message">
+        /// The message to include in the exception when <paramref name="condition"/>
+        /// is true. The message is shown in test results.
+        /// </param>
+        /// <exception cref="AssertFailedException">
+        /// Thrown if <paramref name="condition"/> is true.
+        /// </exception>
+        public static void False(bool condition, string message = "")
+        {
+            if (condition)
+            {
+                Assert.HandleFail("Assert.False", message);
+            }
+        }
+
+        /// <summary>
+        /// Tests whether the specified object is null and throws an exception
+        /// if it is not.
+        /// </summary>
+        /// <param name="value">The object the test expects to be null.</param>
+        /// <param name="message">
+        /// The message to include in the exception when <paramref name="value"/>
+        /// is not null. The message is shown in test results.
+        /// </param>
+        /// <exception cref="AssertFailedException">
+        /// Thrown if <paramref name="value"/> is not null.
+        /// </exception>
+        public static void Null(object value)
+        {
+            if (value != null)
+            {
+                Assert.HandleFail("Assert.Null", "");
+            }
+        }
+
+        /// <summary>
+        /// Tests whether the specified object is non-null and throws an exception
+        /// if it is null.
+        /// </summary>
+        /// <param name="value">The object the test expects not to be null.</param>
+        /// <param name="message">
+        /// The message to include in the exception when <paramref name="value"/>
+        /// is null. The message is shown in test results.
+        /// </param>
+        /// <exception cref="AssertFailedException">
+        /// Thrown if <paramref name="value"/> is null.
+        /// </exception>
+        public static void NotNull(object value)
+        {
+            if (value == null)
+            {
+                Assert.HandleFail("Assert.NotNull", "");
+            }
+        }
+
+        /// <summary>
+        /// Tests whether the expected object is equal to the actual object  and
+        /// throws an exception if it is not.
+        /// </summary>
+        /// <param name="notExpected">Expected object.</param>
+        /// <param name="actual">Actual object.</param>
+        /// <param name="message">Message to display upon failure.</param>
+        public static void Equal<T>(T expected, T actual)
+        {
+            if (!Object.Equals(expected, actual))
+            {
+                Assert.HandleFail("Assert.Equal", "");
+            }
+        }
+
+        /// <summary>
+        /// Tests whether the expected object is equal to the actual object  and
+        /// throws an exception if it is not.
+        /// </summary>
+        /// <param name="notExpected">Expected object.</param>
+        /// <param name="actual">Actual object.</param>
+        /// <param name="message">Message to display upon failure.</param>
+        public static void Same(object expected, object actual)
+        {
+            const string EXPECTED_MSG = @"Expected: [{1}]. Actual: [{2}]. {0}";
+
+            if (!Object.ReferenceEquals(expected, actual))
+            {
+                Assert.HandleFail("Assert.Same", "");
+            }
+        }
+
+        /// <summary>
+        /// Tests whether the expected object is equal to the actual object  and
+        /// throws an exception if it is not.
+        /// </summary>
+        /// <param name="notExpected">Expected object.</param>
+        /// <param name="actual">Actual object.</param>
+        /// <param name="message">Message to display upon failure.</param>
+        public static void Equal<T>(T expected, T actual, string format, params Object[] args)
+        {
+            Equal<T>(expected, actual);
+        }
+
+        /// <summary>
+        /// Tests whether the expected object is equal to the actual object  and
+        /// throws an exception if it is not.
+        /// </summary>
+        /// </summary>
+        /// <param name="notExpected">Expected object that we do not want it to be.</param>
+        /// <param name="actual">Actual object.</param>
+        /// <param name="message">Message to display upon failure.</param>
+        public static void NotEqual<T>(T notExpected, T actual)
+        {
+            if (Object.Equals(notExpected, actual))
+            {
+                Assert.HandleFail("Assert.NotEqual", "");
+            }
+        }
+
+        /// <summary>
+        /// Helper function that creates and throws an exception.
+        /// </summary>
+        /// <param name="assertionName">name of the assertion throwing an exception.</param>
+        /// <param name="message">message describing conditions for assertion failure.</param>
+        /// <param name="parameters">The parameters.</param>=
+        internal static void HandleFail(string assertionName, string message)
+        {
+            throw new XunitException(assertionName + ": " + message);
+        }
+
+
+        [Obsolete("Did you mean to call Assert.Equal()")]
+        public static new bool Equals(Object o1, Object o2)
+        {
+            Assert.True(false, "Don't call this.");
+            throw new Exception();
+        }
+
+        private static Exception RunWithCatch(Action action)
+        {
+            try
+            {
+                action();
+                return null;
+            }
+            catch (Exception ex)
+            {
+                return ex;
+            }
+        }
+    }
+
+    /// <summary>
+    /// Exception raised by the Assert on Fail
+    /// </summary>
+    public class XunitException : Exception
+    {
+        public XunitException(string message)
+            : base(message)
+        {
+        }
+
+        public XunitException()
+            : base()
+        {
+        }
+    }
+}
diff --git a/src/tests/Common/CoreCLRTestLibrary/AssertExtensions.cs b/src/tests/Common/CoreCLRTestLibrary/AssertExtensions.cs
new file mode 100644 (file)
index 0000000..c039f5a
--- /dev/null
@@ -0,0 +1,176 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+// Note: Exception messages call ToString instead of Name to avoid MissingMetadataException when just outputting basic info
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace Xunit
+{
+    public static class AssertExtensions
+    {
+        /// <summary>
+        ///     Asserts that the given delegate throws an <see cref="ArgumentException"/> with the given parameter name.
+        /// </summary>
+        /// <param name="action">
+        ///     The delagate of type <see cref="Action"/> to execute.
+        /// </param>
+        /// <param name="message">
+        ///     A <see cref="String"/> containing additional information for when the assertion fails.
+        /// </param>
+        /// <param name="parameterName">
+        ///     A <see cref="String"/> containing the parameter of name to check, <see langword="null"/> to skip parameter validation.
+        /// </param>
+        /// <returns>
+        ///     The thrown <see cref="ArgumentException"/>.
+        /// </returns>
+        /// <exception cref="AssertFailedException">
+        ///     <see cref="Exception"/> of type <see cref="ArgumentException"/> was not thrown.
+        ///     <para>
+        ///         -or-
+        ///     </para>
+        ///     <see cref="ArgumentException.ParamName"/> is not equal to <paramref name="parameterName"/> .
+        /// </exception>
+        public static ArgumentException ThrowsArgumentException(string parameterName, Action action)
+        {
+            return ThrowsArgumentException<ArgumentException>(parameterName, action);
+        }
+
+        /// <summary>
+        ///     Asserts that the given delegate throws an <see cref="ArgumentException"/> of type <typeparamref name="T"/> with the given parameter name.
+        /// </summary>
+        /// <param name="action">
+        ///     The delagate of type <see cref="Action"/> to execute.
+        /// </param>
+        /// <param name="message">
+        ///     A <see cref="String"/> containing additional information for when the assertion fails.
+        /// </param>
+        /// <param name="parameterName">
+        ///     A <see cref="String"/> containing the parameter of name to check, <see langword="null"/> to skip parameter validation.
+        /// </param>
+        /// <returns>
+        ///     The thrown <see cref="Exception"/>.
+        /// </returns>
+        /// <exception cref="AssertFailedException">
+        ///     <see cref="Exception"/> of type <typeparam name="T"/> was not thrown.
+        ///     <para>
+        ///         -or-
+        ///     </para>
+        ///     <see cref="ArgumentException.ParamName"/> is not equal to <paramref name="parameterName"/> .
+        /// </exception>
+        public static T ThrowsArgumentException<T>(string parameterName, Action action)
+            where T : ArgumentException
+        {
+            T exception = Assert.Throws<T>(action);
+
+#if DEBUG
+            // ParamName's not available on ret builds
+            if (parameterName != null)
+                Assert.Equal(parameterName, exception.ParamName);
+#endif
+
+            return exception;
+        }
+
+        /// <summary>
+        ///     Asserts that the given async delegate throws an <see cref="Exception"/> of type <typeparam name="T" /> and <see cref="Exception.InnerException"/>
+        ///     returns an <see cref="Exception"/> of type <typeparam name="TInner" />.
+        /// </summary>
+        /// <param name="action">
+        ///     The delagate of type <see cref="Action"/> to execute.
+        /// </param>
+        /// <param name="message">
+        ///     A <see cref="String"/> containing additional information for when the assertion fails.
+        /// </param>
+        /// <param name="options">
+        ///     Specifies whether <see cref="Assert.Throws{T}"/> should require an exact type match when comparing the expected exception type with the thrown exception. The default is <see cref="AssertThrowsOptions.None"/>.
+        /// </param>
+        /// <returns>
+        ///     The thrown inner <see cref="Exception"/>.
+        /// </returns>
+        /// <exception cref="AssertFailedException">
+        ///     <see cref="Exception"/> of type <typeparam name="T"/> was not thrown.
+        ///     <para>
+        ///         -or-
+        ///     </para>
+        ///     <see cref="Exception.InnerException"/> is not of type <typeparam name="TInner"/>.
+        /// </exception>
+        public static TInner ThrowsWithInnerException<T, TInner>(Action action)
+            where T : Exception
+            where TInner : Exception
+        {
+            T outerException = Assert.Throws<T>(action);
+
+            if (outerException.InnerException == null)
+                Assert.True(false, string.Format("Expected '{0}.InnerException' to be '{1}', however it is null.", typeof(T), typeof(TInner)));
+
+            if (outerException.InnerException is not TInner)
+                Assert.True(false, string.Format("Expected '{0}.InnerException', to be '{1}', however, '{2}' is.", typeof(T), typeof(TInner), outerException.InnerException.GetType()));
+
+            return (TInner)outerException.InnerException;
+        }
+
+
+        /// <summary>
+        /// Tests whether the two lists are the same length and contain the same objects (using Object.Equals()) in the same order and
+        /// throws an exception if it is not.
+        /// </summary>
+        /// <param name="expected">Expected list.</param>
+        /// <param name="actual">Actual list.</param>
+        /// <param name="message">Message to display upon failure.</param>
+        public static void CollectionEqual<T>(T[] expected, T[] actual)
+        {
+            Assert.Equal(expected.Length, actual.Length);
+
+            for (int i = 0; i < expected.Length; i++)
+                Assert.Equal<T>(expected[i], actual[i]);
+        }
+
+        /// <summary>
+        /// Tests whether the two enumerables are the same length and contain the same objects (using Object.Equals()) in the same order and
+        /// throws an exception if it is not.
+        /// </summary>
+        /// <param name="expected">Expected enumerables.</param>
+        /// <param name="actual">Actual enumerables.</param>
+        /// <param name="message">Message to display upon failure.</param>
+        public static void CollectionEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual)
+        {
+            CollectionEqual(CopyToArray(expected), CopyToArray(actual));
+        }
+
+        /// <summary>
+        /// Iterates through an IEnumerable to generate an array of elements. The rational for using this instead of
+        /// System.Linq.ToArray is that this will not require a dependency on System.Linq.dll
+        /// </summary>
+        private static T[] CopyToArray<T>(IEnumerable<T> source)
+        {
+            T[] items = new T[4];
+            int count = 0;
+
+            if (source == null)
+                return null;
+
+            foreach (var item in source)
+            {
+                if (items.Length == count)
+                {
+                    var newItems = new T[checked(count * 2)];
+                    Array.Copy(items, 0, newItems, 0, count);
+                    items = newItems;
+                }
+
+                items[count] = item;
+                count++;
+            }
+
+            if (items.Length == count)
+                return items;
+
+            var finalItems = new T[count];
+            Array.Copy(items, 0, finalItems, 0, count);
+            return finalItems;
+        }
+    }
+}
diff --git a/src/tests/Common/CoreCLRTestLibrary/Assertion.cs b/src/tests/Common/CoreCLRTestLibrary/Assertion.cs
deleted file mode 100644 (file)
index f921ce2..0000000
+++ /dev/null
@@ -1,822 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-// Note: Exception messages call ToString instead of Name to avoid MissingMetadataException when just outputting basic info
-
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace TestLibrary
-{
-    /// <summary>
-    ///    A collection of helper classes to test various conditions within
-    /// unit tests. If the condition being tested is not met, an exception
-    /// is thrown.
-    /// </summary>
-    public static class Assert
-    {
-        /// <summary>
-        ///     Asserts that the given delegate throws an <see cref="ArgumentNullException"/> with the given parameter name.
-        /// </summary>
-        /// <param name="action">
-        ///     The delagate of type <see cref="Action"/> to execute.
-        /// </param>
-        /// <param name="message">
-        ///     A <see cref="String"/> containing additional information for when the assertion fails.
-        /// </param>
-        /// <param name="parameterName">
-        ///     A <see cref="String"/> containing the parameter of name to check, <see langword="null"/> to skip parameter validation.
-        /// </param>
-        /// <returns>
-        ///     The thrown <see cref="ArgumentNullException"/>.
-        /// </returns>
-        /// <exception cref="AssertFailedException">
-        ///     <see cref="Exception"/> of type <see cref="ArgumentNullException"/> was not thrown.
-        ///     <para>
-        ///         -or-
-        ///     </para>
-        ///     <see cref="ArgumentException.ParamName"/> is not equal to <paramref name="parameterName"/> .
-        /// </exception>
-        public static ArgumentNullException ThrowsArgumentNullException(string parameterName, Action action, string message = null)
-        {
-            return ThrowsArgumentException<ArgumentNullException>(parameterName, action, message);
-        }
-
-        /// <summary>
-        ///     Asserts that the given delegate throws an <see cref="ArgumentException"/> with the given parameter name.
-        /// </summary>
-        /// <param name="action">
-        ///     The delagate of type <see cref="Action"/> to execute.
-        /// </param>
-        /// <param name="message">
-        ///     A <see cref="String"/> containing additional information for when the assertion fails.
-        /// </param>
-        /// <param name="parameterName">
-        ///     A <see cref="String"/> containing the parameter of name to check, <see langword="null"/> to skip parameter validation.
-        /// </param>
-        /// <returns>
-        ///     The thrown <see cref="ArgumentException"/>.
-        /// </returns>
-        /// <exception cref="AssertFailedException">
-        ///     <see cref="Exception"/> of type <see cref="ArgumentException"/> was not thrown.
-        ///     <para>
-        ///         -or-
-        ///     </para>
-        ///     <see cref="ArgumentException.ParamName"/> is not equal to <paramref name="parameterName"/> .
-        /// </exception>
-        public static ArgumentException ThrowsArgumentException(string parameterName, Action action, string message = null)
-        {
-            return ThrowsArgumentException<ArgumentException>(parameterName, action, message);
-        }
-
-        /// <summary>
-        ///     Asserts that the given delegate throws an <see cref="ArgumentException"/> of type <typeparamref name="T"/> with the given parameter name.
-        /// </summary>
-        /// <param name="action">
-        ///     The delagate of type <see cref="Action"/> to execute.
-        /// </param>
-        /// <param name="message">
-        ///     A <see cref="String"/> containing additional information for when the assertion fails.
-        /// </param>
-        /// <param name="parameterName">
-        ///     A <see cref="String"/> containing the parameter of name to check, <see langword="null"/> to skip parameter validation.
-        /// </param>
-        /// <returns>
-        ///     The thrown <see cref="Exception"/>.
-        /// </returns>
-        /// <exception cref="AssertFailedException">
-        ///     <see cref="Exception"/> of type <typeparam name="T"/> was not thrown.
-        ///     <para>
-        ///         -or-
-        ///     </para>
-        ///     <see cref="ArgumentException.ParamName"/> is not equal to <paramref name="parameterName"/> .
-        /// </exception>
-        public static T ThrowsArgumentException<T>(string parameterName, Action action, string message = null)
-            where T : ArgumentException
-        {
-            T exception = Throws<T>(action, message);
-
-#if DEBUG
-            // ParamName's not available on ret builds
-            if (parameterName != null)
-                Assert.AreEqual(parameterName, exception.ParamName, "Expected '{0}.ParamName' to be '{1}'. {2}", typeof(T), parameterName, message);
-#endif
-
-            return exception;
-        }
-
-        /// <summary>
-        ///     Asserts that the given delegate throws an <see cref="AggregateException"/> with a base exception <see cref="Exception"/> of type <typeparam name="T" />.
-        /// </summary>
-        /// <param name="action">
-        ///     The delagate of type <see cref="Action"/> to execute.
-        /// </param>
-        /// <param name="message">
-        ///     A <see cref="String"/> containing additional information for when the assertion fails.
-        /// </param>
-        /// <returns>
-        ///     The base <see cref="Exception"/> of the <see cref="AggregateException"/>.
-        /// </returns>
-        /// <exception cref="AssertFailedException">
-        ///     <see cref="AggregateException"/> of was not thrown.
-        ///         -or-
-        ///     </para>
-        ///     <see cref="AggregateException.GetBaseException()"/> is not of type <typeparam name="TBase"/>.
-        /// </exception>
-        public static TBase ThrowsAggregateException<TBase>(Action action, string message = "") where TBase : Exception
-        {
-            AggregateException exception = Throws<AggregateException>(action, message);
-
-            Exception baseException = exception.GetBaseException();
-            if (baseException == null)
-                Assert.Fail("Expected 'AggregateException.GetBaseException()' to be '{0}', however it is null. {1}", typeof(TBase), message);
-
-            if (baseException.GetType() != typeof(TBase))
-                Assert.Fail("Expected 'AggregateException.GetBaseException()', to be '{0}', however, '{1}' is. {2}", typeof(TBase), baseException.GetType(), message);
-
-            return (TBase)baseException;
-        }
-
-        /// <summary>
-        ///     Asserts that the given delegate throws an <see cref="Exception"/> of type <typeparam name="T" />.
-        /// </summary>
-        /// <param name="action">
-        ///     The delagate of type <see cref="Action"/> to execute.
-        /// </param>
-        /// <param name="format">
-        ///     A <see cref="String"/> containing format information for when the assertion fails.
-        /// </param>
-        /// <param name="args">
-        ///     An <see cref="Array"/> of arguments to be formatted.
-        /// </param>
-        /// <returns>
-        ///     The thrown <see cref="Exception"/>.
-        /// </returns>
-        /// <exception cref="AssertFailedException">
-        ///     <see cref="Exception"/> of type <typeparam name="T"/> was not thrown.
-        /// </exception>
-        public static T Throws<T>(Action action, string format, params Object[] args) where T : Exception
-        {
-            return Throws<T>(action, String.Format(format, args));
-        }
-
-        /// <summary>
-        ///     Asserts that the given delegate throws an <see cref="Exception"/> of type <typeparam name="T" />.
-        /// </summary>
-        /// <param name="action">
-        ///     The delagate of type <see cref="Action"/> to execute.
-        /// </param>
-        /// <param name="message">
-        ///     A <see cref="String"/> containing additional information for when the assertion fails.
-        /// </param>
-        /// <param name="options">
-        ///     Specifies whether <see cref="Assert.Throws{T}"/> should require an exact type match when comparing the expected exception type with the thrown exception. The default is <see cref="AssertThrowsOptions.None"/>.
-        /// </param>
-        /// <returns>
-        ///     The thrown <see cref="Exception"/>.
-        /// </returns>
-        /// <exception cref="AssertFailedException">
-        ///     <see cref="Exception"/> of type <typeparam name="T"/> was not thrown.
-        /// </exception>
-        public static T Throws<T>(Action action, string message = "", AssertThrowsOptions options = AssertThrowsOptions.None) where T : Exception
-        {
-            Exception exception = RunWithCatch(action);
-
-            if (exception == null)
-                Assert.Fail("Expected '{0}' to be thrown. {1}", typeof(T).ToString(), message);
-
-            if (!IsOfExceptionType<T>(exception, options))
-                Assert.Fail("Expected '{0}' to be thrown, however '{1}' was thrown. {2}", typeof(T), exception.GetType(), message);
-
-            return (T)exception;
-        }
-
-        /// <summary>
-        ///     Asserts that the given async delegate throws an <see cref="Exception"/> of type <typeparam name="T".
-        /// </summary>
-        /// <param name="action">
-        ///     The delagate of type <see cref="Func{}"/> to execute.
-        /// </param>
-        /// <param name="message">
-        ///     A <see cref="String"/> containing additional information for when the assertion fails.
-        /// </param>
-        /// <param name="options">
-        ///     Specifies whether <see cref="Assert.Throws{T}"/> should require an exact type match when comparing the expected exception type with the thrown exception. The default is <see cref="AssertThrowsOptions.None"/>.
-        /// </param>
-        /// <returns>
-        ///     The thrown <see cref="Exception"/>.
-        /// </returns>
-        /// <exception cref="AssertFailedException">
-        ///     <see cref="Exception"/> of type <typeparam name="T"/> was not thrown.
-        /// </exception>
-        public static async Task<T> ThrowsAsync<T>(Func<Task> action, string message = "", AssertThrowsOptions options = AssertThrowsOptions.None) where T : Exception
-        {
-            Exception exception = await RunWithCatchAsync(action);
-
-            if (exception == null)
-                Assert.Fail("Expected '{0}' to be thrown. {1}", typeof(T).ToString(), message);
-
-            if (!IsOfExceptionType<T>(exception, options))
-                Assert.Fail("Expected '{0}' to be thrown, however '{1}' was thrown. {2}", typeof(T), exception.GetType(), message);
-
-            return (T)exception;
-        }
-
-        /// <summary>
-        ///     Asserts that the given async delegate throws an <see cref="Exception"/> of type <typeparam name="T" /> and <see cref="Exception.InnerException"/> 
-        ///     returns an <see cref="Exception"/> of type <typeparam name="TInner" />.
-        /// </summary>
-        /// <param name="action">
-        ///     The delagate of type <see cref="Action"/> to execute.
-        /// </param>
-        /// <param name="message">
-        ///     A <see cref="String"/> containing additional information for when the assertion fails.
-        /// </param>
-        /// <param name="options">
-        ///     Specifies whether <see cref="Assert.Throws{T}"/> should require an exact type match when comparing the expected exception type with the thrown exception. The default is <see cref="AssertThrowsOptions.None"/>.
-        /// </param>
-        /// <returns>
-        ///     The thrown inner <see cref="Exception"/>.
-        /// </returns>
-        /// <exception cref="AssertFailedException">
-        ///     <see cref="Exception"/> of type <typeparam name="T"/> was not thrown.
-        ///     <para>
-        ///         -or-
-        ///     </para>
-        ///     <see cref="Exception.InnerException"/> is not of type <typeparam name="TInner"/>.
-        /// </exception>
-        public static TInner Throws<T, TInner>(Action action, string message = "", AssertThrowsOptions options = AssertThrowsOptions.None)
-            where T : Exception
-            where TInner : Exception
-        {
-            T outerException = Throws<T>(action, message, options);
-
-            if (outerException.InnerException == null)
-                Assert.Fail("Expected '{0}.InnerException' to be '{1}', however it is null. {2}", typeof(T), typeof(TInner), message);
-
-            if (!IsOfExceptionType<TInner>(outerException.InnerException, options))
-                Assert.Fail("Expected '{0}.InnerException', to be '{1}', however, '{2}' is. {3}", typeof(T), typeof(TInner), outerException.InnerException.GetType(), message);
-
-            return (TInner)outerException.InnerException;
-        }
-
-
-        /// <summary>
-        /// Tests whether the specified condition is true and throws an exception
-        /// if the condition is false.
-        /// </summary>
-        /// <param name="condition">The condition the test expects to be true.</param>
-        /// <param name="message">
-        /// The message to include in the exception when <paramref name="condition"/>
-        /// is false. The message is shown in test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="condition"/> is false.
-        /// </exception>
-        public static void IsTrue(bool condition, string format, params Object[] args)
-        {
-            if (!condition)
-            {
-                Assert.HandleFail("Assert.IsTrue", String.Format(format, args));
-            }
-        }
-
-        /// <summary>
-        /// Tests whether the specified condition is true and throws an exception
-        /// if the condition is false.
-        /// </summary>
-        /// <param name="condition">The condition the test expects to be true.</param>
-        /// <param name="message">
-        /// The message to include in the exception when <paramref name="condition"/>
-        /// is false. The message is shown in test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="condition"/> is false.
-        /// </exception>
-        public static void IsTrue(bool condition, string message = "")
-        {
-            if (!condition)
-            {
-                Assert.HandleFail("Assert.IsTrue", message);
-            }
-        }
-
-        /// <summary>
-        /// Tests whether the specified condition is false and throws an exception
-        /// if the condition is true.
-        /// </summary>
-        /// <param name="condition">The condition the test expects to be false.</param>
-        /// <param name="message">
-        /// The message to include in the exception when <paramref name="condition"/>
-        /// is true. The message is shown in test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="condition"/> is true.
-        /// </exception>
-        public static void IsFalse(bool condition, string message = "")
-        {
-            if (condition)
-            {
-                Assert.HandleFail("Assert.IsFalse", message);
-            }
-        }
-
-        /// <summary>
-        /// Tests whether the specified condition is false and throws an exception
-        /// if the condition is true.
-        /// </summary>
-        /// <param name="condition">The condition the test expects to be false.</param>
-        /// <param name="message">
-        /// The message to include in the exception when <paramref name="condition"/>
-        /// is true. The message is shown in test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="condition"/> is true.
-        /// </exception>
-        public static void IsFalse(bool condition, string format, params Object[] args)
-        {
-            IsFalse(condition, String.Format(format, args));
-        }
-
-        /// <summary>
-        /// Tests whether the specified object is null and throws an exception
-        /// if it is not.
-        /// </summary>
-        /// <param name="value">The object the test expects to be null.</param>
-        /// <param name="message">
-        /// The message to include in the exception when <paramref name="value"/>
-        /// is not null. The message is shown in test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="value"/> is not null.
-        /// </exception>
-        public static void IsNull(object value, string message = "")
-        {
-            if (value != null)
-            {
-                Assert.HandleFail("Assert.IsNull", message);
-            }
-        }
-
-        /// <summary>
-        /// Tests whether the specified object is null and throws an exception
-        /// if it is not.
-        /// </summary>
-        /// <param name="value">The object the test expects to be null.</param>
-        /// <param name="message">
-        /// The message to include in the exception when <paramref name="value"/>
-        /// is not null. The message is shown in test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="value"/> is not null.
-        /// </exception>
-        public static void IsNull(object value, string format, params Object[] args)
-        {
-            IsNull(value, String.Format(format, args));
-        }
-
-        /// <summary>
-        /// Tests whether the specified object is non-null and throws an exception
-        /// if it is null.
-        /// </summary>
-        /// <param name="value">The object the test expects not to be null.</param>
-        /// <param name="message">
-        /// The message to include in the exception when <paramref name="value"/>
-        /// is null. The message is shown in test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="value"/> is null.
-        /// </exception>
-        public static void IsNotNull(object value, string message = "")
-        {
-            if (value == null)
-            {
-                Assert.HandleFail("Assert.IsNotNull", message);
-            }
-        }
-
-        /// <summary>
-        /// Tests whether the expected object is equal to the actual object  and 
-        /// throws an exception if it is not.
-        /// </summary>
-        /// <param name="notExpected">Expected object.</param>
-        /// <param name="actual">Actual object.</param>
-        /// <param name="message">Message to display upon failure.</param>
-        public static void AreEqual<T>(T expected, T actual, string message = "")
-        {
-            const string EXPECTED_MSG = @"Expected: [{1}]. Actual: [{2}]. {0}";
-
-            if (!Object.Equals(expected, actual))
-            {
-                string finalMessage = String.Format(EXPECTED_MSG, message, (object)expected ?? "NULL", (object)actual ?? "NULL");
-                Assert.HandleFail("Assert.AreEqual", finalMessage);
-            }
-        }
-
-        /// <summary>
-        /// Tests whether the expected object is equal to the actual object  and 
-        /// throws an exception if it is not.
-        /// </summary>
-        /// <param name="notExpected">Expected object.</param>
-        /// <param name="actual">Actual object.</param>
-        /// <param name="message">Message to display upon failure.</param>
-        public static void AreEqual<T>(T expected, T actual, string format, params Object[] args)
-        {
-            AreEqual<T>(expected, actual, String.Format(format, args));
-        }
-
-        /// <summary>
-        /// Tests whether the expected object is equal to the actual object  and 
-        /// throws an exception if it is not.
-        /// </summary>
-        /// <param name="notExpected">Expected object that we do not want it to be.</param>
-        /// <param name="actual">Actual object.</param>
-        /// <param name="message">Message to display upon failure.</param>
-        public static void AreNotEqual<T>(T notExpected, T actual, string message = "")
-        {
-            if (Object.Equals(notExpected, actual))
-            {
-                String finalMessage =
-                    String.Format(@"Expected any value except:[{1}]. Actual:[{2}]. {0}",
-                    message, notExpected, actual);
-
-                Assert.HandleFail("Assert.AreNotEqual", finalMessage);
-            }
-        }
-
-        /// <summary>
-        /// Tests whether the expected object is equal to the actual object  and 
-        /// throws an exception if it is not.
-        /// </summary>
-        /// <param name="notExpected">Expected object that we do not want it to be.</param>
-        /// <param name="actual">Actual object.</param>
-        /// <param name="message">Message to display upon failure.</param>
-        public static void AreNotEqual<T>(T notExpected, T actual, string format, params Object[] args)
-        {
-            AreNotEqual<T>(notExpected, actual, String.Format(format, args));
-        }
-
-        /// <summary>
-        /// Tests whether the two lists are the same length and contain the same objects (using Object.Equals()) in the same order and
-        /// throws an exception if it is not.
-        /// </summary>
-        /// <param name="expected">Expected list.</param>
-        /// <param name="actual">Actual list.</param>
-        /// <param name="message">Message to display upon failure.</param>
-        public static void AreAllEqual<T>(T[] expected, T[] actual, string message = "")
-        {
-            Assert.AreEqual(expected.Length, actual.Length, message);
-
-            for (int i = 0; i < expected.Length; i++)
-                Assert.AreEqual<T>(expected[i], actual[i], message);
-        }
-
-        /// <summary>
-        /// Tests whether the two lists are the same length and contain the same objects (using Object.Equals()) in the same order and
-        /// throws an exception if it is not.
-        /// </summary>
-        /// <param name="expected">Expected list.</param>
-        /// <param name="actual">Actual list.</param>
-        /// <param name="message">Message to display upon failure.</param>
-        public static void AreAllEqual<T>(T[] expected, T[] actual, string format, params Object[] args)
-        {
-            AreAllEqual<T>(expected, actual, String.Format(format, args));
-        }
-
-        /// <summary>
-        /// Tests whether the two lists are the same length and contain the same objects (using Object.Equals()) (but not necessarily in the same order) and
-        /// throws an exception if it is not.
-        /// </summary>
-        /// <param name="expected">Expected list.</param>
-        /// <param name="actual">Actual list.</param>
-        /// <param name="message">Message to display upon failure.</param>
-        public static void AreAllEqualUnordered<T>(T[] expected, T[] actual)
-        {
-            Assert.AreEqual(expected.Length, actual.Length);
-
-            int count = expected.Length;
-            bool[] removedFromActual = new bool[count];
-            for (int i = 0; i < count; i++)
-            {
-                T item1 = expected[i];
-                bool foundMatch = false;
-                for (int j = 0; j < count; j++)
-                {
-                    if (!removedFromActual[j])
-                    {
-                        T item2 = actual[j];
-                        if ((item1 == null && item2 == null) || (item1 != null && item1.Equals(item2)))
-                        {
-                            foundMatch = true;
-                            removedFromActual[j] = true;
-                            break;
-                        }
-                    }
-                }
-                if (!foundMatch)
-                    Assert.HandleFail("Assert.AreAllEqualUnordered", "First array has element not found in second array: " + item1);
-            }
-            return;
-        }
-
-        /// <summary>
-        /// Tests whether the two enumerables are the same length and contain the same objects (using Object.Equals()) in the same order and
-        /// throws an exception if it is not.
-        /// </summary>
-        /// <param name="expected">Expected enumerables.</param>
-        /// <param name="actual">Actual enumerables.</param>
-        /// <param name="message">Message to display upon failure.</param>
-        public static void AreAllEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual, string message = "")
-        {
-            AreAllEqual(CopyToArray(expected), CopyToArray(actual), message);
-        }
-
-        /// <summary>
-        /// Tests whether the two enumerables are the same length and contain the same objects (using Object.Equals()) (but not necessarily 
-        /// in the same order) and throws an exception if it is not.
-        /// </summary>
-        /// <param name="expected">Expected enumerable.</param>
-        /// <param name="actual">Actual enumerable.</param>
-        /// <param name="message">Message to display upon failure.</param>
-        public static void AreAllEqualUnordered<T>(IEnumerable<T> expected, IEnumerable<T> actual, string message = "")
-        {
-            AreAllEqualUnordered(CopyToArray(expected), CopyToArray(actual), message);
-        }
-
-        /// <summary>
-        /// Iterates through an IEnumerable to generate an array of elements. The rational for using this instead of 
-        /// System.Linq.ToArray is that this will not require a dependency on System.Linq.dll
-        /// </summary>
-        private static T[] CopyToArray<T>(IEnumerable<T> source)
-        {
-            T[] items = new T[4];
-            int count = 0;
-
-            if (source == null)
-                return null;
-
-            foreach (var item in source)
-            {
-                if (items.Length == count)
-                {
-                    var newItems = new T[checked(count * 2)];
-                    Array.Copy(items, 0, newItems, 0, count);
-                    items = newItems;
-                }
-
-                items[count] = item;
-                count++;
-            }
-
-            if (items.Length == count)
-                return items;
-
-            var finalItems = new T[count];
-            Array.Copy(items, 0, finalItems, 0, count);
-            return finalItems;
-        }
-
-
-        /// <summary>
-        /// Tests whether the specified objects both refer to the same object and
-        /// throws an exception if the two inputs do not refer to the same object.
-        /// </summary>
-        /// <param name="expected">
-        /// The first object to compare. This is the value the test expects.
-        /// </param>
-        /// <param name="actual">
-        /// The second object to compare. This is the value produced by the code under test.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="expected"/> does not refer to the same object
-        /// as <paramref name="actual"/>.
-        /// </exception>
-        static public void AreSame(object expected, object actual)
-        {
-            Assert.AreSame(expected, actual, string.Empty);
-        }
-
-        /// <summary>
-        /// Tests whether the specified objects both refer to the same object and
-        /// throws an exception if the two inputs do not refer to the same object.
-        /// </summary>
-        /// <param name="expected">
-        /// The first object to compare. This is the value the test expects.
-        /// </param>
-        /// <param name="actual">
-        /// The second object to compare. This is the value produced by the code under test.
-        /// </param>
-        /// <param name="message">
-        /// The message to include in the exception when <paramref name="actual"/>
-        /// is not the same as <paramref name="expected"/>. The message is shown
-        /// in test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="expected"/> does not refer to the same object
-        /// as <paramref name="actual"/>.
-        /// </exception>
-        static public void AreSame(object expected, object actual, string message)
-        {
-            if (!Object.ReferenceEquals(expected, actual))
-            {
-                string finalMessage = message;
-
-                ValueType valExpected = expected as ValueType;
-                if (valExpected != null)
-                {
-                    ValueType valActual = actual as ValueType;
-                    if (valActual != null)
-                    {
-                        finalMessage = message == null ? String.Empty : message;
-                    }
-                }
-
-                Assert.HandleFail("Assert.AreSame", finalMessage);
-            }
-        }
-
-        /// <summary>
-        /// Tests whether the specified objects refer to different objects and
-        /// throws an exception if the two inputs refer to the same object.
-        /// </summary>
-        /// <param name="notExpected">
-        /// The first object to compare. This is the value the test expects not
-        /// to match <paramref name="actual"/>.
-        /// </param>
-        /// <param name="actual">
-        /// The second object to compare. This is the value produced by the code under test.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="notExpected"/> refers to the same object
-        /// as <paramref name="actual"/>.
-        /// </exception>
-        static public void AreNotSame(object notExpected, object actual)
-        {
-            Assert.AreNotSame(notExpected, actual, string.Empty);
-        }
-
-        /// <summary>
-        /// Tests whether the specified objects refer to different objects and
-        /// throws an exception if the two inputs refer to the same object.
-        /// </summary>
-        /// <param name="notExpected">
-        /// The first object to compare. This is the value the test expects not
-        /// to match <paramref name="actual"/>.
-        /// </param>
-        /// <param name="actual">
-        /// The second object to compare. This is the value produced by the code under test.
-        /// </param>
-        /// <param name="message">
-        /// The message to include in the exception when <paramref name="actual"/>
-        /// is the same as <paramref name="notExpected"/>. The message is shown in
-        /// test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Thrown if <paramref name="notExpected"/> refers to the same object
-        /// as <paramref name="actual"/>.
-        /// </exception>
-        static public void AreNotSame(object notExpected, object actual, string message)
-        {
-            if (Object.ReferenceEquals(notExpected, actual))
-            {
-                Assert.HandleFail("Assert.AreNotSame", message);
-            }
-        }
-
-        static public void OfType<T>(object obj)
-        {
-            if (!(obj is T))
-            {
-                Assert.HandleFail(
-                    "Assert.IsOfType",
-                    $"Expected an object of type [{typeof(T).AssemblyQualifiedName}], got type of type [{obj.GetType().AssemblyQualifiedName}].");
-            }
-        }
-
-        /// <summary>
-        /// Throws an AssertFailedException.
-        /// </summary>
-        /// <exception cref="AssertFailedException">
-        /// Always thrown.
-        /// </exception>
-        public static void Fail()
-        {
-            Assert.HandleFail("Assert.Fail", "");
-        }
-
-        /// <summary>
-        /// Throws an AssertFailedException.
-        /// </summary>
-        /// <param name="message">
-        /// The message to include in the exception. The message is shown in
-        /// test results.
-        /// </param>
-        /// <exception cref="AssertFailedException">
-        /// Always thrown.
-        /// </exception>
-        public static void Fail(string message, params object[] args)
-        {
-            string exceptionMessage = args.Length == 0 ? message : string.Format(message, args);
-            Assert.HandleFail("Assert.Fail", exceptionMessage);
-        }
-
-        /// <summary>
-        /// Helper function that creates and throws an exception.
-        /// </summary>
-        /// <param name="assertionName">name of the assertion throwing an exception.</param>
-        /// <param name="message">message describing conditions for assertion failure.</param>
-        /// <param name="parameters">The parameters.</param>
-        /// TODO: Modify HandleFail to take in parameters
-        internal static void HandleFail(string assertionName, string message)
-        {
-            // change this to use AssertFailedException             
-            throw new AssertTestException(assertionName + ": " + message);
-        }
-
-
-        [Obsolete("Did you mean to call Assert.AreEqual()")]
-        public static new bool Equals(Object o1, Object o2)
-        {
-            Assert.Fail("Don\u2019t call this.");
-            throw new Exception();
-        }
-
-        private static bool IsOfExceptionType<T>(Exception thrown, AssertThrowsOptions options)
-        {
-            if ((options & AssertThrowsOptions.AllowDerived) == AssertThrowsOptions.AllowDerived)
-                return thrown is T;
-
-            return thrown.GetType() == typeof(T);
-        }
-
-        private static Exception RunWithCatch(Action action)
-        {
-            try
-            {
-                action();
-                return null;
-            }
-            catch (Exception ex)
-            {
-                return ex;
-            }
-        }
-
-        private static async Task<Exception> RunWithCatchAsync(Func<Task> action)
-        {
-            try
-            {
-                await action();
-                return null;
-            }
-            catch (Exception ex)
-            {
-                return ex;
-            }
-        }
-    }
-
-    /// <summary>
-    /// Exception raised by the Assert on Fail
-    /// </summary>
-    public class AssertTestException : Exception
-    {
-        public AssertTestException(string message)
-            : base(message)
-        {
-        }
-
-        public AssertTestException()
-            : base()
-        {
-        }
-    }
-
-    public static class ExceptionAssert
-    {
-        public static void Throws<T>(String message, Action a) where T : Exception
-        {
-            Assert.Throws<T>(a, message);
-        }
-    }
-
-    /// <summary>
-    ///     Specifies whether <see cref="Assert.Throws{T}"/> should require an exact type match when comparing the expected exception type with the thrown exception.
-    /// </summary>
-    [Flags]
-    public enum AssertThrowsOptions
-    {
-        /// <summary>
-        ///     Specifies that <see cref="Assert.Throws{T}"/> should require an exact type 
-        ///     match when comparing the specified exception type with the throw exception.
-        /// </summary>
-        None = 0,
-
-        /// <summary>
-        ///     Specifies that <see cref="Assert.Throws{T}"/> should not require an exact type 
-        ///     match when comparing the specified exception type with the thrown exception.
-        /// </summary>
-        AllowDerived = 1,
-    }
-}
index bcf8a15..ec3c669 100644 (file)
@@ -8,7 +8,7 @@
     <TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
   </PropertyGroup>
   <ItemGroup>
-    <Compile Include="Assertion.cs" />
+    <Compile Include="AssertExtensions.cs" />
     <Compile Include="Generator.cs" />
     <Compile Include="Logging.cs" />
     <Compile Include="TestFramework.cs" />
@@ -17,4 +17,7 @@
     <Compile Include="XPlatformUtils.cs" />
   </ItemGroup>
 
+  <ItemGroup>
+    <PackageReference Include="xunit" Version="$(XUnitVersion)" ExcludeAssets="runtime" />
+  </ItemGroup>
 </Project>
index bd1eb1b..a7917eb 100644 (file)
@@ -13,6 +13,7 @@ using System.Runtime.Loader;
 using System.Security;
 using System.Text;
 using System.Threading;
+using Xunit;
 
 namespace TestLibrary
 {
@@ -205,7 +206,7 @@ namespace TestLibrary
                 return 0;
             }
 
-            Assert.AreEqual(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi));
+            Assert.Equal(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi));
             return osvi.dwMajorVersion;
         }
         internal static uint GetWindowsMinorVersion()
@@ -215,7 +216,7 @@ namespace TestLibrary
                 return 0;
             }
 
-            Assert.AreEqual(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi));
+            Assert.Equal(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi));
             return osvi.dwMinorVersion;
         }
         internal static uint GetWindowsBuildNumber()
@@ -225,7 +226,7 @@ namespace TestLibrary
                 return 0;
             }
 
-            Assert.AreEqual(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi));
+            Assert.Equal(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi));
             return osvi.dwBuildNumber;
         }
 
index 26c8ae6..9409873 100644 (file)
     <Output TaskParameter="TargetOutputs" ItemName="Reference" />
    </MSBuild>
 
-    <ItemGroup>
+    <ItemGroup Condition="'$(ReferenceSystemPrivateCoreLib)' != 'true'">
       <Reference Include="$(TargetingPackPath)/*.dll" >
         <Private>false</Private>
       </Reference>
index 03335e4..57e26d9 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Linq;
 using System.Threading;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 #pragma warning disable CS0612, CS0618
 
@@ -17,29 +17,29 @@ public class Tester
         {
             var boolArray = new bool[] { true, false, true, false, false, true };
             SafeArrayNative.XorBoolArray(boolArray, out var xorResult);
-            Assert.AreEqual(XorArray(boolArray), xorResult);
+            Assert.Equal(XorArray(boolArray), xorResult);
 
             var decimalArray = new decimal[] { 1.5M, 30.2M, 6432M, 12.5832M };
             SafeArrayNative.MeanDecimalArray(decimalArray, out var meanDecimalValue);
-            Assert.AreEqual(decimalArray.Average(), meanDecimalValue);
+            Assert.Equal(decimalArray.Average(), meanDecimalValue);
 
             SafeArrayNative.SumCurrencyArray(decimalArray, out var sumCurrencyValue);
-            Assert.AreEqual(decimalArray.Sum(), sumCurrencyValue);
+            Assert.Equal(decimalArray.Sum(), sumCurrencyValue);
 
             var strings = new [] {"ABCDE", "12345", "Microsoft"};
             var reversedStrings = strings.Select(str => Reverse(str)).ToArray();
 
             var ansiTest = strings.ToArray();
             SafeArrayNative.ReverseStringsAnsi(ansiTest);
-            Assert.AreAllEqual(reversedStrings, ansiTest);
+            AssertExtensions.CollectionEqual(reversedStrings, ansiTest);
 
             var unicodeTest = strings.ToArray();
             SafeArrayNative.ReverseStringsUnicode(unicodeTest);
-            Assert.AreAllEqual(reversedStrings, unicodeTest);
+            AssertExtensions.CollectionEqual(reversedStrings, unicodeTest);
 
             var bstrTest = strings.ToArray();
             SafeArrayNative.ReverseStringsBSTR(bstrTest);
-            Assert.AreAllEqual(reversedStrings, bstrTest);
+            AssertExtensions.CollectionEqual(reversedStrings, bstrTest);
 
             var blittableRecords = new SafeArrayNative.BlittableRecord[]
             {
@@ -50,23 +50,23 @@ public class Tester
                 new SafeArrayNative.BlittableRecord { a = 9 },
                 new SafeArrayNative.BlittableRecord { a = 15 },
             };
-            Assert.AreAllEqual(blittableRecords, SafeArrayNative.CreateSafeArrayOfRecords(blittableRecords));
+            AssertExtensions.CollectionEqual(blittableRecords, SafeArrayNative.CreateSafeArrayOfRecords(blittableRecords));
 
             var nonBlittableRecords = boolArray.Select(b => new SafeArrayNative.NonBlittableRecord{ b = b }).ToArray();
-            Assert.AreAllEqual(nonBlittableRecords, SafeArrayNative.CreateSafeArrayOfRecords(nonBlittableRecords));
+            AssertExtensions.CollectionEqual(nonBlittableRecords, SafeArrayNative.CreateSafeArrayOfRecords(nonBlittableRecords));
 
             var objects = new object[] { new object(), new object(), new object() };
             SafeArrayNative.VerifyIUnknownArray(objects);
             SafeArrayNative.VerifyIDispatchArray(objects);
 
             var variantInts = new object[] {1, 2, 3, 4, 5, 6, 7, 8, 9};
-            
+
             SafeArrayNative.MeanVariantIntArray(variantInts, out var variantMean);
-            Assert.AreEqual(variantInts.OfType<int>().Average(), variantMean);
+            Assert.Equal(variantInts.OfType<int>().Average(), variantMean);
 
             var dates = new DateTime[] { new DateTime(2008, 5, 1), new DateTime(2010, 1, 1) };
             SafeArrayNative.DistanceBetweenDates(dates, out var numDays);
-            Assert.AreEqual((dates[1] - dates[0]).TotalDays, numDays);
+            Assert.Equal((dates[1] - dates[0]).TotalDays, numDays);
 
             SafeArrayNative.XorBoolArrayInStruct(
                 new SafeArrayNative.StructWithSafeArray
@@ -75,7 +75,7 @@ public class Tester
                 },
                 out var structXor);
 
-            Assert.AreEqual(XorArray(boolArray), structXor);
+            Assert.Equal(XorArray(boolArray), structXor);
         }
         catch (Exception e)
         {
index 04049e7..b16802d 100644 (file)
@@ -10,6 +10,7 @@ namespace Activator
     using System.Runtime.InteropServices;
 
     using TestLibrary;
+    using Xunit;
 
     using Console = Internal.Console;
 
@@ -28,8 +29,7 @@ namespace Activator
                         InterfaceId = notIClassFactory
                     };
                     ComActivator.GetClassFactoryForType(cxt);
-                },
-                "Non-IClassFactory request should fail");
+                });
         }
 
         static void NonrootedAssemblyPath(bool builtInComDisabled)
@@ -48,11 +48,11 @@ namespace Activator
 
             if (!builtInComDisabled)
             {
-                Assert.Throws<ArgumentException>(action, "Non-root assembly path should not be valid");
+                Assert.Throws<ArgumentException>(action);
             }
             else
             {
-                Assert.Throws<NotSupportedException>(action, "Built-in COM has been disabled via a feature switch");
+                Assert.Throws<NotSupportedException>(action);
             }
         }
 
@@ -74,13 +74,13 @@ namespace Activator
 
             if (!builtInComDisabled)
             {
-                COMException e = Assert.Throws<COMException>(action, "Class should not be found");
+                COMException e = Assert.Throws<COMException>(action);
                 const int CLASS_E_CLASSNOTAVAILABLE = unchecked((int)0x80040111);
-                Assert.AreEqual(CLASS_E_CLASSNOTAVAILABLE, e.HResult, "Unexpected HRESULT");
+                Assert.Equal(CLASS_E_CLASSNOTAVAILABLE, e.HResult);
             }
             else
             {
-                Assert.Throws<NotSupportedException>(action, "Built-in COM has been disabled via a feature switch");
+                Assert.Throws<NotSupportedException>(action);
             }
         }
 
@@ -119,7 +119,7 @@ namespace Activator
                 if (builtInComDisabled)
                 {
                     Assert.Throws<NotSupportedException>(
-                        () => ComActivator.GetClassFactoryForType(cxt), "Built-in COM has been disabled via a feature switch");
+                        () => ComActivator.GetClassFactoryForType(cxt));
                     return;
                 }
 
@@ -156,7 +156,7 @@ namespace Activator
                 typeCFromAssemblyB = (Type)svr.GetTypeFromC();
             }
 
-            Assert.AreNotEqual(typeCFromAssemblyA, typeCFromAssemblyB, "Types should be from different AssemblyLoadContexts");
+            Assert.NotEqual(typeCFromAssemblyA, typeCFromAssemblyB);
         }
 
         static void ValidateUserDefinedRegistrationCallbacks()
@@ -208,15 +208,15 @@ namespace Activator
                     Marshal.Release(svrRaw);
 
                     var inst = (IValidateRegistrationCallbacks)svr;
-                    Assert.IsFalse(inst.DidRegister());
-                    Assert.IsFalse(inst.DidUnregister());
+                    Assert.False(inst.DidRegister());
+                    Assert.False(inst.DidUnregister());
 
                     cxt.InterfaceId = Guid.Empty;
                     ComActivator.ClassRegistrationScenarioForType(cxt, register: true);
                     ComActivator.ClassRegistrationScenarioForType(cxt, register: false);
 
-                    Assert.IsTrue(inst.DidRegister(), $"User-defined register function should have been called.");
-                    Assert.IsTrue(inst.DidUnregister(), $"User-defined unregister function should have been called.");
+                    Assert.True(inst.DidRegister(), $"User-defined register function should have been called.");
+                    Assert.True(inst.DidUnregister(), $"User-defined unregister function should have been called.");
                 }
             }
 
@@ -258,7 +258,7 @@ namespace Activator
                         exceptionThrown = true;
                     }
 
-                    Assert.IsTrue(exceptionThrown || !inst.DidRegister());
+                    Assert.True(exceptionThrown || !inst.DidRegister());
 
                     exceptionThrown = false;
                     try
@@ -270,7 +270,7 @@ namespace Activator
                         exceptionThrown = true;
                     }
 
-                    Assert.IsTrue(exceptionThrown || !inst.DidUnregister());
+                    Assert.True(exceptionThrown || !inst.DidUnregister());
                 }
             }
         }
index 98f09ac..99a2094 100644 (file)
@@ -10,7 +10,7 @@ namespace ComWrappersTests
     using System.Runtime.InteropServices;
 
     using ComWrappersTests.Common;
-    using TestLibrary;
+    using Xunit;
 
     class Program
     {
@@ -54,7 +54,7 @@ namespace ComWrappersTests
                 var iid = typeof(ITrackerObject).GUID;
                 IntPtr iTrackerComObject;
                 int hr = Marshal.QueryInterface(externalComObject, ref iid, out iTrackerComObject);
-                Assert.AreEqual(0, hr);
+                Assert.Equal(0, hr);
 
                 return new ITrackerObjectWrapper(iTrackerComObject);
             }
@@ -72,9 +72,9 @@ namespace ComWrappersTests
 
                 ComWrappers.GetIUnknownImpl(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease);
 
-                Assert.AreNotEqual(fpQueryInterface, IntPtr.Zero);
-                Assert.AreNotEqual(fpAddRef, IntPtr.Zero);
-                Assert.AreNotEqual(fpRelease, IntPtr.Zero);
+                Assert.NotEqual(fpQueryInterface, IntPtr.Zero);
+                Assert.NotEqual(fpAddRef, IntPtr.Zero);
+                Assert.NotEqual(fpRelease, IntPtr.Zero);
             }
         }
 
@@ -100,27 +100,27 @@ namespace ComWrappersTests
 
             // Allocate a wrapper for the object
             IntPtr comWrapper = wrappers.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport);
-            Assert.AreNotEqual(IntPtr.Zero, comWrapper);
+            Assert.NotEqual(IntPtr.Zero, comWrapper);
 
             // Get a wrapper for an object and verify it is the same one.
             IntPtr comWrapperMaybe = wrappers.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport);
-            Assert.AreEqual(comWrapper, comWrapperMaybe);
+            Assert.Equal(comWrapper, comWrapperMaybe);
 
             // Release the wrapper
             int count = Marshal.Release(comWrapper);
-            Assert.AreEqual(1, count);
+            Assert.Equal(1, count);
             count = Marshal.Release(comWrapperMaybe);
-            Assert.AreEqual(0, count);
+            Assert.Equal(0, count);
 
             // Create a new wrapper
             IntPtr comWrapperNew = wrappers.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport);
 
             // Once a wrapper is created for a managed object it is always present
-            Assert.AreEqual(comWrapperNew, comWrapper);
+            Assert.Equal(comWrapperNew, comWrapper);
 
             // Release the new wrapper
             count = Marshal.Release(comWrapperNew);
-            Assert.AreEqual(0, count);
+            Assert.Equal(0, count);
         }
 
         static void ValidateComInterfaceCreationRoundTrip()
@@ -133,14 +133,14 @@ namespace ComWrappersTests
 
             // Allocate a wrapper for the object
             IntPtr comWrapper = wrappers.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.None);
-            Assert.AreNotEqual(IntPtr.Zero, comWrapper);
+            Assert.NotEqual(IntPtr.Zero, comWrapper);
 
             var testObjUnwrapped = wrappers.GetOrCreateObjectForComInstance(comWrapper, CreateObjectFlags.Unwrap);
-            Assert.AreEqual(testObj, testObjUnwrapped);
+            Assert.Equal(testObj, testObjUnwrapped);
 
             // Release the wrapper
             int count = Marshal.Release(comWrapper);
-            Assert.AreEqual(0, count);
+            Assert.Equal(0, count);
         }
 
         static void ValidateFallbackQueryInterface()
@@ -163,17 +163,17 @@ namespace ComWrappersTests
             var anyGuid = new Guid("1E42439C-DCB5-4701-ACBD-87FE92E785DE");
             testObj.ICustomQueryInterface_GetInterfaceIID = anyGuid;
             int hr = Marshal.QueryInterface(comWrapper, ref anyGuid, out result);
-            Assert.AreEqual(0, hr);
-            Assert.AreEqual(testObj.ICustomQueryInterface_GetInterfaceResult, result);
+            Assert.Equal(0, hr);
+            Assert.Equal(testObj.ICustomQueryInterface_GetInterfaceResult, result);
 
             var anyGuid2 = new Guid("7996D0F9-C8DD-4544-B708-0F75C6FF076F");
             hr = Marshal.QueryInterface(comWrapper, ref anyGuid2, out result);
             const int E_NOINTERFACE = unchecked((int)0x80004002);
-            Assert.AreEqual(E_NOINTERFACE, hr);
-            Assert.AreEqual(IntPtr.Zero, result);
+            Assert.Equal(E_NOINTERFACE, hr);
+            Assert.Equal(IntPtr.Zero, result);
 
             int count = Marshal.Release(comWrapper);
-            Assert.AreEqual(0, count);
+            Assert.Equal(0, count);
         }
 
         static void ValidateCreateObjectCachingScenario()
@@ -187,13 +187,13 @@ namespace ComWrappersTests
 
             var trackerObj1 = (ITrackerObjectWrapper)cw.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject);
             var trackerObj2 = (ITrackerObjectWrapper)cw.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject);
-            Assert.AreEqual(trackerObj1, trackerObj2);
+            Assert.Equal(trackerObj1, trackerObj2);
 
             // Ownership has been transferred to the wrapper.
             Marshal.Release(trackerObjRaw);
 
             var trackerObj3 = (ITrackerObjectWrapper)cw.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject | CreateObjectFlags.UniqueInstance);
-            Assert.AreNotEqual(trackerObj1, trackerObj3);
+            Assert.NotEqual(trackerObj1, trackerObj3);
         }
 
         static void ValidateWrappersInstanceIsolation()
@@ -208,15 +208,15 @@ namespace ComWrappersTests
             // Allocate a wrapper for the object
             IntPtr comWrapper1 = cw1.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport);
             IntPtr comWrapper2 = cw2.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport);
-            Assert.AreNotEqual(comWrapper1, IntPtr.Zero);
-            Assert.AreNotEqual(comWrapper2, IntPtr.Zero);
-            Assert.AreNotEqual(comWrapper1, comWrapper2);
+            Assert.NotEqual(comWrapper1, IntPtr.Zero);
+            Assert.NotEqual(comWrapper2, IntPtr.Zero);
+            Assert.NotEqual(comWrapper1, comWrapper2);
 
             IntPtr comWrapper3 = cw1.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport);
             IntPtr comWrapper4 = cw2.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport);
-            Assert.AreNotEqual(comWrapper3, comWrapper4);
-            Assert.AreEqual(comWrapper1, comWrapper3);
-            Assert.AreEqual(comWrapper2, comWrapper4);
+            Assert.NotEqual(comWrapper3, comWrapper4);
+            Assert.Equal(comWrapper1, comWrapper3);
+            Assert.Equal(comWrapper2, comWrapper4);
 
             Marshal.Release(comWrapper1);
             Marshal.Release(comWrapper2);
@@ -229,13 +229,13 @@ namespace ComWrappersTests
             // Create objects for the COM instance
             var trackerObj1 = (ITrackerObjectWrapper)cw1.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject);
             var trackerObj2 = (ITrackerObjectWrapper)cw2.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject);
-            Assert.AreNotEqual(trackerObj1, trackerObj2);
+            Assert.NotEqual(trackerObj1, trackerObj2);
 
             var trackerObj3 = (ITrackerObjectWrapper)cw1.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject);
             var trackerObj4 = (ITrackerObjectWrapper)cw2.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject);
-            Assert.AreNotEqual(trackerObj3, trackerObj4);
-            Assert.AreEqual(trackerObj1, trackerObj3);
-            Assert.AreEqual(trackerObj2, trackerObj4);
+            Assert.NotEqual(trackerObj3, trackerObj4);
+            Assert.Equal(trackerObj1, trackerObj3);
+            Assert.Equal(trackerObj2, trackerObj4);
 
             Marshal.Release(trackerObjRaw);
         }
@@ -253,12 +253,12 @@ namespace ComWrappersTests
             var iid = typeof(ITrackerObject).GUID;
             IntPtr iTestComObject;
             int hr = Marshal.QueryInterface(trackerObjRaw, ref iid, out iTestComObject);
-            Assert.AreEqual(0, hr);
+            Assert.Equal(0, hr);
             var nativeWrapper = new ITrackerObjectWrapper(iTestComObject);
 
             // Register wrapper, but supply the wrapper.
             var nativeWrapper2 = (ITrackerObjectWrapper)cw.GetOrRegisterObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject, nativeWrapper);
-            Assert.AreEqual(nativeWrapper, nativeWrapper2);
+            Assert.Equal(nativeWrapper, nativeWrapper2);
 
             // Ownership has been transferred to the wrapper.
             Marshal.Release(trackerObjRaw);
@@ -300,12 +300,12 @@ namespace ComWrappersTests
 
             // We are using a tracking resurrection WeakReference<T> so we should be able
             // to get back the objects as they are all continually re-registering for Finalization.
-            Assert.IsTrue(weakRef1.TryGetTarget(out ITrackerObjectWrapper wrapper1));
-            Assert.IsTrue(weakRef2.TryGetTarget(out ITrackerObjectWrapper wrapper2));
+            Assert.True(weakRef1.TryGetTarget(out ITrackerObjectWrapper wrapper1));
+            Assert.True(weakRef2.TryGetTarget(out ITrackerObjectWrapper wrapper2));
 
             // Check that the two wrappers aren't equal, meaning we created a new wrapper since
             // the first wrapper was removed from the internal cache.
-            Assert.AreNotEqual(wrapper1, wrapper2);
+            Assert.NotEqual(wrapper1, wrapper2);
 
             // Let the wrappers Finalize.
             wrapper1.ReregisterForFinalize = false;
@@ -317,7 +317,7 @@ namespace ComWrappersTests
                 var iid = typeof(ITrackerObject).GUID;
                 IntPtr iTestComObject;
                 int hr = Marshal.QueryInterface(trackerObjRaw, ref iid, out iTestComObject);
-                Assert.AreEqual(0, hr);
+                Assert.Equal(0, hr);
                 var nativeWrapper = new ITrackerObjectWrapper(iTestComObject);
 
                 nativeWrapper = (ITrackerObjectWrapper)cw.GetOrRegisterObjectForComInstance(trackerObjRaw, CreateObjectFlags.None, nativeWrapper);
@@ -375,7 +375,7 @@ namespace ComWrappersTests
                     case FailureMode.ThrowException:
                         throw new Exception() { HResult = ExceptionErrorCode };
                     default:
-                        Assert.Fail("Invalid failure mode");
+                        Assert.True(false, "Invalid failure mode");
                         throw new Exception("UNREACHABLE");
                 }
             }
@@ -389,7 +389,7 @@ namespace ComWrappersTests
                     case FailureMode.ThrowException:
                         throw new Exception() { HResult = ExceptionErrorCode };
                     default:
-                        Assert.Fail("Invalid failure mode");
+                        Assert.True(false, "Invalid failure mode");
                         throw new Exception("UNREACHABLE");
                 }
             }
@@ -420,7 +420,7 @@ namespace ComWrappersTests
             }
             catch (Exception e)
             {
-                Assert.AreEqual(BadComWrappers.ExceptionErrorCode, e.HResult);
+                Assert.Equal(BadComWrappers.ExceptionErrorCode, e.HResult);
             }
 
             IntPtr trackerObjRaw = MockReferenceTrackerRuntime.CreateTrackerObject();
@@ -439,7 +439,7 @@ namespace ComWrappersTests
             }
             catch (Exception e)
             {
-                Assert.AreEqual(BadComWrappers.ExceptionErrorCode, e.HResult);
+                Assert.Equal(BadComWrappers.ExceptionErrorCode, e.HResult);
             }
 
             Marshal.Release(trackerObjRaw);
@@ -475,11 +475,11 @@ namespace ComWrappersTests
                 Marshal.Release(testWrapper);
             }
 
-            Assert.IsTrue(testWrapperIds.Count <= Test.InstanceCount);
+            Assert.True(testWrapperIds.Count <= Test.InstanceCount);
 
             ForceGC();
 
-            Assert.IsTrue(testWrapperIds.Count <= Test.InstanceCount);
+            Assert.True(testWrapperIds.Count <= Test.InstanceCount);
 
             // Remove the managed object ref from the native object.
             foreach (int id in testWrapperIds)
@@ -518,7 +518,7 @@ namespace ComWrappersTests
                 // The COM reference count should be 0 and indicates to the GC the managed object
                 // can be collected.
                 refCount = Marshal.Release(testWrapper);
-                Assert.AreEqual(0, refCount);
+                Assert.Equal(0, refCount);
             }
 
             ForceGC();
@@ -532,11 +532,11 @@ namespace ComWrappersTests
             int hr = Marshal.QueryInterface(refTrackerTarget, ref iid, out iTestComObject);
 
             const int COR_E_ACCESSING_CCW = unchecked((int)0x80131544);
-            Assert.AreEqual(COR_E_ACCESSING_CCW, hr);
+            Assert.Equal(COR_E_ACCESSING_CCW, hr);
 
             // Release the IReferenceTrackerTarget instance.
             refCount = MockReferenceTrackerRuntime.TrackerTarget_ReleaseFromReferenceTracker(refTrackerTarget);
-            Assert.AreEqual(0, refCount);
+            Assert.Equal(0, refCount);
 
             static IntPtr CreateWrapper(TestComWrappers cw)
             {
@@ -582,8 +582,8 @@ namespace ComWrappersTests
             ForceGC();
 
             // Validate all instances were cleaned up
-            Assert.IsFalse(weakRef.TryGetTarget(out _));
-            Assert.AreEqual(0, allocTracker.GetCount());
+            Assert.False(weakRef.TryGetTarget(out _));
+            Assert.Equal(0, allocTracker.GetCount());
         }
 
         static void ValidateAggregationWithReferenceTrackerObject()
@@ -597,13 +597,13 @@ namespace ComWrappersTests
             ForceGC();
 
             // Validate all instances were cleaned up.
-            Assert.IsFalse(weakRef.TryGetTarget(out _));
+            Assert.False(weakRef.TryGetTarget(out _));
 
             // Reference counter cleanup requires additional GCs since the Finalizer is used
             // to clean up the Reference Tracker runtime references.
             ForceGC();
 
-            Assert.AreEqual(0, allocTracker.GetCount());
+            Assert.Equal(0, allocTracker.GetCount());
         }
 
         static int Main(string[] doNotUse)
index 1738dbc..bef5f13 100644 (file)
@@ -7,6 +7,7 @@ namespace ComWrappersTests.GlobalInstance
 
     using ComWrappersTests.Common;
     using TestLibrary;
+    using Xunit;
 
     partial class Program
     {
@@ -15,7 +16,7 @@ namespace ComWrappersTests.GlobalInstance
             Console.WriteLine($"Running {nameof(ValidateNotRegisteredForTrackerSupport)}...");
 
             int hr = MockReferenceTrackerRuntime.Trigger_NotifyEndOfReferenceTrackingOnThread();
-            Assert.AreNotEqual(GlobalComWrappers.ReleaseObjectsCallAck, hr);
+            Assert.NotEqual(GlobalComWrappers.ReleaseObjectsCallAck, hr);
         }
 
         static int Main(string[] doNotUse)
index dd8ea4f..f1f45b2 100644 (file)
@@ -8,6 +8,7 @@ namespace ComWrappersTests.GlobalInstance
 
     using ComWrappersTests.Common;
     using TestLibrary;
+    using Xunit;
 
     partial class Program
     {
@@ -17,11 +18,11 @@ namespace ComWrappersTests.GlobalInstance
 
             var testObj = new Test();
             IntPtr comWrapper1 = Marshal.GetIUnknownForObject(testObj);
-            Assert.IsNull(GlobalComWrappers.Instance.LastComputeVtablesObject, "ComWrappers instance should not have been called");
+            Assert.Null(GlobalComWrappers.Instance.LastComputeVtablesObject);
 
             IntPtr trackerObjRaw = MockReferenceTrackerRuntime.CreateTrackerObject();
             object objWrapper = Marshal.GetObjectForIUnknown(trackerObjRaw);
-            Assert.IsFalse(objWrapper is FakeWrapper, $"ComWrappers instance should not have been called");
+            Assert.False(objWrapper is FakeWrapper, $"ComWrappers instance should not have been called");
         }
 
         static int Main(string[] doNotUse)
index 38c2532..d07a0ad 100644 (file)
@@ -10,6 +10,7 @@ namespace ComWrappersTests.GlobalInstance
 
     using ComWrappersTests.Common;
     using TestLibrary;
+    using Xunit;
 
     partial class Program
     {
@@ -173,7 +174,7 @@ namespace ComWrappersTests.GlobalInstance
             {
                 foreach (object o in objects)
                 {
-                    Assert.IsNotNull(o);
+                    Assert.NotNull(o);
                 }
 
                 throw new Exception() { HResult = ReleaseObjectsCallAck };
@@ -235,14 +236,14 @@ namespace ComWrappersTests.GlobalInstance
                 () =>
                 {
                     ComWrappers.RegisterForMarshalling(wrappers1);
-                }, "Should not be able to re-register for global ComWrappers");
+                });
 
             var wrappers2 = new GlobalComWrappers();
             Assert.Throws<InvalidOperationException>(
                 () =>
                 {
                     ComWrappers.RegisterForMarshalling(wrappers2);
-                }, "Should not be able to reset for global ComWrappers");
+                });
         }
 
         private static void ValidateRegisterForTrackerSupport()
@@ -255,14 +256,14 @@ namespace ComWrappersTests.GlobalInstance
                 () =>
                 {
                     ComWrappers.RegisterForTrackerSupport(wrappers1);
-                }, "Should not be able to re-register for global ComWrappers");
+                });
 
             var wrappers2 = new GlobalComWrappers();
             Assert.Throws<InvalidOperationException>(
                 () =>
                 {
                     ComWrappers.RegisterForTrackerSupport(wrappers2);
-                }, "Should not be able to reset for global ComWrappers");
+                });
         }
 
         private static void ValidateMarshalAPIs(bool validateUseRegistered)
@@ -277,11 +278,11 @@ namespace ComWrappersTests.GlobalInstance
 
             var testObj = new Test();
             IntPtr comWrapper1 = Marshal.GetIUnknownForObject(testObj);
-            Assert.AreNotEqual(IntPtr.Zero, comWrapper1);
-            Assert.AreEqual(testObj, registeredWrapper.LastComputeVtablesObject, "Registered ComWrappers instance should have been called");
+            Assert.NotEqual(IntPtr.Zero, comWrapper1);
+            Assert.Equal(testObj, registeredWrapper.LastComputeVtablesObject);
 
             IntPtr comWrapper2 = Marshal.GetIUnknownForObject(testObj);
-            Assert.AreEqual(comWrapper1, comWrapper2);
+            Assert.Equal(comWrapper1, comWrapper2);
 
             Marshal.Release(comWrapper1);
             Marshal.Release(comWrapper2);
@@ -294,29 +295,29 @@ namespace ComWrappersTests.GlobalInstance
             {
                 var dispatchObj = new TestEx(IID_IDISPATCH);
                 IntPtr dispatchWrapper = Marshal.GetIDispatchForObject(dispatchObj);
-                Assert.AreNotEqual(IntPtr.Zero, dispatchWrapper);
-                Assert.AreEqual(dispatchObj, registeredWrapper.LastComputeVtablesObject, "Registered ComWrappers instance should have been called");
+                Assert.NotEqual(IntPtr.Zero, dispatchWrapper);
+                Assert.Equal(dispatchObj, registeredWrapper.LastComputeVtablesObject);
 
                 Console.WriteLine($" -- Validate Marshal.GetIDispatchForObject != Marshal.GetIUnknownForObject...");
                 IntPtr unknownWrapper = Marshal.GetIUnknownForObject(dispatchObj);
-                Assert.AreNotEqual(IntPtr.Zero, unknownWrapper);
-                Assert.AreNotEqual(unknownWrapper, dispatchWrapper);
+                Assert.NotEqual(IntPtr.Zero, unknownWrapper);
+                Assert.NotEqual(unknownWrapper, dispatchWrapper);
             }
 
             Console.WriteLine($" -- Validate Marshal.GetObjectForIUnknown...");
 
             IntPtr trackerObjRaw = MockReferenceTrackerRuntime.CreateTrackerObject();
             object objWrapper1 = Marshal.GetObjectForIUnknown(trackerObjRaw);
-            Assert.AreEqual(validateUseRegistered, objWrapper1 is FakeWrapper, $"GetObjectForIUnknown should{(validateUseRegistered ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance");
+            Assert.Equal(validateUseRegistered, objWrapper1 is FakeWrapper);
             object objWrapper2 = Marshal.GetObjectForIUnknown(trackerObjRaw);
-            Assert.AreEqual(objWrapper1, objWrapper2);
+            Assert.Equal(objWrapper1, objWrapper2);
 
             Console.WriteLine($" -- Validate Marshal.GetUniqueObjectForIUnknown...");
 
             object objWrapper3 = Marshal.GetUniqueObjectForIUnknown(trackerObjRaw);
-            Assert.AreEqual(validateUseRegistered, objWrapper3 is FakeWrapper, $"GetObjectForIUnknown should{(validateUseRegistered ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance");
+            Assert.Equal(validateUseRegistered, objWrapper3 is FakeWrapper);
 
-            Assert.AreNotEqual(objWrapper1, objWrapper3);
+            Assert.NotEqual(objWrapper1, objWrapper3);
 
             Marshal.Release(trackerObjRaw);
         }
@@ -331,7 +332,7 @@ namespace ComWrappersTests.GlobalInstance
             Console.WriteLine($" -- Validate MarshalAs IUnknown...");
             ValidateInterfaceMarshaler<object>(MarshalInterface.UpdateTestObjectAsIUnknown, shouldSucceed: validateUseRegistered);
             object obj = MarshalInterface.CreateTrackerObjectAsIUnknown();
-            Assert.AreEqual(validateUseRegistered, obj is FakeWrapper, $"Should{(validateUseRegistered ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance");
+            Assert.Equal(validateUseRegistered, obj is FakeWrapper);
 
             if (validateUseRegistered)
             {
@@ -347,7 +348,7 @@ namespace ComWrappersTests.GlobalInstance
                 Assert.Throws<InvalidCastException>(() => MarshalInterface.CreateTrackerObjectWrongType());
 
                 FakeWrapper wrapper = MarshalInterface.CreateTrackerObjectAsInterface();
-                Assert.IsNotNull(wrapper, $"Should have returned {nameof(FakeWrapper)} instance");
+                Assert.NotNull(wrapper);
             }
         }
 
@@ -362,16 +363,16 @@ namespace ComWrappersTests.GlobalInstance
 
             T retObj;
             int hr = func(testObj as T, value, out retObj);
-            Assert.AreEqual(testObj, GlobalComWrappers.Instance.LastComputeVtablesObject, "Registered ComWrappers instance should have been called");
+            Assert.Equal(testObj, GlobalComWrappers.Instance.LastComputeVtablesObject);
             if (shouldSucceed)
             {
-                Assert.IsTrue(retObj is Test);
-                Assert.AreEqual(value, testObj.GetValue());
-                Assert.AreEqual<object>(testObj, retObj);
+                Assert.True(retObj is Test);
+                Assert.Equal(value, testObj.GetValue());
+                Assert.Equal<object>(testObj, retObj);
             }
             else
             {
-                Assert.AreEqual(E_NOINTERFACE, hr);
+                Assert.Equal(E_NOINTERFACE, hr);
             }
         }
 
@@ -394,11 +395,11 @@ namespace ComWrappersTests.GlobalInstance
 
             Type t= Type.GetTypeFromCLSID(Guid.Parse(Server.Contract.Guids.DispatchTesting));
             var server = Activator.CreateInstance(t);
-            Assert.AreEqual(returnValid, server is FakeWrapper, $"Should{(returnValid ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance");
+            Assert.Equal(returnValid, server is FakeWrapper);
 
             IntPtr ptr = Marshal.GetIUnknownForObject(server);
             var obj = Marshal.GetObjectForIUnknown(ptr);
-            Assert.AreEqual(server, obj);
+            Assert.Equal(server, obj);
         }
 
         private static void ValidateManagedServerActivation()
@@ -414,14 +415,14 @@ namespace ComWrappersTests.GlobalInstance
             {
                 Type t = Type.GetTypeFromCLSID(Guid.Parse(Server.Contract.Guids.ConsumeNETServerTesting));
                 var server = Activator.CreateInstance(t);
-                Assert.AreEqual(returnValid, server is FakeWrapper, $"Should{(returnValid ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance");
+                Assert.Equal(returnValid, server is FakeWrapper);
                 object serverUnwrapped = GlobalComWrappers.Instance.LastComputeVtablesObject;
-                Assert.AreEqual(ManagedServerTypeName, serverUnwrapped.GetType().Name);
+                Assert.Equal(ManagedServerTypeName, serverUnwrapped.GetType().Name);
 
                 IntPtr ptr = Marshal.GetIUnknownForObject(server);
                 var obj = Marshal.GetObjectForIUnknown(ptr);
-                Assert.AreEqual(server, obj);
-                Assert.AreEqual(returnValid, obj is FakeWrapper, $"Should{(returnValid ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance");
+                Assert.Equal(server, obj);
+                Assert.Equal(returnValid, obj is FakeWrapper);
                 serverUnwrapped.GetType().GetMethod("NotEqualByRCW").Invoke(serverUnwrapped, new object[] { obj });
             }
         }
@@ -436,7 +437,7 @@ namespace ComWrappersTests.GlobalInstance
 
             // Trigger the thread lifetime end API and verify the callback occurs.
             int hr = MockReferenceTrackerRuntime.Trigger_NotifyEndOfReferenceTrackingOnThread();
-            Assert.AreEqual(GlobalComWrappers.ReleaseObjectsCallAck, hr);
+            Assert.Equal(GlobalComWrappers.ReleaseObjectsCallAck, hr);
         }
     }
 }
index 1d2ebe8..5740498 100644 (file)
@@ -8,7 +8,7 @@ namespace ComWrappersTests
     using System.Collections.Generic;
     using System.Runtime.CompilerServices;
     using System.Runtime.InteropServices;
-    using TestLibrary;
+    using Xunit;
 
     static class WeakReferenceNative
     {
@@ -125,10 +125,10 @@ namespace ComWrappersTests
         {
             WeakReferenceableWrapper target;
             bool isAlive = wr.TryGetTarget(out target);
-            Assert.AreEqual(expectedIsAlive, isAlive);
+            Assert.Equal(expectedIsAlive, isAlive);
 
             if (isAlive && sourceWrappers != null)
-                Assert.AreEqual(sourceWrappers.Registration, target.Registration);
+                Assert.Equal(sourceWrappers.Registration, target.Registration);
         }
 
         private static (WeakReference<WeakReferenceableWrapper>, IntPtr) GetWeakReference(TestComWrappers cw)
@@ -237,8 +237,8 @@ namespace ComWrappersTests
 
             // A weak reference to an RCW wrapping an IWeakReference created throguh the built-in system
             // should stay alive even after the RCW dies
-            Assert.IsFalse(weakRef.IsAlive);
-            Assert.IsTrue(HasTarget(weakRef));
+            Assert.False(weakRef.IsAlive);
+            Assert.True(HasTarget(weakRef));
 
             // Release the last native reference.
             Marshal.Release(nativeRef);
@@ -246,7 +246,7 @@ namespace ComWrappersTests
             GC.WaitForPendingFinalizers();
 
             // After all native references die and the RCW is collected, the weak reference should be dead and stay dead.
-            Assert.IsNull(weakRef.Target);
+            Assert.Null(weakRef.Target);
         }
 
         static void ValidateAggregatedWeakReference()
index c2310f8..1e6fa7f 100644 (file)
@@ -5,7 +5,7 @@ namespace Dynamic
 {
     using System;
     using System.Runtime.InteropServices;
-    using TestLibrary;
+    using Xunit;
 
     internal class BasicTest
     {
@@ -59,23 +59,23 @@ namespace Dynamic
             int expected = val * 2;
 
             // Invoke default member
-            Assert.AreEqual(expected, obj(val));
-            Assert.AreEqual(expected, obj.Default(val));
+            Assert.Equal(expected, obj(val));
+            Assert.Equal(expected, obj.Default(val));
         }
 
         private void Boolean()
         {
             // Get and set property
             obj.Boolean_Property = true;
-            Assert.IsTrue(obj.Boolean_Property);
+            Assert.True(obj.Boolean_Property);
 
             // Call method with return value
-            Assert.IsFalse(obj.Boolean_Inverse_Ret(true));
+            Assert.False(obj.Boolean_Inverse_Ret(true));
 
             // Call method passing by ref
             bool inout = true;
             obj.Boolean_Inverse_InOut(ref inout);
-            Assert.IsFalse(inout);
+            Assert.False(inout);
 
             // Pass as variant
             Variant<bool>(true, false);
@@ -88,15 +88,15 @@ namespace Dynamic
 
             // Get and set property
             obj.SByte_Property = val;
-            Assert.AreEqual(val, obj.SByte_Property);
+            Assert.Equal(val, obj.SByte_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.SByte_Doubled_Ret(val));
+            Assert.Equal(expected, obj.SByte_Doubled_Ret(val));
 
             // Call method passing by ref
             sbyte inout = val;
             obj.SByte_Doubled_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<sbyte>(val, expected);
@@ -109,15 +109,15 @@ namespace Dynamic
 
             // Get and set property
             obj.Byte_Property = val;
-            Assert.AreEqual(val, obj.Byte_Property);
+            Assert.Equal(val, obj.Byte_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.Byte_Doubled_Ret(val));
+            Assert.Equal(expected, obj.Byte_Doubled_Ret(val));
 
             // Call method passing by ref
             byte inout = val;
             obj.Byte_Doubled_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<byte>(val, expected);
@@ -130,15 +130,15 @@ namespace Dynamic
 
             // Get and set property
             obj.Short_Property = val;
-            Assert.AreEqual(val, obj.Short_Property);
+            Assert.Equal(val, obj.Short_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.Short_Doubled_Ret(val));
+            Assert.Equal(expected, obj.Short_Doubled_Ret(val));
 
             // Call method passing by ref
             short inout = val;
             obj.Short_Doubled_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<short>(val, expected);
@@ -151,15 +151,15 @@ namespace Dynamic
 
             // Get and set property
             obj.UShort_Property = val;
-            Assert.AreEqual(val, obj.UShort_Property);
+            Assert.Equal(val, obj.UShort_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.UShort_Doubled_Ret(val));
+            Assert.Equal(expected, obj.UShort_Doubled_Ret(val));
 
             // Call method passing by ref
             ushort inout = val;
             obj.UShort_Doubled_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<ushort>(val, expected);
@@ -172,15 +172,15 @@ namespace Dynamic
 
             // Get and set property
             obj.Int_Property = val;
-            Assert.AreEqual(val, obj.Int_Property);
+            Assert.Equal(val, obj.Int_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.Int_Doubled_Ret(val));
+            Assert.Equal(expected, obj.Int_Doubled_Ret(val));
 
             // Call method passing by ref
             int inout = val;
             obj.Int_Doubled_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<int>(val, expected);
@@ -193,15 +193,15 @@ namespace Dynamic
 
             // Get and set property
             obj.UInt_Property = val;
-            Assert.AreEqual(val, obj.UInt_Property);
+            Assert.Equal(val, obj.UInt_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.UInt_Doubled_Ret(val));
+            Assert.Equal(expected, obj.UInt_Doubled_Ret(val));
 
             // Call method passing by ref
             uint inout = val;
             obj.UInt_Doubled_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<uint>(val, expected);
@@ -214,15 +214,15 @@ namespace Dynamic
 
             // Get and set property
             obj.Int64_Property = val;
-            Assert.AreEqual(val, obj.Int64_Property);
+            Assert.Equal(val, obj.Int64_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.Int64_Doubled_Ret(val));
+            Assert.Equal(expected, obj.Int64_Doubled_Ret(val));
 
             // Call method passing by ref
             long inout = val;
             obj.Int64_Doubled_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<long>(val, expected);
@@ -235,15 +235,15 @@ namespace Dynamic
 
             // Get and set property
             obj.UInt64_Property = val;
-            Assert.AreEqual(val, obj.UInt64_Property);
+            Assert.Equal(val, obj.UInt64_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.UInt64_Doubled_Ret(val));
+            Assert.Equal(expected, obj.UInt64_Doubled_Ret(val));
 
             // Call method passing by ref
             ulong inout = val;
             obj.UInt64_Doubled_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<ulong>(val, expected);
@@ -256,15 +256,15 @@ namespace Dynamic
 
             // Get and set property
             obj.Float_Property = val;
-            Assert.AreEqual(val, obj.Float_Property);
+            Assert.Equal(val, obj.Float_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.Float_Ceil_Ret(val));
+            Assert.Equal(expected, obj.Float_Ceil_Ret(val));
 
             // Call method passing by ref
             float inout = val;
             obj.Float_Ceil_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<float>(val, expected);
@@ -277,15 +277,15 @@ namespace Dynamic
 
             // Get and set property
             obj.Double_Property = val;
-            Assert.AreEqual(val, obj.Double_Property);
+            Assert.Equal(val, obj.Double_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.Double_Ceil_Ret(val));
+            Assert.Equal(expected, obj.Double_Ceil_Ret(val));
 
             // Call method passing by ref
             double inout = val;
             obj.Double_Ceil_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<double>(val, expected);
@@ -304,15 +304,15 @@ namespace Dynamic
 
             // Get and set property
             obj.Variant_Property = val;
-            Assert.AreEqual(valRaw, obj.Variant_Property);
+            Assert.Equal(valRaw, obj.Variant_Property);
 
             // Call method with return value
-            Assert.AreEqual(expectedRaw, obj.Variant_Ret(val));
+            Assert.Equal(expectedRaw, obj.Variant_Ret(val));
 
             // Call method passing by ref
             IntPtr inout = val;
             obj.Variant_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
         }
 
         private void UIntPtr()
@@ -328,15 +328,15 @@ namespace Dynamic
 
             // Get and set property
             obj.Variant_Property = val;
-            Assert.AreEqual(valRaw, obj.Variant_Property);
+            Assert.Equal(valRaw, obj.Variant_Property);
 
             // Call method with return value
-            Assert.AreEqual(expectedRaw, obj.Variant_Ret(val));
+            Assert.Equal(expectedRaw, obj.Variant_Ret(val));
 
             // Call method passing by ref
             UIntPtr inout = val;
             obj.Variant_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
         }
 
         private void String()
@@ -348,15 +348,15 @@ namespace Dynamic
 
             // Get and set property
             obj.String_Property = val;
-            Assert.AreEqual(val, obj.String_Property);
+            Assert.Equal(val, obj.String_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.String_Reverse_Ret(val));
+            Assert.Equal(expected, obj.String_Reverse_Ret(val));
 
             // Call method passing by ref
             string inout = val;
             obj.String_Reverse_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<string>(val, expected);
@@ -371,15 +371,15 @@ namespace Dynamic
 
             // Get and set property
             obj.Date_Property = val;
-            Assert.AreEqual(val, obj.Date_Property);
+            Assert.Equal(val, obj.Date_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.Date_AddDay_Ret(val));
+            Assert.Equal(expected, obj.Date_AddDay_Ret(val));
 
             // Call method passing by ref
             DateTime inout = val;
             obj.Date_AddDay_InOut(ref inout);
-            Assert.AreEqual(expected, inout);
+            Assert.Equal(expected, inout);
 
             // Pass as variant
             Variant<DateTime>(val, expected);
@@ -392,25 +392,25 @@ namespace Dynamic
 
             // Get and set property
             obj.Dispatch_Property = val;
-            Assert.AreEqual(val, obj.Dispatch_Property);
+            Assert.Equal(val, obj.Dispatch_Property);
 
             // Update dispatch object
             obj.Dispatch_Property.Boolean_Property = false;
-            Assert.IsFalse(obj.Dispatch_Property.Boolean_Property);
-            Assert.IsFalse(val.Boolean_Property);
+            Assert.False(obj.Dispatch_Property.Boolean_Property);
+            Assert.False(val.Boolean_Property);
 
             // Call method with return value
             dynamic ret = obj.Dispatch_Ret(val);
-            Assert.IsTrue(ret.Boolean_Property);
-            Assert.IsFalse(val.Boolean_Property);
+            Assert.True(ret.Boolean_Property);
+            Assert.False(val.Boolean_Property);
 
             // Call method passing by ref
             obj.Dispatch_InOut(ref val);
-            Assert.IsTrue(val.Boolean_Property);
+            Assert.True(val.Boolean_Property);
 
             val.Boolean_Property = false;
-            Variant(val, new Action<dynamic>(d => Assert.IsTrue(d.Boolean_Property)));
-            Assert.IsTrue(val.Boolean_Property);
+            Variant(val, new Action<dynamic>(d => Assert.True(d.Boolean_Property)));
+            Assert.True(val.Boolean_Property);
 
             val.Boolean_Property = false;
             UnknownWrapper(val);
@@ -419,10 +419,10 @@ namespace Dynamic
         private void Null()
         {
             obj.Variant_Property = null;
-            Assert.IsNull(obj.Variant_Property);
+            Assert.Null(obj.Variant_Property);
 
             obj.String_Property = null;
-            Assert.AreEqual(string.Empty, obj.String_Property);
+            Assert.Equal(string.Empty, obj.String_Property);
         }
 
         private void StringWrapper(string toWrap, string expected)
@@ -431,15 +431,15 @@ namespace Dynamic
 
             // Get and set property
             obj.String_Property = val;
-            Assert.AreEqual(val.WrappedObject, obj.String_Property);
+            Assert.Equal(val.WrappedObject, obj.String_Property);
 
             // Call method with return value
-            Assert.AreEqual(expected, obj.String_Reverse_Ret(val));
+            Assert.Equal(expected, obj.String_Reverse_Ret(val));
 
             // Call method passing by ref
             BStrWrapper inout = new BStrWrapper(val.WrappedObject);
             obj.String_Reverse_InOut(ref inout);
-            Assert.AreEqual(expected, inout.WrappedObject);
+            Assert.Equal(expected, inout.WrappedObject);
         }
 
         private void UnknownWrapper(dynamic toWrap)
@@ -448,16 +448,16 @@ namespace Dynamic
 
             // Get and set property
             obj.Variant_Property = val;
-            Assert.AreEqual(val.WrappedObject, obj.Variant_Property);
+            Assert.Equal(val.WrappedObject, obj.Variant_Property);
 
             // Call method with return value
             dynamic ret = obj.Variant_Ret(val);
-            Assert.IsTrue(ret.Boolean_Property);
-            Assert.IsTrue(toWrap.Boolean_Property);
+            Assert.True(ret.Boolean_Property);
+            Assert.True(toWrap.Boolean_Property);
 
             // Call method passing by ref
             obj.Variant_InOut(ref val);
-            Assert.IsTrue(toWrap.Boolean_Property);
+            Assert.True(toWrap.Boolean_Property);
         }
 
         private void ErrorWrapper()
@@ -467,7 +467,7 @@ namespace Dynamic
 
             // Get and set property
             obj.Variant_Property = val;
-            Assert.AreEqual(val.ErrorCode, obj.Variant_Property);
+            Assert.Equal(val.ErrorCode, obj.Variant_Property);
         }
 
 #pragma warning disable 618 // CurrencyWrapper is marked obsolete
@@ -478,7 +478,7 @@ namespace Dynamic
 
             // Get and set property
             obj.Variant_Property = val;
-            Assert.AreEqual(val.WrappedObject, obj.Variant_Property);
+            Assert.Equal(val.WrappedObject, obj.Variant_Property);
         }
 #pragma warning restore 618
 
@@ -490,22 +490,22 @@ namespace Dynamic
 
             // Get and set property
             obj.Variant_Property = val;
-            Assert.AreEqual(val.WrappedObject, obj.Variant_Property);
+            Assert.Equal(val.WrappedObject, obj.Variant_Property);
 
             // Call method with return value
             dynamic ret = obj.Variant_Ret(val);
-            Assert.AreEqual(expected, ret);
+            Assert.Equal(expected, ret);
 
             // Call method passing by ref
             obj.Variant_InOut(ref val);
-            Assert.AreEqual(expected, val.WrappedObject);
+            Assert.Equal(expected, val.WrappedObject);
         }
 
         private void Variant<T>(T val, Action<T> validate)
         {
             // Get and set property
             obj.Variant_Property = val;
-            Assert.AreEqual(val, obj.Variant_Property);
+            Assert.Equal(val, obj.Variant_Property);
 
             // Call method with return value
             validate(obj.Variant_Ret(val));
@@ -518,7 +518,7 @@ namespace Dynamic
 
         private void Variant<T>(T val, T expected)
         {
-            Variant<T>(val, v => Assert.AreEqual(expected, v));
+            Variant<T>(val, v => Assert.Equal(expected, v));
         }
 
         private void Fail()
@@ -526,8 +526,8 @@ namespace Dynamic
             const int E_ABORT = unchecked((int)0x80004004);
             string message = "CUSTOM ERROR MESSAGE";
             COMException comException = Assert.Throws<COMException>(() => obj.Fail(E_ABORT, message));
-            Assert.AreEqual(E_ABORT, comException.HResult, "Unexpected HRESULT on COMException");
-            Assert.AreEqual(message, comException.Message, "Unexpected message on COMException");
+            Assert.Equal(E_ABORT, comException.HResult);
+            Assert.Equal(message, comException.Message);
 
             Assert.Throws<SEHException>(() => obj.Throw());
         }
index bf3e341..9feefc0 100644 (file)
@@ -5,7 +5,7 @@ namespace Dynamic
 {
     using System;
     using System.Collections.Generic;
-    using TestLibrary;
+    using Xunit;
 
     internal class CollectionTest
     {
@@ -40,28 +40,28 @@ namespace Dynamic
             }
 
             // Call method returning array
-            Assert.AreAllEqual(expected, obj.Array_PlusOne_Ret(array));
+            AssertExtensions.CollectionEqual(expected, obj.Array_PlusOne_Ret(array));
 
             // Call method with array in/out
             int[] inout = new int[len];
             System.Array.Copy(array, inout, len);
             obj.Array_PlusOne_InOut(ref inout);
-            Assert.AreAllEqual(expected, inout);
+            AssertExtensions.CollectionEqual(expected, inout);
 
             // Call method returning array as variant
-            Assert.AreAllEqual(expected, obj.ArrayVariant_PlusOne_Ret(array));
+            AssertExtensions.CollectionEqual(expected, obj.ArrayVariant_PlusOne_Ret(array));
 
             // Call method with array as variant in/out
             inout = new int[len];
             System.Array.Copy(array, inout, len);
             obj.ArrayVariant_PlusOne_InOut(ref inout);
-            Assert.AreAllEqual(expected, inout);
+            AssertExtensions.CollectionEqual(expected, inout);
         }
 
         private void CustomCollection()
         {
             // Add to the collection
-            Assert.AreEqual(0, obj.Count);
+            Assert.Equal(0, obj.Count);
             string[] array = { "ONE", "TWO", "THREE" };
             foreach (string s in array)
             {
@@ -69,14 +69,14 @@ namespace Dynamic
             }
 
             // Get item by index
-            Assert.AreEqual(array[0], obj[0]);
-            Assert.AreEqual(array[0], obj.Item(0));
-            Assert.AreEqual(array[0], obj.Item[0]);
-            Assert.AreEqual(array[1], obj[1]);
-            Assert.AreEqual(array[1], obj.Item(1));
-            Assert.AreEqual(array[2], obj[2]);
-            Assert.AreEqual(array[2], obj.Item(2));
-            Assert.AreEqual(array.Length, obj.Count);
+            Assert.Equal(array[0], obj[0]);
+            Assert.Equal(array[0], obj.Item(0));
+            Assert.Equal(array[0], obj.Item[0]);
+            Assert.Equal(array[1], obj[1]);
+            Assert.Equal(array[1], obj.Item(1));
+            Assert.Equal(array[2], obj[2]);
+            Assert.Equal(array[2], obj.Item(2));
+            Assert.Equal(array.Length, obj.Count);
 
             // Enumerate collection
             List<string> list = new List<string>();
@@ -87,7 +87,7 @@ namespace Dynamic
             {
                 list.Add((string)enumerator.Current);
             }
-            Assert.AreAllEqual(array, list);
+            AssertExtensions.CollectionEqual(array, list);
 
             list.Clear();
             enumerator.Reset();
@@ -95,7 +95,7 @@ namespace Dynamic
             {
                 list.Add((string)enumerator.Current);
             }
-            Assert.AreAllEqual(array, list);
+            AssertExtensions.CollectionEqual(array, list);
 
             // Iterate over object that handles DISPID_NEWENUM
             list.Clear();
@@ -103,34 +103,34 @@ namespace Dynamic
             {
                 list.Add(str);
             }
-            Assert.AreAllEqual(array, list);
+            AssertExtensions.CollectionEqual(array, list);
 
             array = new string[] { "NEW_ONE", "NEW_TWO", "NEW_THREE" };
             // Update items by index
             obj[0] = array[0];
-            Assert.AreEqual(array[0], obj[0]);
+            Assert.Equal(array[0], obj[0]);
             obj[1] = array[1];
-            Assert.AreEqual(array[1], obj[1]);
+            Assert.Equal(array[1], obj[1]);
             obj[2] = array[2];
-            Assert.AreEqual(array[2], obj[2]);
-            Assert.AreEqual(array.Length, obj.Count);
+            Assert.Equal(array[2], obj[2]);
+            Assert.Equal(array.Length, obj.Count);
 
             list.Clear();
             foreach (string str in obj)
             {
                 list.Add(str);
             }
-            Assert.AreAllEqual(array, list);
+            AssertExtensions.CollectionEqual(array, list);
 
             // Remove item
             obj.Remove(1);
-            Assert.AreEqual(2, obj.Count);
-            Assert.AreEqual(array[0], obj[0]);
-            Assert.AreEqual(array[2], obj[1]);
+            Assert.Equal(2, obj.Count);
+            Assert.Equal(array[0], obj[0]);
+            Assert.Equal(array[2], obj[1]);
 
             // Clear collection
             obj.Clear();
-            Assert.AreEqual(0, obj.Count);
+            Assert.Equal(0, obj.Count);
         }
 
         private void IndexChain()
@@ -138,12 +138,12 @@ namespace Dynamic
             dynamic collection = obj.GetDispatchCollection();
             collection.Add(collection);
 
-            Assert.AreEqual(1, collection.Item[0][0][0].Count);
+            Assert.Equal(1, collection.Item[0][0][0].Count);
 
             collection[0].Add(obj);
 
-            Assert.AreEqual(2, collection.Count);
-            Assert.AreEqual(2, collection[0].Item[1].GetDispatchCollection()[0].Count);
+            Assert.Equal(2, collection.Count);
+            Assert.Equal(2, collection[0].Item[1].GetDispatchCollection()[0].Count);
         }
     }
 }
index 47bae83..a48879c 100644 (file)
@@ -4,7 +4,7 @@
 namespace Dynamic
 {
     using System;
-    using TestLibrary;
+    using Xunit;
 
     internal class EventTest
     {
@@ -264,14 +264,14 @@ namespace Dynamic
 
             public void Validate(bool called, int id = InvalidId)
             {
-                Assert.AreEqual(called, _eventReceived, $"Event handler should {(called ? "" : "not ")}have been called");
-                Assert.AreEqual(id, _id, "Unexpected event arguments received");
+                Assert.Equal(called, _eventReceived);
+                Assert.Equal(id, _id);
             }
 
             public void ValidateMessage(bool called, string message = "")
             {
-                Assert.AreEqual(called, _eventMessageReceived, $"Event handler should {(called ? "" : "not ")}have been called");
-                Assert.AreEqual(message, _message, "Unexpected event arguments received");
+                Assert.Equal(called, _eventMessageReceived);
+                Assert.Equal(message, _message);
             }
         }
     }
index eafd092..5180dc7 100644 (file)
@@ -6,6 +6,7 @@ namespace Dynamic
     using System;
     using System.Runtime.InteropServices;
     using TestLibrary;
+    using Xunit;
 
     internal class NETServerTest
     {
@@ -29,8 +30,8 @@ namespace Dynamic
 
                 try
                 {
-                    Assert.IsTrue(obj.EqualByCCW(obj));
-                    Assert.IsTrue(obj.NotEqualByRCW(obj));
+                    Assert.True(obj.EqualByCCW(obj));
+                    Assert.True(obj.NotEqualByRCW(obj));
                 }
                 finally
                 {
index 5abb9b0..95bda80 100644 (file)
@@ -5,7 +5,7 @@ namespace Dynamic
 {
     using System;
     using System.Runtime.InteropServices;
-    using TestLibrary;
+    using Xunit;
 
     internal class ParametersTest
     {
@@ -47,26 +47,26 @@ namespace Dynamic
 
             // Name all arguments
             int[] ret = obj.Required(first: one, second: two, third: three);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all named arguments");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             // Name some arguments
             ret = obj.Required(one, two, third: three);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some named arguments");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             ret = obj.Required(one, second: two, third: three);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some named arguments");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             // Name in different order
             ret = obj.Required(third: three, first: one, second: two);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with out-of-order named arguments");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             ret = obj.Required(one, third: three, second: two);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with out-of-order named arguments");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             // Invalid name
             COMException e = Assert.Throws<COMException>(() => obj.Required(one, two, invalid: three));
             const int DISP_E_UNKNOWNNAME = unchecked((int)0x80020006);
-            Assert.AreEqual(DISP_E_UNKNOWNNAME, e.HResult, "Unexpected HRESULT on COMException");
+            Assert.Equal(DISP_E_UNKNOWNNAME, e.HResult);
         }
 
         private void DefaultValue()
@@ -75,28 +75,28 @@ namespace Dynamic
 
             // Omit all arguments
             int[] ret = obj.DefaultValue();
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments omitted");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             // Specify some arguments
             expected[0] = one;
             ret = obj.DefaultValue(one);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             expected[1] = two;
             ret = obj.DefaultValue(one, two);
-            Assert.AreAllEqual(expected, ret);
+            AssertExtensions.CollectionEqual(expected, ret);
 
             // Specify all arguments
             expected[1] = two;
             expected[2] = three;
             ret = obj.DefaultValue(one, two, three);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments specified");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             // Named arguments
             expected[0] = Default1;
             expected[1] = Default2;
             ret = obj.DefaultValue(third: three);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with named arguments");
+            AssertExtensions.CollectionEqual(expected, ret);
         }
 
         private void Optional()
@@ -105,53 +105,53 @@ namespace Dynamic
 
             // Omit all arguments
             int[] ret = obj.Optional();
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments omitted");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             // Specify some arguments
             expected[0] = one;
             ret = obj.Optional(one);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             expected[1] = Default2;
             ret = obj.Mixed(one);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             expected[1] = two;
             ret = obj.Optional(one, two);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             ret = obj.Mixed(one, two);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             // Specify all arguments
             expected[1] = two;
             expected[2] = three;
             ret = obj.Optional(one, two, three);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments specified");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             ret = obj.Mixed(one, two, three);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments specified");
+            AssertExtensions.CollectionEqual(expected, ret);
 
             // Named arguments
             expected[1] = MissingParamId;
             ret = obj.Optional(first: one, third: three);
-            Assert.AreAllEqual(expected, ret, "Unexpected result calling function with named arguments");
+            AssertExtensions.CollectionEqual(expected, ret);
         }
 
         private void VarArgs()
         {
             VarEnum[] ret = obj.VarArgs();
-            Assert.AreEqual(0, ret.Length);
+            Assert.Equal(0, ret.Length);
 
             // COM server returns the type of each variant
             ret = obj.VarArgs(false);
-            Assert.AreEqual(1, ret.Length);
-            Assert.AreAllEqual(new [] { VarEnum.VT_BOOL }, ret);
+            Assert.Equal(1, ret.Length);
+            AssertExtensions.CollectionEqual(new [] { VarEnum.VT_BOOL }, ret);
 
             VarEnum[] expected = { VarEnum.VT_BSTR, VarEnum.VT_R8, VarEnum.VT_DATE, VarEnum.VT_I4 };
             ret = obj.VarArgs("s", 10d, new DateTime(), 10);
-            Assert.AreEqual(expected.Length, ret.Length);
-            Assert.AreAllEqual(expected, ret);
+            Assert.Equal(expected.Length, ret.Length);
+            AssertExtensions.CollectionEqual(expected, ret);
         }
 
         private void Invalid()
index 8f22c9e..a269d0d 100644 (file)
@@ -5,6 +5,7 @@ namespace Dynamic
 {
     using System;
     using TestLibrary;
+    using Xunit;
 
     class Program
     {
index 2072b41..367ec33 100644 (file)
@@ -7,6 +7,7 @@ namespace NetClient
     using System.Runtime.InteropServices;
 
     using TestLibrary;
+    using Xunit;
     using Server.Contract;
     using Server.Contract.Servers;
 
@@ -21,15 +22,15 @@ namespace NetClient
             var managedInner = new ManagedInner();
             var nativeOuter = (AggregationTesting)managedInner;
 
-            Assert.IsTrue(typeof(ManagedInner).IsCOMObject);
-            Assert.IsTrue(typeof(AggregationTestingClass).IsCOMObject);
-            Assert.IsFalse(typeof(AggregationTesting).IsCOMObject);
-            Assert.IsTrue(Marshal.IsComObject(managedInner));
-            Assert.IsTrue(Marshal.IsComObject(nativeOuter));
+            Assert.True(typeof(ManagedInner).IsCOMObject);
+            Assert.True(typeof(AggregationTestingClass).IsCOMObject);
+            Assert.False(typeof(AggregationTesting).IsCOMObject);
+            Assert.True(Marshal.IsComObject(managedInner));
+            Assert.True(Marshal.IsComObject(nativeOuter));
 
-            Assert.IsTrue(nativeOuter.IsAggregated());
-            Assert.IsTrue(nativeOuter.AreAggregated(managedInner, nativeOuter));
-            Assert.IsFalse(nativeOuter.AreAggregated(nativeOuter, new object()));
+            Assert.True(nativeOuter.IsAggregated());
+            Assert.True(nativeOuter.AreAggregated(managedInner, nativeOuter));
+            Assert.False(nativeOuter.AreAggregated(nativeOuter, new object()));
         }
 
         static int Main(string[] doNotUse)
index 76de709..b6afa8e 100644 (file)
@@ -9,6 +9,7 @@ namespace NetClient
     using System.Runtime.InteropServices;
 
     using TestLibrary;
+    using Xunit;
     using Server.Contract;
 
     using CoClass = Server.Contract.Servers;
@@ -23,10 +24,10 @@ namespace NetClient
             test.ReleaseResources();
 
             // The CoClass should be the activated type, _not_ the activation interface.
-            Assert.AreEqual(test.GetType(), typeof(CoClass.ConsumeNETServerTestingClass));
-            Assert.IsTrue(typeof(CoClass.ConsumeNETServerTestingClass).IsCOMObject);
-            Assert.IsFalse(typeof(CoClass.ConsumeNETServerTesting).IsCOMObject);
-            Assert.IsTrue(Marshal.IsComObject(test));
+            Assert.Equal(test.GetType(), typeof(CoClass.ConsumeNETServerTestingClass));
+            Assert.True(typeof(CoClass.ConsumeNETServerTestingClass).IsCOMObject);
+            Assert.False(typeof(CoClass.ConsumeNETServerTesting).IsCOMObject);
+            Assert.True(Marshal.IsComObject(test));
         }
 
         static void Validate_Activation_CreateInstance()
@@ -34,13 +35,13 @@ namespace NetClient
             Console.WriteLine($"{nameof(Validate_Activation_CreateInstance)}...");
 
             Type t = Type.GetTypeFromCLSID(Guid.Parse(Guids.ConsumeNETServerTesting));
-            Assert.IsTrue(t.IsCOMObject);
+            Assert.True(t.IsCOMObject);
 
             object obj = Activator.CreateInstance(t);
             var test = (CoClass.ConsumeNETServerTesting)obj;
             test.ReleaseResources();
-            
-            Assert.IsTrue(Marshal.IsComObject(test));
+
+            Assert.True(Marshal.IsComObject(test));
 
             // Use the overload that takes constructor arguments. This tests the path where the runtime searches for the
             // constructor to use (which has some special-casing for COM) instead of just always using the default.
@@ -48,7 +49,7 @@ namespace NetClient
             test = (CoClass.ConsumeNETServerTesting)obj;
             test.ReleaseResources();
 
-            Assert.IsTrue(Marshal.IsComObject(test));
+            Assert.True(Marshal.IsComObject(test));
         }
 
         static void Validate_CCW_Wasnt_Unwrapped()
@@ -61,7 +62,7 @@ namespace NetClient
             // The CoClass should be the activated type, _not_ the implementation class.
             // This indicates the real implementation class is wrapped in its CCW and exposed
             // to the runtime as an RCW.
-            Assert.AreNotEqual(test.GetType(), typeof(ConsumeNETServerTesting));
+            Assert.NotEqual(test.GetType(), typeof(ConsumeNETServerTesting));
         }
 
         static void Validate_Client_CCW_RCW()
@@ -77,7 +78,7 @@ namespace NetClient
                 ccw = test.GetCCW();
                 object rcw = Marshal.GetObjectForIUnknown(ccw);
                 object inst = test.GetRCW();
-                Assert.AreEqual(rcw, inst);
+                Assert.Equal(rcw, inst);
             }
             finally
             {
@@ -93,8 +94,8 @@ namespace NetClient
             var test = new CoClass.ConsumeNETServerTesting();
             try
             {
-                Assert.IsTrue(test.EqualByCCW(test));
-                Assert.IsTrue(test.NotEqualByRCW(test));
+                Assert.True(test.EqualByCCW(test));
+                Assert.True(test.NotEqualByRCW(test));
             }
             finally
             {
index e3ed917..e52a5ec 100644 (file)
@@ -8,6 +8,7 @@ namespace NetClient
     using System.Runtime.InteropServices;
 
     using TestLibrary;
+    using Xunit;
     using Server.Contract;
     using Server.Contract.Servers;
     using Server.Contract.Events;
@@ -29,8 +30,8 @@ namespace NetClient
             string message = string.Empty;
             eventTesting.FireEvent();
 
-            Assert.IsTrue(eventFired, "Event didn't fire");
-            Assert.AreEqual(nameof(EventTesting.FireEvent), message, "Event message is incorrect");
+            Assert.True(eventFired);
+            Assert.Equal(nameof(EventTesting.FireEvent), message);
 
             // Remove event
             eventTesting.OnEvent -= OnEventEventHandler;
@@ -40,7 +41,7 @@ namespace NetClient
             eventFired = false;
             eventTesting.FireEvent();
 
-            Assert.IsFalse(eventFired, "Event shouldn't fire");
+            Assert.False(eventFired);
 
             void OnEventEventHandler(string msg)
             {
@@ -68,8 +69,8 @@ namespace NetClient
             string message = string.Empty;
             eventTesting.FireEvent();
 
-            Assert.IsTrue(eventFired, "Event didn't fire");
-            Assert.AreEqual(nameof(EventTesting.FireEvent), message, "Event message is incorrect");
+            Assert.True(eventFired);
+            Assert.Equal(nameof(EventTesting.FireEvent), message);
 
             comAwareEventInfo.RemoveEventHandler(eventTesting, handler);
 
@@ -78,7 +79,7 @@ namespace NetClient
             eventFired = false;
             eventTesting.FireEvent();
 
-            Assert.IsFalse(eventFired, "Event shouldn't fire");
+            Assert.False(eventFired);
 
             void OnEventEventHandler(string msg)
             {
index 54a611e..0cb80c1 100644 (file)
@@ -9,6 +9,7 @@ namespace NetClient
     using System.Runtime.InteropServices;
 
     using TestLibrary;
+    using Xunit;
     using Server.Contract;
     using Server.Contract.Servers;
 
@@ -44,13 +45,13 @@ namespace NetClient
                 ul1, ref ul2);
             Console.WriteLine($"Call to {nameof(DispatchTesting.DoubleNumeric_ReturnByRef)} complete");
 
-            Assert.AreEqual(b1 * 2, b2);
-            Assert.AreEqual(s1 * 2, s2);
-            Assert.AreEqual(us1 * 2, us2);
-            Assert.AreEqual(i1 * 2, i2);
-            Assert.AreEqual(ui1 * 2, ui2);
-            Assert.AreEqual(l1 * 2, l2);
-            Assert.AreEqual(ul1 * 2, ul2);
+            Assert.Equal(b1 * 2, b2);
+            Assert.Equal(s1 * 2, s2);
+            Assert.Equal(us1 * 2, us2);
+            Assert.Equal(i1 * 2, i2);
+            Assert.Equal(ui1 * 2, ui2);
+            Assert.Equal(l1 * 2, l2);
+            Assert.Equal(ul1 * 2, ul2);
         }
 
         static private bool EqualByBound(float expected, float actual)
@@ -82,8 +83,8 @@ namespace NetClient
             float d = dispatchTesting.Add_Float_ReturnAndUpdateByRef (a, ref c);
 
             Console.WriteLine($"Call to {nameof(DispatchTesting.Add_Float_ReturnAndUpdateByRef)} complete: {a} + {b} = {d}; {c} == {d}");
-            Assert.IsTrue(EqualByBound(expected, c));
-            Assert.IsTrue(EqualByBound(expected, d));
+            Assert.True(EqualByBound(expected, c));
+            Assert.True(EqualByBound(expected, d));
         }
 
         static void Validate_Double_In_ReturnAndUpdateByRef()
@@ -99,8 +100,8 @@ namespace NetClient
             double d = dispatchTesting.Add_Double_ReturnAndUpdateByRef (a, ref c);
 
             Console.WriteLine($"Call to {nameof(DispatchTesting.Add_Double_ReturnAndUpdateByRef)} complete: {a} + {b} = {d}; {c} == {d}");
-            Assert.IsTrue(EqualByBound(expected, c));
-            Assert.IsTrue(EqualByBound(expected, d));
+            Assert.True(EqualByBound(expected, c));
+            Assert.True(EqualByBound(expected, d));
         }
 
         static int GetErrorCodeFromHResult(int hresult)
@@ -119,23 +120,23 @@ namespace NetClient
             {
                 Console.WriteLine($"Calling {nameof(DispatchTesting.TriggerException)} with {nameof(IDispatchTesting_Exception.Disp)} {errorCode}...");
                 dispatchTesting.TriggerException(IDispatchTesting_Exception.Disp, errorCode);
-                Assert.Fail("DISP exception not thrown properly");
+                Assert.True(false, "DISP exception not thrown properly");
             }
             catch (COMException e)
             {
-                Assert.AreEqual(GetErrorCodeFromHResult(e.HResult), errorCode);
-                Assert.AreEqual(e.Message, resultString);
+                Assert.Equal(GetErrorCodeFromHResult(e.HResult), errorCode);
+                Assert.Equal(e.Message, resultString);
             }
 
             try
             {
                 Console.WriteLine($"Calling {nameof(DispatchTesting.TriggerException)} with {nameof(IDispatchTesting_Exception.HResult)} {errorCode}...");
                 dispatchTesting.TriggerException(IDispatchTesting_Exception.HResult, errorCode);
-                Assert.Fail("HRESULT exception not thrown properly");
+                Assert.True(false, "HRESULT exception not thrown properly");
             }
             catch (COMException e)
             {
-                Assert.AreEqual(GetErrorCodeFromHResult(e.HResult), errorCode);
+                Assert.Equal(GetErrorCodeFromHResult(e.HResult), errorCode);
                 // Failing HRESULT exceptions contain CLR generated messages
             }
         }
@@ -159,7 +160,7 @@ namespace NetClient
                 CultureInfo englishCulture = new CultureInfo("en-US", false);
                 CultureInfo.CurrentCulture = newCulture;
                 int lcid = dispatchTesting.PassThroughLCID();
-                Assert.AreEqual(englishCulture.LCID, lcid);  // CLR->Dispatch LCID marshalling is explicitly hardcoded to en-US instead of passing the current culture.
+                Assert.Equal(englishCulture.LCID, lcid);  // CLR->Dispatch LCID marshalling is explicitly hardcoded to en-US instead of passing the current culture.
             }
             finally
             {
@@ -173,18 +174,18 @@ namespace NetClient
             var expected = System.Linq.Enumerable.Range(0, 10);
 
             Console.WriteLine($"Calling {nameof(DispatchTesting.GetEnumerator)} ...");
-            var enumerator = dispatchTesting.GetEnumerator(); 
-            Assert.AreAllEqual(expected, GetEnumerable(enumerator));
+            var enumerator = dispatchTesting.GetEnumerator();
+            AssertExtensions.CollectionEqual(expected, GetEnumerable(enumerator));
 
             enumerator.Reset();
-            Assert.AreAllEqual(expected, GetEnumerable(enumerator));
+            AssertExtensions.CollectionEqual(expected, GetEnumerable(enumerator));
 
             Console.WriteLine($"Calling {nameof(DispatchTesting.ExplicitGetEnumerator)} ...");
             var enumeratorExplicit = dispatchTesting.ExplicitGetEnumerator();
-            Assert.AreAllEqual(expected, GetEnumerable(enumeratorExplicit));
+            AssertExtensions.CollectionEqual(expected, GetEnumerable(enumeratorExplicit));
 
             enumeratorExplicit.Reset();
-            Assert.AreAllEqual(expected, GetEnumerable(enumeratorExplicit));
+            AssertExtensions.CollectionEqual(expected, GetEnumerable(enumeratorExplicit));
 
             System.Collections.Generic.IEnumerable<int> GetEnumerable(System.Collections.IEnumerator e)
             {
index 5cea072..16c41ac 100644 (file)
@@ -9,6 +9,7 @@ namespace NetClient
     using System.Runtime.InteropServices;
 
     using TestLibrary;
+    using Xunit;
     using Server.Contract;
     using Server.Contract.Servers;
 
index f156693..648c95e 100644 (file)
@@ -10,6 +10,7 @@ namespace NetClient
     using System.Runtime.InteropServices;
 
     using TestLibrary;
+    using Xunit;
     using Server.Contract;
     using Server.Contract.Servers;
 
@@ -28,12 +29,12 @@ namespace NetClient
             try
             {
                 var tmp = (LicenseTesting)new LicenseTestingClass();
-                Assert.Fail("Activation of licensed class should fail");
+                Assert.True(false, "Activation of licensed class should fail");
             }
             catch (COMException e)
             {
                 const int CLASS_E_NOTLICENSED = unchecked((int)0x80040112);
-                Assert.AreEqual(CLASS_E_NOTLICENSED, e.HResult);
+                Assert.Equal(CLASS_E_NOTLICENSED, e.HResult);
             }
             finally
             {
@@ -87,10 +88,10 @@ namespace NetClient
                 var licenseTesting = (LicenseTesting)new LicenseTestingClass();
 
                 // During design time the IClassFactory::CreateInstance will be called - no license
-                Assert.AreEqual(null, licenseTesting.GetLicense());
+                Assert.Equal(null, licenseTesting.GetLicense());
 
                 // Verify the value retrieved from the IClassFactory2::RequestLicKey was what was set
-                Assert.AreEqual(DefaultLicKey, LicenseManager.CurrentContext.GetSavedLicenseKey(typeof(LicenseTestingClass), resourceAssembly: null));
+                Assert.Equal(DefaultLicKey, LicenseManager.CurrentContext.GetSavedLicenseKey(typeof(LicenseTestingClass), resourceAssembly: null));
             }
             finally
             {
@@ -112,7 +113,7 @@ namespace NetClient
                 var licenseTesting = (LicenseTesting)new LicenseTestingClass();
 
                 // During runtime the IClassFactory::CreateInstance2 will be called with license from context
-                Assert.AreEqual(licKey, licenseTesting.GetLicense());
+                Assert.Equal(licKey, licenseTesting.GetLicense());
             }
             finally
             {
index ee6fb79..6bfb3df 100644 (file)
@@ -8,6 +8,7 @@ namespace NetClient
     using System.Runtime.InteropServices;
 
     using TestLibrary;
+    using Xunit;
     using Server.Contract;
     using Server.Contract.Servers;
 
@@ -49,17 +50,17 @@ namespace NetClient
             allocated += AllocateInstances(1);
             allocated += AllocateInstances(2);
             allocated += AllocateInstances(3);
-            Assert.AreNotEqual(0, GetAllocationCount());
+            Assert.NotEqual(0, GetAllocationCount());
 
             ForceGC();
 
-            Assert.AreEqual(0, GetAllocationCount());
+            Assert.Equal(0, GetAllocationCount());
         }
 
         static void Validate_COMServer_DisableEagerCleanUp()
         {
             Console.WriteLine($"Calling {nameof(Validate_COMServer_DisableEagerCleanUp)}...");
-            Assert.AreEqual(0, GetAllocationCount());
+            Assert.Equal(0, GetAllocationCount());
 
             Thread.CurrentThread.DisableComObjectEagerCleanup();
 
@@ -67,18 +68,18 @@ namespace NetClient
             allocated += AllocateInstances(1);
             allocated += AllocateInstances(2);
             allocated += AllocateInstances(3);
-            Assert.AreNotEqual(0, GetAllocationCount());
+            Assert.NotEqual(0, GetAllocationCount());
 
             ForceGC();
 
-            Assert.AreNotEqual(0, GetAllocationCount());
+            Assert.NotEqual(0, GetAllocationCount());
 
             Marshal.CleanupUnusedObjectsInCurrentContext();
 
             ForceGC();
 
-            Assert.AreEqual(0, GetAllocationCount());
-            Assert.IsFalse(Marshal.AreComObjectsAvailableForCleanup());
+            Assert.Equal(0, GetAllocationCount());
+            Assert.False(Marshal.AreComObjectsAvailableForCleanup());
         }
 
         static int Main(string[] doNotUse)
@@ -99,7 +100,7 @@ namespace NetClient
                 {
                     // Initialization for all future tests
                     Initialize();
-                    Assert.IsTrue(GetAllocationCount != null);
+                    Assert.True(GetAllocationCount != null);
 
                     Validate_COMServer_CleanUp();
                     Validate_COMServer_DisableEagerCleanUp();
index 63f47d1..2edffed 100644 (file)
@@ -6,7 +6,7 @@ namespace NetClient
     using System;
     using System.Collections.Generic;
     using System.Linq;
-    using TestLibrary;
+    using Xunit;
 
     class ArrayTests
     {
@@ -62,10 +62,10 @@ namespace NetClient
             byte[] data = BaseData.Select(i => (byte)i).ToArray();
 
             Console.WriteLine($"{data.GetType().Name} marshalling");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Byte_LP_PreLen(data.Length, data)), $"Mean_Byte_LP_PreLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Byte_LP_PostLen(data, data.Length)), $"Mean_Byte_LP_PostLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Byte_SafeArray_OutLen(data, out len)), $"Mean_Byte_SafeArray_OutLen");
-            Assert.AreEqual(data.Length, len);
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Byte_LP_PreLen(data.Length, data)), $"Mean_Byte_LP_PreLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Byte_LP_PostLen(data, data.Length)), $"Mean_Byte_LP_PostLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Byte_SafeArray_OutLen(data, out len)), $"Mean_Byte_SafeArray_OutLen");
+            Assert.Equal(data.Length, len);
         }
 
         private void Marshal_ShortArray()
@@ -74,10 +74,10 @@ namespace NetClient
             short[] data = BaseData.Select(i => (short)i).ToArray();
 
             Console.WriteLine($"{data.GetType().Name} marshalling");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Short_LP_PreLen(data.Length, data)), $"Mean_Short_LP_PreLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Short_LP_PostLen(data, data.Length)), $"Mean_Short_LP_PostLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Short_SafeArray_OutLen(data, out len)), $"Mean_Short_SafeArray_OutLen");
-            Assert.AreEqual(data.Length, len);
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Short_LP_PreLen(data.Length, data)), $"Mean_Short_LP_PreLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Short_LP_PostLen(data, data.Length)), $"Mean_Short_LP_PostLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Short_SafeArray_OutLen(data, out len)), $"Mean_Short_SafeArray_OutLen");
+            Assert.Equal(data.Length, len);
         }
 
         private void Marshal_UShortArray()
@@ -86,10 +86,10 @@ namespace NetClient
             ushort[] data = BaseData.Select(i => (ushort)i).ToArray();
 
             Console.WriteLine($"{data.GetType().Name} marshalling");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UShort_LP_PreLen(data.Length, data)), $"Mean_UShort_LP_PreLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UShort_LP_PostLen(data, data.Length)), $"Mean_UShort_LP_PostLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UShort_SafeArray_OutLen(data, out len)), $"Mean_UShort_SafeArray_OutLen");
-            Assert.AreEqual(data.Length, len);
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_UShort_LP_PreLen(data.Length, data)), $"Mean_UShort_LP_PreLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_UShort_LP_PostLen(data, data.Length)), $"Mean_UShort_LP_PostLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_UShort_SafeArray_OutLen(data, out len)), $"Mean_UShort_SafeArray_OutLen");
+            Assert.Equal(data.Length, len);
         }
 
         private void Marshal_IntArray()
@@ -98,10 +98,10 @@ namespace NetClient
             int[] data = BaseData.Select(i => i).ToArray();
 
             Console.WriteLine($"{data.GetType().Name} marshalling");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Int_LP_PreLen(data.Length, data)), $"Mean_Int_LP_PreLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Int_LP_PostLen(data, data.Length)), $"Mean_Int_LP_PostLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Int_SafeArray_OutLen(data, out len)), $"Mean_Int_SafeArray_OutLen");
-            Assert.AreEqual(data.Length, len);
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Int_LP_PreLen(data.Length, data)), $"Mean_Int_LP_PreLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Int_LP_PostLen(data, data.Length)), $"Mean_Int_LP_PostLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Int_SafeArray_OutLen(data, out len)), $"Mean_Int_SafeArray_OutLen");
+            Assert.Equal(data.Length, len);
         }
 
         private void Marshal_UIntArray()
@@ -110,10 +110,10 @@ namespace NetClient
             uint[] data = BaseData.Select(i => (uint)i).ToArray();
 
             Console.WriteLine($"{data.GetType().Name} marshalling");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UInt_LP_PreLen(data.Length, data)), $"Mean_UInt_LP_PreLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UInt_LP_PostLen(data, data.Length)), $"Mean_UInt_LP_PostLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UInt_SafeArray_OutLen(data, out len)), $"Mean_UInt_SafeArray_OutLen");
-            Assert.AreEqual(data.Length, len);
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_UInt_LP_PreLen(data.Length, data)), $"Mean_UInt_LP_PreLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_UInt_LP_PostLen(data, data.Length)), $"Mean_UInt_LP_PostLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_UInt_SafeArray_OutLen(data, out len)), $"Mean_UInt_SafeArray_OutLen");
+            Assert.Equal(data.Length, len);
         }
 
         private void Marshal_LongArray()
@@ -122,10 +122,10 @@ namespace NetClient
             long[] data = BaseData.Select(i => (long)i).ToArray();
 
             Console.WriteLine($"{data.GetType().Name} marshalling");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Long_LP_PreLen(data.Length, data)), $"Mean_Long_LP_PreLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Long_LP_PostLen(data, data.Length)), $"Mean_Long_LP_PostLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Long_SafeArray_OutLen(data, out len)), $"Mean_Long_SafeArray_OutLen");
-            Assert.AreEqual(data.Length, len);
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Long_LP_PreLen(data.Length, data)), $"Mean_Long_LP_PreLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Long_LP_PostLen(data, data.Length)), $"Mean_Long_LP_PostLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Long_SafeArray_OutLen(data, out len)), $"Mean_Long_SafeArray_OutLen");
+            Assert.Equal(data.Length, len);
         }
 
         private void Marshal_ULongArray()
@@ -134,10 +134,10 @@ namespace NetClient
             ulong[] data = BaseData.Select(i => (ulong)i).ToArray();
 
             Console.WriteLine($"{data.GetType().Name} marshalling");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_ULong_LP_PreLen(data.Length, data)), $"Mean_ULong_LP_PreLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_ULong_LP_PostLen(data, data.Length)), $"Mean_ULong_LP_PostLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_ULong_SafeArray_OutLen(data, out len)), $"Mean_ULong_SafeArray_OutLen");
-            Assert.AreEqual(data.Length, len);
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_ULong_LP_PreLen(data.Length, data)), $"Mean_ULong_LP_PreLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_ULong_LP_PostLen(data, data.Length)), $"Mean_ULong_LP_PostLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_ULong_SafeArray_OutLen(data, out len)), $"Mean_ULong_SafeArray_OutLen");
+            Assert.Equal(data.Length, len);
         }
 
         private void Marshal_FloatArray()
@@ -146,10 +146,10 @@ namespace NetClient
             float[] data = BaseData.Select(i => (float)i).ToArray();
 
             Console.WriteLine($"{data.GetType().Name} marshalling");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Float_LP_PreLen(data.Length, data)), $"Mean_Float_LP_PreLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Float_LP_PostLen(data, data.Length)), $"Mean_Float_LP_PostLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Float_SafeArray_OutLen(data, out len)), $"Mean_Float_SafeArray_OutLen");
-            Assert.AreEqual(data.Length, len);
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Float_LP_PreLen(data.Length, data)), $"Mean_Float_LP_PreLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Float_LP_PostLen(data, data.Length)), $"Mean_Float_LP_PostLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Float_SafeArray_OutLen(data, out len)), $"Mean_Float_SafeArray_OutLen");
+            Assert.Equal(data.Length, len);
         }
 
         private void Marshal_DoubleArray()
@@ -158,10 +158,10 @@ namespace NetClient
             double[] data = BaseData.Select(i => (double)i).ToArray();
 
             Console.WriteLine($"{data.GetType().Name} marshalling");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Double_LP_PreLen(data.Length, data)), $"Mean_Double_LP_PreLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Double_LP_PostLen(data, data.Length)), $"Mean_Double_LP_PostLen");
-            Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Double_SafeArray_OutLen(data, out len)), $"Mean_Double_SafeArray_OutLen");
-            Assert.AreEqual(data.Length, len);
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Double_LP_PreLen(data.Length, data)), $"Mean_Double_LP_PreLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Double_LP_PostLen(data, data.Length)), $"Mean_Double_LP_PostLen");
+            Assert.True(EqualByBound(expectedMean, this.server.Mean_Double_SafeArray_OutLen(data, out len)), $"Mean_Double_SafeArray_OutLen");
+            Assert.Equal(data.Length, len);
         }
     }
 }
index 0529b54..0ecea29 100644 (file)
@@ -6,7 +6,7 @@ namespace NetClient
     using System;
     using System.Drawing;
     using System.Runtime.InteropServices;
-    using TestLibrary;
+    using Xunit;
 
     class ColorTests
     {
@@ -24,12 +24,12 @@ namespace NetClient
 
         private void VerifyColorMarshalling()
         {
-            Assert.IsTrue(server.AreColorsEqual(Color.Green, ColorTranslator.ToOle(Color.Green)));
+            Assert.True(server.AreColorsEqual(Color.Green, ColorTranslator.ToOle(Color.Green)));
         }
 
         private void VerifyGetRed()
         {
-            Assert.AreEqual(Color.Red, server.GetRed());
+            Assert.Equal(Color.Red, server.GetRed());
         }
     }
 }
index 1ba6b93..b741416 100644 (file)
@@ -5,7 +5,7 @@ namespace NetClient
 {
     using System;
     using System.Runtime.InteropServices;
-    using TestLibrary;
+    using Xunit;
 
     class ErrorTests
     {
@@ -52,8 +52,8 @@ namespace NetClient
 
             foreach (var hr in hrs)
             {
-                Assert.AreEqual(hr, this.server.Return_As_HResult(hr));
-                Assert.AreEqual(hr, this.server.Return_As_HResult_Struct(hr).hr);
+                Assert.Equal(hr, this.server.Return_As_HResult(hr));
+                Assert.Equal(hr, this.server.Return_As_HResult_Struct(hr).hr);
             }
         }
     }
index ec6a2d5..6517191 100644 (file)
@@ -4,7 +4,7 @@
 namespace NetClient
 {
     using System;
-    using TestLibrary;
+    using Xunit;
 
     class NumericTests
     {
@@ -59,145 +59,145 @@ namespace NetClient
         {
             var expected = (byte)(a + b);
             Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}");
-            Assert.AreEqual(expected, this.server.Add_Byte(a, b));
+            Assert.Equal(expected, this.server.Add_Byte(a, b));
 
             var c = byte.MaxValue;
             this.server.Add_Byte_Ref(a, b, ref c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
 
             c = 0;
             this.server.Add_Byte_Out(a, b, out c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
         }
 
         private void Marshal_Short(short a, short b)
         {
             var expected = (short)(a + b);
             Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}");
-            Assert.AreEqual(expected, this.server.Add_Short(a, b));
+            Assert.Equal(expected, this.server.Add_Short(a, b));
 
             var c = short.MaxValue;
             this.server.Add_Short_Ref(a, b, ref c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
 
             c = 0;
             this.server.Add_Short_Out(a, b, out c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
         }
 
         private void Marshal_UShort(ushort a, ushort b)
         {
             var expected = (ushort)(a + b);
             Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}");
-            Assert.AreEqual(expected, this.server.Add_UShort(a, b));
+            Assert.Equal(expected, this.server.Add_UShort(a, b));
 
             var c = ushort.MaxValue;
             this.server.Add_UShort_Ref(a, b, ref c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
 
             c = 0;
             this.server.Add_UShort_Out(a, b, out c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
         }
 
         private void Marshal_Int(int a, int b)
         {
             var expected = a + b;
             Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}");
-            Assert.AreEqual(expected, this.server.Add_Int(a, b));
+            Assert.Equal(expected, this.server.Add_Int(a, b));
 
             var c = int.MaxValue;
             this.server.Add_Int_Ref(a, b, ref c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
 
             c = 0;
             this.server.Add_Int_Out(a, b, out c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
         }
 
         private void Marshal_UInt(uint a, uint b)
         {
             var expected = a + b;
             Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}");
-            Assert.AreEqual(expected, this.server.Add_UInt(a, b));
+            Assert.Equal(expected, this.server.Add_UInt(a, b));
 
             var c = uint.MaxValue;
             this.server.Add_UInt_Ref(a, b, ref c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
 
             c = 0;
             this.server.Add_UInt_Out(a, b, out c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
         }
 
         private void Marshal_Long(long a, long b)
         {
             var expected = a + b;
             Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}");
-            Assert.AreEqual(expected, this.server.Add_Long(a, b));
+            Assert.Equal(expected, this.server.Add_Long(a, b));
 
             var c = long.MaxValue;
             this.server.Add_Long_Ref(a, b, ref c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
 
             c = 0;
             this.server.Add_Long_Out(a, b, out c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
         }
 
         private void Marshal_ULong(ulong a, ulong b)
         {
             var expected = a + b;
             Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}");
-            Assert.AreEqual(expected, this.server.Add_ULong(a, b));
+            Assert.Equal(expected, this.server.Add_ULong(a, b));
 
             var c = ulong.MaxValue;
             this.server.Add_ULong_Ref(a, b, ref c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
 
             c = 0;
             this.server.Add_ULong_Out(a, b, out c);
-            Assert.AreEqual(expected, c);
+            Assert.Equal(expected, c);
         }
 
         private void Marshal_Float(float a, float b)
         {
             var expected = a + b;
             Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}");
-            Assert.IsTrue(EqualByBound(expected, this.server.Add_Float(a, b)), $"Add_Float: {this.server.Add_Float(a, b)}");
+            Assert.True(EqualByBound(expected, this.server.Add_Float(a, b)), $"Add_Float: {this.server.Add_Float(a, b)}");
 
             var c = float.MaxValue;
             this.server.Add_Float_Ref(a, b, ref c);
-            Assert.IsTrue(EqualByBound(expected, c), "Add_Float_Ref");
+            Assert.True(EqualByBound(expected, c));
 
             c = 0;
             this.server.Add_Float_Out(a, b, out c);
-            Assert.IsTrue(EqualByBound(expected, c), "Add_Float_Out");
+            Assert.True(EqualByBound(expected, c));
         }
 
         private void Marshal_Double(double a, double b)
         {
             var expected = a + b;
             Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}");
-            Assert.IsTrue(EqualByBound(expected, this.server.Add_Double(a, b)));
+            Assert.True(EqualByBound(expected, this.server.Add_Double(a, b)));
 
             var c = double.MaxValue;
             this.server.Add_Double_Ref(a, b, ref c);
-            Assert.IsTrue(EqualByBound(expected, c));
+            Assert.True(EqualByBound(expected, c));
 
             c = 0;
             this.server.Add_Double_Out(a, b, out c);
-            Assert.IsTrue(EqualByBound(expected, c));
+            Assert.True(EqualByBound(expected, c));
         }
 
         private void Marshal_ManyInts()
         {
             var expected = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11;
             Console.WriteLine($"{expected.GetType().Name} 11 test invariant: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = {expected}");
-            Assert.IsTrue(expected == this.server.Add_ManyInts11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11));
+            Assert.True(expected == this.server.Add_ManyInts11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11));
             expected = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12;
             Console.WriteLine($"{expected.GetType().Name} 12 test invariant: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 = {expected}");
-            Assert.IsTrue(expected == this.server.Add_ManyInts12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12));
+            Assert.True(expected == this.server.Add_ManyInts12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12));
         }
     }
 }
index 4b1e411..281f4b0 100644 (file)
@@ -6,7 +6,7 @@ namespace NetClient
     using System;
     using System.Threading;
     using System.Runtime.InteropServices;
-    using TestLibrary;
+    using Xunit;
 
     class Program
     {
index 39267f4..65ede3c 100644 (file)
@@ -9,7 +9,7 @@ namespace NetClient
     using System.Linq;
     using System.Text;
     using System.Runtime.InteropServices;
-    using TestLibrary;
+    using Xunit;
 
     class StringTests
     {
@@ -83,7 +83,7 @@ namespace NetClient
 
                 string expected = p.Item1 + p.Item2;
                 string actual = this.server.Add_LPStr(p.Item1, p.Item2);
-                Assert.AreEqual(expected, actual, "Add_String_LPStr (simple)");
+                Assert.Equal(expected, actual);
             }
 
             foreach (var s in reversableStrings)
@@ -98,23 +98,23 @@ namespace NetClient
                 string expected = Reverse(local);
 
                 string actual = this.server.Reverse_LPStr(local);
-                Assert.AreEqual(expected, actual);
+                Assert.Equal(expected, actual);
 
                 actual = this.server.Reverse_LPStr_Ref(ref local);
-                Assert.AreEqual(expected, actual);
-                Assert.AreEqual(expected, local);
+                Assert.Equal(expected, actual);
+                Assert.Equal(expected, local);
 
                 local = s;
                 actual = this.server.Reverse_LPStr_InRef(ref local);
-                Assert.AreEqual(expected, actual);
-                Assert.AreEqual(s, local);
+                Assert.Equal(expected, actual);
+                Assert.Equal(s, local);
 
                 this.server.Reverse_LPStr_Out(local, out actual);
-                Assert.AreEqual(expected, actual);
+                Assert.Equal(expected, actual);
 
                 actual = local;
                 this.server.Reverse_LPStr_OutAttr(local, actual); // No-op for strings
-                Assert.AreEqual(local, actual);
+                Assert.Equal(local, actual);
             }
 
             foreach (var s in reversableStrings)
@@ -129,35 +129,35 @@ namespace NetClient
                 string expected = Reverse(local.ToString());
 
                 StringBuilder actual = this.server.Reverse_SB_LPStr(local);
-                Assert.AreEqual(expected, actual.ToString());
-                Assert.AreEqual(expected, local.ToString());
+                Assert.Equal(expected, actual.ToString());
+                Assert.Equal(expected, local.ToString());
 
                 local = new StringBuilder(s);
                 actual = this.server.Reverse_SB_LPStr_Ref(ref local);
-                Assert.AreEqual(expected, actual.ToString());
-                Assert.AreEqual(expected, local.ToString());
+                Assert.Equal(expected, actual.ToString());
+                Assert.Equal(expected, local.ToString());
 
                 local = new StringBuilder(s);
                 actual = this.server.Reverse_SB_LPStr_InRef(ref local);
-                Assert.AreEqual(expected, actual.ToString());
+                Assert.Equal(expected, actual.ToString());
 
                 // Palindromes are _always_ equal
                 if (!string.Equals(s, expected))
                 {
-                    Assert.AreNotEqual(expected, local.ToString());
+                    Assert.NotEqual(expected, local.ToString());
                 }
 
                 local = new StringBuilder(s);
                 actual = new StringBuilder();
                 this.server.Reverse_SB_LPStr_Out(local, out actual);
-                Assert.AreEqual(expected, actual.ToString());
-                Assert.AreEqual(expected, local.ToString());
+                Assert.Equal(expected, actual.ToString());
+                Assert.Equal(expected, local.ToString());
 
                 local = new StringBuilder(s);
                 actual = new StringBuilder(s.Length);
                 this.server.Reverse_SB_LPStr_OutAttr(local, actual);
-                Assert.AreEqual(expected, actual.ToString());
-                Assert.AreEqual(expected, local.ToString());
+                Assert.Equal(expected, actual.ToString());
+                Assert.Equal(expected, local.ToString());
             }
         }
 
@@ -168,7 +168,7 @@ namespace NetClient
             {
                 string expected = p.Item1 + p.Item2;
                 string actual = this.server.Add_LPWStr(p.Item1, p.Item2);
-                Assert.AreEqual(expected, actual, "Add_String_LPWStr (simple)");
+                Assert.Equal(expected, actual);
             }
 
             foreach (var s in reversableStrings)
@@ -177,19 +177,19 @@ namespace NetClient
                 string expected = Reverse(local);
 
                 string actual = this.server.Reverse_LPWStr(local);
-                Assert.AreEqual(expected, actual);
+                Assert.Equal(expected, actual);
 
                 actual = this.server.Reverse_LPWStr_Ref(ref local);
-                Assert.AreEqual(expected, actual);
-                Assert.AreEqual(expected, local);
+                Assert.Equal(expected, actual);
+                Assert.Equal(expected, local);
 
                 local = s;
                 actual = this.server.Reverse_LPWStr_InRef(ref local);
-                Assert.AreEqual(expected, actual);
-                Assert.AreEqual(s, local);
+                Assert.Equal(expected, actual);
+                Assert.Equal(s, local);
 
                 this.server.Reverse_LPWStr_Out(local, out actual);
-                Assert.AreEqual(expected, actual);
+                Assert.Equal(expected, actual);
 
                 actual = local;
                 Assert.Throws<MarshalDirectiveException>( () => this.server.Reverse_LPWStr_OutAttr(local, actual));
@@ -201,35 +201,35 @@ namespace NetClient
                 string expected = Reverse(local.ToString());
 
                 StringBuilder actual = this.server.Reverse_SB_LPWStr(local);
-                Assert.AreEqual(expected, actual.ToString());
-                Assert.AreEqual(expected, local.ToString());
+                Assert.Equal(expected, actual.ToString());
+                Assert.Equal(expected, local.ToString());
 
                 local = new StringBuilder(s);
                 actual = this.server.Reverse_SB_LPWStr_Ref(ref local);
-                Assert.AreEqual(expected, actual.ToString());
-                Assert.AreEqual(expected, local.ToString());
+                Assert.Equal(expected, actual.ToString());
+                Assert.Equal(expected, local.ToString());
 
                 local = new StringBuilder(s);
                 actual = this.server.Reverse_SB_LPWStr_InRef(ref local);
-                Assert.AreEqual(expected, actual.ToString());
+                Assert.Equal(expected, actual.ToString());
 
                 // Palindromes are _always_ equal
                 if (!string.Equals(s, expected))
                 {
-                    Assert.AreNotEqual(expected, local.ToString());
+                    Assert.NotEqual(expected, local.ToString());
                 }
 
                 local = new StringBuilder(s);
                 actual = new StringBuilder();
                 this.server.Reverse_SB_LPWStr_Out(local, out actual);
-                Assert.AreEqual(expected, actual.ToString());
-                Assert.AreEqual(expected, local.ToString());
+                Assert.Equal(expected, actual.ToString());
+                Assert.Equal(expected, local.ToString());
 
                 local = new StringBuilder(s);
                 actual = new StringBuilder(s.Length);
                 this.server.Reverse_SB_LPWStr_OutAttr(local, actual);
-                Assert.AreEqual(expected, actual.ToString());
-                Assert.AreEqual(expected, local.ToString());
+                Assert.Equal(expected, actual.ToString());
+                Assert.Equal(expected, local.ToString());
             }
         }
 
@@ -240,7 +240,7 @@ namespace NetClient
             {
                 string expected = p.Item1 + p.Item2;
                 string actual = this.server.Add_BStr(p.Item1, p.Item2);
-                Assert.AreEqual(expected, actual, "Add_String_BStr (simple)");
+                Assert.Equal(expected, actual);
             }
 
             foreach (var s in reversableStrings)
@@ -249,23 +249,23 @@ namespace NetClient
                 string expected = Reverse(local);
 
                 string actual = this.server.Reverse_BStr(local);
-                Assert.AreEqual(expected, actual);
+                Assert.Equal(expected, actual);
 
                 actual = this.server.Reverse_BStr_Ref(ref local);
-                Assert.AreEqual(expected, actual);
-                Assert.AreEqual(expected, local);
+                Assert.Equal(expected, actual);
+                Assert.Equal(expected, local);
 
                 local = s;
                 actual = this.server.Reverse_BStr_InRef(ref local);
-                Assert.AreEqual(expected, actual);
-                Assert.AreEqual(s, local);
+                Assert.Equal(expected, actual);
+                Assert.Equal(s, local);
 
                 this.server.Reverse_BStr_Out(local, out actual);
-                Assert.AreEqual(expected, actual);
+                Assert.Equal(expected, actual);
 
                 actual = local;
                 this.server.Reverse_BStr_OutAttr(local, actual); // No-op for strings
-                Assert.AreEqual(local, actual);
+                Assert.Equal(local, actual);
             }
         }
 
@@ -278,7 +278,7 @@ namespace NetClient
                 string expected = Reverse(local);
 
                 string actual = this.server.Reverse_LPWStr_With_LCID(local);
-                Assert.AreEqual(expected, actual);
+                Assert.Equal(expected, actual);
             }
 
             CultureInfo culture = new CultureInfo("es-ES", false);
@@ -288,7 +288,7 @@ namespace NetClient
             {
                 CultureInfo.CurrentCulture = culture;
                 this.server.Pass_Through_LCID(out int lcid);
-                Assert.AreEqual(englishCulture.LCID, lcid); // CLR->COM LCID marshalling is explicitly hardcoded to en-US as requested by VSTO instead of passing the current culture.
+                Assert.Equal(englishCulture.LCID, lcid); // CLR->COM LCID marshalling is explicitly hardcoded to en-US as requested by VSTO instead of passing the current culture.
             }
             finally
             {
index d850e9c..fc1c871 100644 (file)
@@ -7,7 +7,7 @@ using System.Text;
 using System.Security;
 using System.Reflection;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class Reflection
 {
index e8bd428..0d5ce0b 100644 (file)
@@ -12,7 +12,8 @@
        If a target project references System.Private.Corelib, we are unable to reference CoreCLRTestLibrary.
        Compile in relevant files used for testing interop. -->
   <ItemGroup Condition="('$(IgnoreCoreCLRTestLibraryDependency)' != 'true') And ('$(ReferenceSystemPrivateCoreLib)' == 'true')">
-    <Compile Include="$(MSBuildThisFileDirectory)\..\Common\CoreCLRTestLibrary\Assertion.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)\..\Common\CoreCLRTestLibrary\AssertExtensions.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)\..\Common\Assert.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)\..\Common\CoreCLRTestLibrary\HostPolicyMock.cs" Condition="'$(RequiresMockHostPolicy)' == 'true'"/>
   </ItemGroup>
 
index 929f2b7..0747fd4 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 class ExactSpellingTest
 {
@@ -149,7 +149,7 @@ class ExactSpellingTest
 
     private static void Verify(int expectedReturnValue, int expectedParameterValue, int actualReturnValue, int actualParameterValue)
     {
-        Assert.AreEqual(expectedReturnValue, actualReturnValue);
-        Assert.AreEqual(expectedParameterValue, actualParameterValue);
+        Assert.Equal(expectedReturnValue, actualReturnValue);
+        Assert.Equal(expectedParameterValue, actualParameterValue);
     }
 }
index 35731c7..2881add 100644 (file)
@@ -6,7 +6,7 @@ using System.IO;
 using System.Linq;
 using System.Reflection;
 using System.Runtime.Loader;
-using TestLibrary;
+using Xunit;
 
 public class RunInALC
 {
@@ -44,7 +44,7 @@ public class RunInALC
         Type inContextType = inContextAssembly.GetType("CustomMarshalers.CustomMarshalerTest");
         object instance = Activator.CreateInstance(inContextType);
         MethodInfo parseIntMethod = inContextType.GetMethod("ParseInt", BindingFlags.Instance | BindingFlags.Public);
-        Assert.AreEqual(1234, (int)parseIntMethod.Invoke(instance, new object[]{"1234"}));
+        Assert.Equal(1234, (int)parseIntMethod.Invoke(instance, new object[]{"1234"}));
         GC.KeepAlive(context);
     }
 }
index 8171279..f9dec3c 100644 (file)
@@ -6,7 +6,7 @@ using System.IO;
 using System.Linq;
 using System.Reflection;
 using System.Runtime.Loader;
-using TestLibrary;
+using Xunit;
 
 public class RunInALC
 {
@@ -14,8 +14,8 @@ public class RunInALC
     {
         try
         {
-            Assert.AreEqual(123, new CustomMarshalers.CustomMarshalerTest().ParseInt("123"));
-            Assert.AreEqual(123, new CustomMarshalers2.CustomMarshalerTest().ParseInt("123"));
+            Assert.Equal(123, new CustomMarshalers.CustomMarshalerTest().ParseInt("123"));
+            Assert.Equal(123, new CustomMarshalers2.CustomMarshalerTest().ParseInt("123"));
             return 100;
         }
         catch (Exception e)
index 73ab60a..b1c8d25 100644 (file)
@@ -6,7 +6,7 @@ using System.Collections.Generic;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
-using TestLibrary;
+using Xunit;
 
 namespace IDynamicInterfaceCastableTests
 {
@@ -72,7 +72,7 @@ namespace IDynamicInterfaceCastableTests
 
         public int GetNumberHelper()
         {
-            Assert.Fail("Calling a public interface method with a default implementation should go through IDynamicInterfaceCastable for interface dispatch.");
+            Assert.True(false, "Calling a public interface method with a default implementation should go through IDynamicInterfaceCastable for interface dispatch.");
             return 0;
         }
 
@@ -312,24 +312,24 @@ namespace IDynamicInterfaceCastableTests
             Console.WriteLine(" -- Validate cast");
 
             // ITest -> ITestImpl
-            Assert.IsTrue(castableObj is ITest, $"Should be castable to {nameof(ITest)} via is");
-            Assert.IsNotNull(castableObj as ITest, $"Should be castable to {nameof(ITest)} via as");
+            Assert.True(castableObj is ITest);
+            Assert.NotNull(castableObj as ITest);
             var testObj = (ITest)castableObj;
 
             Console.WriteLine(" -- Validate method call");
-            Assert.AreSame(castableObj, testObj.ReturnThis(), $"{nameof(ITest.ReturnThis)} should return actual object");
-            Assert.AreEqual(typeof(DynamicInterfaceCastable), testObj.GetMyType(), $"{nameof(ITest.GetMyType)} should return typeof(DynamicInterfaceCastable)");
+            Assert.Same(castableObj, testObj.ReturnThis());
+            Assert.Equal(typeof(DynamicInterfaceCastable), testObj.GetMyType());
 
             Console.WriteLine(" -- Validate method call which calls methods using 'this'");
-            Assert.AreEqual(DynamicInterfaceCastable.ImplementedMethodReturnValue, testObj.CallImplemented(ImplementationToCall.Class));
-            Assert.AreEqual(ITestImpl.GetNumberReturnValue, testObj.CallImplemented(ImplementationToCall.Interface));
-            Assert.AreEqual(ITestImpl.GetNumberPrivateReturnValue, testObj.CallImplemented(ImplementationToCall.InterfacePrivate));
-            Assert.AreEqual(ITestImpl.GetNumberStaticReturnValue, testObj.CallImplemented(ImplementationToCall.InterfaceStatic));
+            Assert.Equal(DynamicInterfaceCastable.ImplementedMethodReturnValue, testObj.CallImplemented(ImplementationToCall.Class));
+            Assert.Equal(ITestImpl.GetNumberReturnValue, testObj.CallImplemented(ImplementationToCall.Interface));
+            Assert.Equal(ITestImpl.GetNumberPrivateReturnValue, testObj.CallImplemented(ImplementationToCall.InterfacePrivate));
+            Assert.Equal(ITestImpl.GetNumberStaticReturnValue, testObj.CallImplemented(ImplementationToCall.InterfaceStatic));
             Assert.Throws<InvalidCastException>(() => testObj.CallImplemented(ImplementationToCall.ImplInterfacePublic));
 
             Console.WriteLine(" -- Validate delegate call");
             Func<ITest> func = new Func<ITest>(testObj.ReturnThis);
-            Assert.AreSame(castableObj, func(), $"Delegate call to {nameof(ITest.ReturnThis)} should return this");
+            Assert.Same(castableObj, func());
         }
 
         private static void ValidateGenericInterface()
@@ -345,42 +345,42 @@ namespace IDynamicInterfaceCastableTests
             Console.WriteLine(" -- Validate cast");
 
             // ITestGeneric<int, int> -> ITestGenericIntImpl
-            Assert.IsTrue(castableObj is ITestGeneric<int, int>, $"Should be castable to {nameof(ITestGeneric<int, int>)} via is");
-            Assert.IsNotNull(castableObj as ITestGeneric<int, int>, $"Should be castable to {nameof(ITestGeneric<int, int>)} via as");
+            Assert.True(castableObj is ITestGeneric<int, int>, $"Should be castable to {nameof(ITestGeneric<int, int>)} via is");
+            Assert.NotNull(castableObj as ITestGeneric<int, int>);
             ITestGeneric<int, int> testInt = (ITestGeneric<int, int>)castableObj;
 
             // ITestGeneric<string, string> -> ITestGenericImpl<string, string>
-            Assert.IsTrue(castableObj is ITestGeneric<string, string>, $"Should be castable to {nameof(ITestGeneric<string, string>)} via is");
-            Assert.IsNotNull(castableObj as ITestGeneric<string, string>, $"Should be castable to {nameof(ITestGeneric<string, string>)} via as");
+            Assert.True(castableObj is ITestGeneric<string, string>, $"Should be castable to {nameof(ITestGeneric<string, string>)} via is");
+            Assert.NotNull(castableObj as ITestGeneric<string, string>);
             ITestGeneric<string, string> testStr = (ITestGeneric<string, string>)castableObj;
 
             // Validate Variance
             // ITestGeneric<string, object> -> ITestGenericImpl<object, string>
-            Assert.IsTrue(castableObj is ITestGeneric<string, object>, $"Should be castable to {nameof(ITestGeneric<string, object>)} via is");
-            Assert.IsNotNull(castableObj as ITestGeneric<string, object>, $"Should be castable to {nameof(ITestGeneric<string, object>)} via as");
+            Assert.True(castableObj is ITestGeneric<string, object>, $"Should be castable to {nameof(ITestGeneric<string, object>)} via is");
+            Assert.NotNull(castableObj as ITestGeneric<string, object>);
             ITestGeneric<string, object> testVar = (ITestGeneric<string, object>)castableObj;
 
             // ITestGeneric<bool, bool> is not recognized
-            Assert.IsFalse(castableObj is ITestGeneric<bool, bool>, $"Should not be castable to {nameof(ITestGeneric<bool, bool>)} via is");
-            Assert.IsNull(castableObj as ITestGeneric<bool, bool>, $"Should not be castable to {nameof(ITestGeneric<bool, bool>)} via as");
+            Assert.False(castableObj is ITestGeneric<bool, bool>, $"Should not be castable to {nameof(ITestGeneric<bool, bool>)} via is");
+            Assert.Null(castableObj as ITestGeneric<bool, bool>);
             var ex = Assert.Throws<DynamicInterfaceCastableException>(() => { var _ = (ITestGeneric<bool, bool>)castableObj; });
-            Assert.AreEqual(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(ITestGeneric<bool, bool>)), ex.Message);
+            Assert.Equal(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(ITestGeneric<bool, bool>)), ex.Message);
 
             int expectedInt = 42;
             string expectedStr = "str";
 
             Console.WriteLine(" -- Validate method call");
-            Assert.AreEqual(expectedInt, testInt.ReturnArg(42));
-            Assert.AreEqual(expectedStr, testStr.ReturnArg(expectedStr));
-            Assert.AreEqual(expectedStr, testVar.ReturnArg(expectedStr));
+            Assert.Equal(expectedInt, testInt.ReturnArg(42));
+            Assert.Equal(expectedStr, testStr.ReturnArg(expectedStr));
+            Assert.Equal(expectedStr, testVar.ReturnArg(expectedStr));
 
             Console.WriteLine(" -- Validate delegate call");
             Func<int, int> funcInt = new Func<int, int>(testInt.ReturnArg);
-            Assert.AreEqual(expectedInt, funcInt(expectedInt));
+            Assert.Equal(expectedInt, funcInt(expectedInt));
             Func<string, string> funcStr = new Func<string, string>(testStr.ReturnArg);
-            Assert.AreEqual(expectedStr, funcStr(expectedStr));
+            Assert.Equal(expectedStr, funcStr(expectedStr));
             Func<string, object> funcVar = new Func<string, object>(testVar.ReturnArg);
-            Assert.AreEqual(expectedStr, funcVar(expectedStr));
+            Assert.Equal(expectedStr, funcVar(expectedStr));
         }
 
         private static void ValidateOverriddenInterface()
@@ -395,25 +395,25 @@ namespace IDynamicInterfaceCastableTests
             Console.WriteLine(" -- Validate cast");
 
             // IOverrideTest -> IOverrideTestImpl
-            Assert.IsTrue(castableObj is IOverrideTest, $"Should be castable to {nameof(IOverrideTest)} via is");
-            Assert.IsNotNull(castableObj as IOverrideTest, $"Should be castable to {nameof(IOverrideTest)} via as");
+            Assert.True(castableObj is IOverrideTest, $"Should be castable to {nameof(IOverrideTest)} via is");
+            Assert.NotNull(castableObj as IOverrideTest);
             var testObj = (IOverrideTest)castableObj;
 
             Console.WriteLine(" -- Validate method call");
-            Assert.AreSame(castableObj, testObj.ReturnThis(), $"{nameof(IOverrideTest.ReturnThis)} should return actual object");
-            Assert.AreEqual(IOverrideTestImpl.GetMyTypeReturnValue, testObj.GetMyType(), $"{nameof(IOverrideTest.GetMyType)} should return {IOverrideTestImpl.GetMyTypeReturnValue}");
+            Assert.Same(castableObj, testObj.ReturnThis());
+            Assert.Equal(IOverrideTestImpl.GetMyTypeReturnValue, testObj.GetMyType());
 
             Console.WriteLine(" -- Validate method call which calls methods using 'this'");
-            Assert.AreEqual(DynamicInterfaceCastable.ImplementedMethodReturnValue, testObj.CallImplemented(ImplementationToCall.Class));
-            Assert.AreEqual(IOverrideTestImpl.GetNumberReturnValue_Override, testObj.CallImplemented(ImplementationToCall.Interface));
-            Assert.AreEqual(ITestImpl.GetNumberPrivateReturnValue, testObj.CallImplemented(ImplementationToCall.InterfacePrivate));
-            Assert.AreEqual(ITestImpl.GetNumberStaticReturnValue, testObj.CallImplemented(ImplementationToCall.InterfaceStatic));
+            Assert.Equal(DynamicInterfaceCastable.ImplementedMethodReturnValue, testObj.CallImplemented(ImplementationToCall.Class));
+            Assert.Equal(IOverrideTestImpl.GetNumberReturnValue_Override, testObj.CallImplemented(ImplementationToCall.Interface));
+            Assert.Equal(ITestImpl.GetNumberPrivateReturnValue, testObj.CallImplemented(ImplementationToCall.InterfacePrivate));
+            Assert.Equal(ITestImpl.GetNumberStaticReturnValue, testObj.CallImplemented(ImplementationToCall.InterfaceStatic));
 
             Console.WriteLine(" -- Validate delegate call");
             Func<ITest> func = new Func<ITest>(testObj.ReturnThis);
-            Assert.AreSame(castableObj, func(), $"Delegate call to {nameof(IOverrideTest.ReturnThis)} should return this");
+            Assert.Same(castableObj, func());
             Func<Type> funcGetType = new Func<Type>(testObj.GetMyType);
-            Assert.AreEqual(IOverrideTestImpl.GetMyTypeReturnValue, funcGetType(), $"Delegate call to {nameof(IOverrideTest.GetMyType)} should return {IOverrideTestImpl.GetMyTypeReturnValue}");
+            Assert.Equal(IOverrideTestImpl.GetMyTypeReturnValue, funcGetType());
         }
 
         private static void ValidateNotImplemented()
@@ -424,10 +424,10 @@ namespace IDynamicInterfaceCastableTests
                 { typeof(ITest), typeof(ITestImpl) }
             });
 
-            Assert.IsFalse(castableObj is INotImplemented, $"Should not be castable to {nameof(INotImplemented)} via is");
-            Assert.IsNull(castableObj as INotImplemented, $"Should not be castable to {nameof(INotImplemented)} via as");
+            Assert.False(castableObj is INotImplemented, $"Should not be castable to {nameof(INotImplemented)} via is");
+            Assert.Null(castableObj as INotImplemented);
             var ex = Assert.Throws<DynamicInterfaceCastableException>(() => { var _ = (INotImplemented)castableObj; });
-            Assert.AreEqual(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(INotImplemented)), ex.Message);
+            Assert.Equal(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(INotImplemented)), ex.Message);
         }
 
         private static void ValidateDirectlyImplemented()
@@ -440,16 +440,16 @@ namespace IDynamicInterfaceCastableTests
             });
 
             Console.WriteLine(" -- Validate cast");
-            Assert.IsTrue(castableObj is IDirectlyImplemented, $"Should be castable to {nameof(IDirectlyImplemented)} via is");
-            Assert.IsNotNull(castableObj as IDirectlyImplemented, $"Should be castable to {nameof(IDirectlyImplemented)} via as");
+            Assert.True(castableObj is IDirectlyImplemented, $"Should be castable to {nameof(IDirectlyImplemented)} via is");
+            Assert.NotNull(castableObj as IDirectlyImplemented);
             var direct = (IDirectlyImplemented)castableObj;
 
             Console.WriteLine(" -- Validate method call");
-            Assert.AreEqual(DynamicInterfaceCastable.ImplementedMethodReturnValue, direct.ImplementedMethod());
+            Assert.Equal(DynamicInterfaceCastable.ImplementedMethodReturnValue, direct.ImplementedMethod());
 
             Console.WriteLine(" -- Validate delegate call");
             Func<int> func = new Func<int>(direct.ImplementedMethod);
-            Assert.AreEqual(DynamicInterfaceCastable.ImplementedMethodReturnValue, func());
+            Assert.Equal(DynamicInterfaceCastable.ImplementedMethodReturnValue, func());
         }
 
         private static void ValidateErrorHandling()
@@ -496,7 +496,7 @@ namespace IDynamicInterfaceCastableTests
             Console.WriteLine(" -- Validate exception thrown");
             castableObj.InvalidImplementation = BadDynamicInterfaceCastable.InvalidReturn.ThrowException;
             ex = Assert.Throws<DynamicInterfaceCastableException>(() => { var _ = (ITest)castableObj; });
-            Assert.AreEqual(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(ITest)), ex.Message);
+            Assert.Equal(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(ITest)), ex.Message);
             Console.WriteLine($" ---- {ex.GetType().Name}: {ex.Message}");
 
             Console.WriteLine(" -- Validate reabstracted implementation");
index 4b3008a..0ed2e87 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.IO;
 using System.Reflection;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace CopyConstructorMarshaler
 {
@@ -26,24 +26,24 @@ namespace CopyConstructorMarshaler
                 MethodInfo testMethod = testType.GetMethod("PInvokeNumCopies");
 
                 // PInvoke will copy twice. Once from argument to parameter, and once from the managed to native parameter.
-                Assert.AreEqual(2, (int)testMethod.Invoke(testInstance, null));
+                Assert.Equal(2, (int)testMethod.Invoke(testInstance, null));
 
                 testMethod = testType.GetMethod("ReversePInvokeNumCopies");
 
                 // Reverse PInvoke will copy 3 times. Two are from the same paths as the PInvoke,
                 // and the third is from the reverse P/Invoke call.
-                Assert.AreEqual(3, (int)testMethod.Invoke(testInstance, null));
+                Assert.Equal(3, (int)testMethod.Invoke(testInstance, null));
 
                 testMethod = testType.GetMethod("PInvokeNumCopiesDerivedType");
 
                 // PInvoke will copy twice. Once from argument to parameter, and once from the managed to native parameter.
-                Assert.AreEqual(2, (int)testMethod.Invoke(testInstance, null));
+                Assert.Equal(2, (int)testMethod.Invoke(testInstance, null));
 
                 testMethod = testType.GetMethod("ReversePInvokeNumCopiesDerivedType");
 
                 // Reverse PInvoke will copy 3 times. Two are from the same paths as the PInvoke,
                 // and the third is from the reverse P/Invoke call.
-                Assert.AreEqual(3, (int)testMethod.Invoke(testInstance, null));
+                Assert.Equal(3, (int)testMethod.Invoke(testInstance, null));
             }
             catch (Exception ex)
             {
index 5007ec3..c7d9f4c 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.IO;
 using System.Reflection;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace FixupCallsHostWhenLoaded
 {
@@ -30,8 +30,8 @@ namespace FixupCallsHostWhenLoaded
 
                 IntPtr ijwModuleHandle = GetModuleHandle("IjwNativeDll.dll");
 
-                Assert.AreNotEqual(IntPtr.Zero, ijwModuleHandle);
-                Assert.IsTrue(wasModuleVTableQueried(ijwModuleHandle));
+                Assert.NotEqual(IntPtr.Zero, ijwModuleHandle);
+                Assert.True(wasModuleVTableQueried(ijwModuleHandle));
             }
             catch (Exception e)
             {
index cdcacd6..e7df50e 100644 (file)
@@ -7,6 +7,7 @@ using System.Reflection;
 using System.Runtime.InteropServices;
 using Internal.Runtime.InteropServices;
 using TestLibrary;
+using Xunit;
 
 using Console = Internal.Console;
 
@@ -42,7 +43,7 @@ namespace LoadIjwFromModuleHandle
 
                 NativeEntryPointDelegate nativeEntryPoint = Marshal.GetDelegateForFunctionPointer<NativeEntryPointDelegate>(NativeLibrary.GetExport(ijwNativeHandle, "NativeEntryPoint"));
 
-                Assert.AreEqual(100, nativeEntryPoint());
+                Assert.Equal(100, nativeEntryPoint());
 
                 Console.WriteLine("Test calls from managed to native to managed when an IJW assembly was first loaded via native.");
 
@@ -51,7 +52,7 @@ namespace LoadIjwFromModuleHandle
                 object testInstance = Activator.CreateInstance(testType);
                 MethodInfo testMethod = testType.GetMethod("ManagedEntryPoint");
 
-                Assert.AreEqual(100, (int)testMethod.Invoke(testInstance, null));
+                Assert.Equal(100, (int)testMethod.Invoke(testInstance, null));
 
                 MethodInfo changeReturnedValueMethod = testType.GetMethod("ChangeReturnedValue");
                 MethodInfo getReturnValueMethod = testType.GetMethod("GetReturnValue");
@@ -59,14 +60,14 @@ namespace LoadIjwFromModuleHandle
                 int newValue = 42;
                 changeReturnedValueMethod.Invoke(null, new object[] { newValue });
 
-                Assert.AreEqual(newValue, (int)getReturnValueMethod.Invoke(null, null));
+                Assert.Equal(newValue, (int)getReturnValueMethod.Invoke(null, null));
 
                 // Native images are only loaded into memory once. As a result, the stubs in the vtfixup table
                 // will always point to JIT stubs that exist in the first ALC that the module was loaded into.
                 // As a result, if an IJW module is loaded into two different ALCs, or if the module is
                 // first loaded via a native call and then loaded via the managed loader, the call stack can change ALCs when
                 // jumping from managed->native->managed code within the IJW module.
-                Assert.AreEqual(100, (int)testMethod.Invoke(testInstance, null));
+                Assert.Equal(100, (int)testMethod.Invoke(testInstance, null));
                 return 100;
             }
             catch (Exception ex)
index ffbf04e..7348bcc 100644 (file)
@@ -8,7 +8,7 @@ using System.IO;
 using System.Linq;
 using System.Reflection;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace NativeVarargsTest
 {
index b333c7d..26f5e8f 100644 (file)
@@ -3,7 +3,7 @@ using System.Security;
 using System.Collections.Generic;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace PInvokeTests
 {
@@ -192,14 +192,14 @@ namespace PInvokeTests
 
             string s = "before";
             var p = new SeqClass(0, false, s);
-            Assert.IsTrue(SimpleSeqLayoutClassByRef(p));
+            Assert.True(SimpleSeqLayoutClassByRef(p));
         }
 
         public static void SequentialClassNull()
         {
             Console.WriteLine($"Running {nameof(SequentialClassNull)}...");
 
-            Assert.IsTrue(SimpleSeqLayoutClassByRefNull(null));
+            Assert.True(SimpleSeqLayoutClassByRefNull(null));
         }
 
         public static void DerivedClassWithEmptyBase()
@@ -207,8 +207,8 @@ namespace PInvokeTests
             Console.WriteLine($"Running {nameof(DerivedClassWithEmptyBase)}...");
 
             string s = "before";
-            Assert.IsTrue(DerivedSeqLayoutClassByRef(new SeqDerivedClass(42), 42));
-            Assert.IsTrue(DerivedSeqLayoutClassByRef(new SeqDerivedClass2(42), 42));
+            Assert.True(DerivedSeqLayoutClassByRef(new SeqDerivedClass(42), 42));
+            Assert.True(DerivedSeqLayoutClassByRef(new SeqDerivedClass2(42), 42));
         }
 
         public static void ExplicitClass()
@@ -216,7 +216,7 @@ namespace PInvokeTests
             Console.WriteLine($"Running {nameof(ExplicitClass)}...");
 
             var p = new ExpClass(DialogResult.None, 10);
-            Assert.IsTrue(SimpleExpLayoutClassByRef(p));
+            Assert.True(SimpleExpLayoutClassByRef(p));
         }
 
         private static void ValidateBlittableClassInOut(Func<Blittable, bool> pinvoke)
@@ -224,8 +224,8 @@ namespace PInvokeTests
             int a = 10;
             int expected = a + 1;
             Blittable p = new Blittable(a);
-            Assert.IsTrue(pinvoke(p));
-            Assert.AreEqual(expected, p.a);
+            Assert.True(pinvoke(p));
+            Assert.Equal(expected, p.a);
         }
 
         public static void BlittableClass()
@@ -239,7 +239,7 @@ namespace PInvokeTests
         {
             // [Compat] Marshalled with [In, Out] behaviour by default
             Console.WriteLine($"Running {nameof(BlittableClassNull)}...");
-            Assert.IsTrue(SimpleBlittableSeqLayoutClass_Null(null));
+            Assert.True(SimpleBlittableSeqLayoutClass_Null(null));
         }
 
         public static void BlittableClassByInAttr()
@@ -261,8 +261,8 @@ namespace PInvokeTests
             int a = 10;
             int expected = a + 1;
             SealedBlittable p = new SealedBlittable(a);
-            Assert.IsTrue(pinvoke(p));
-            Assert.AreEqual(expected, p.a);
+            Assert.True(pinvoke(p));
+            Assert.Equal(expected, p.a);
         }
 
         public static void SealedBlittableClass()
@@ -290,14 +290,14 @@ namespace PInvokeTests
         {
             Console.WriteLine($"Running {nameof(SealedBlittablePinned)}...");
             var blittable = new SealedBlittable(1);
-            Assert.IsTrue(PointersEqual(blittable, ref blittable.a));
+            Assert.True(PointersEqual(blittable, ref blittable.a));
         }
 
         public static void BlittablePinned()
         {
             Console.WriteLine($"Running {nameof(BlittablePinned)}...");
             var blittable = new Blittable(1);
-            Assert.IsTrue(PointersEqual(blittable, ref blittable.a));
+            Assert.True(PointersEqual(blittable, ref blittable.a));
         }
 
         public static void NestedLayoutClass()
@@ -310,7 +310,7 @@ namespace PInvokeTests
             {
                 value = p
             };
-            Assert.IsTrue(SimpleNestedLayoutClassByValue(target));
+            Assert.True(SimpleNestedLayoutClassByValue(target));
         }
 
         public static void RecursiveNativeLayout()
index 6674bd1..34e075a 100644 (file)
@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public partial class FunctionPtr
 {
@@ -27,16 +27,16 @@ public partial class FunctionPtr
             IntPtr fcnptr = Marshal.GetFunctionPointerForDelegate<VoidDelegate>(md);
 
             VoidDelegate del = (VoidDelegate)Marshal.GetDelegateForFunctionPointer(fcnptr, typeof(VoidDelegate));
-            Assert.AreEqual(md.Target, del.Target, "Failure - the Target of the funcptr->delegate should be equal to the original method.");
-            Assert.AreEqual(md.Method, del.Method, "Failure - The Method of the funcptr->delegate should be equal to the MethodInfo of the original method.");
+            Assert.Equal(md.Target, del.Target);
+            Assert.Equal(md.Method, del.Method);
         }
 
         // Native FcnPtr -> Delegate
         {
             IntPtr fcnptr = FunctionPointerNative.GetVoidVoidFcnPtr();
             VoidDelegate del = (VoidDelegate)Marshal.GetDelegateForFunctionPointer(fcnptr, typeof(VoidDelegate));
-            Assert.AreEqual(null, del.Target, "Failure - the Target of the funcptr->delegate should be null since we provided native funcptr.");
-            Assert.AreEqual("Invoke", del.Method.Name, "Failure - The Method of the native funcptr->delegate should be the Invoke method.");
+            Assert.Equal(null, del.Target);
+            Assert.Equal("Invoke", del.Method.Name);
 
             // Round trip of a native function pointer is never legal for a non-concrete Delegate type
             Assert.Throws<ArgumentException>(() =>
index 3cfa46b..e5b913e 100644 (file)
@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 partial class FunctionPtr
 {
@@ -18,7 +18,7 @@ partial class FunctionPtr
 
         {
             IntPtr fcnptr = Marshal.GetFunctionPointerForDelegate<DelegateWithLong>(s_DelWithLongBool);
-            Assert.IsTrue(FunctionPointerNative.CheckFcnPtr(fcnptr));
+            Assert.True(FunctionPointerNative.CheckFcnPtr(fcnptr));
         }
 
         {
index de3f20c..26082d5 100644 (file)
@@ -6,7 +6,7 @@ using System.Reflection;
 using System.Security;
 using System.Runtime.InteropServices;
 using System.Collections.Generic;
-using TestLibrary;
+using Xunit;
 
 #pragma warning disable 618
 
index 4742b2e..a85e163 100644 (file)
@@ -4,7 +4,7 @@ using System;
 using System.IO;
 using System.Reflection;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 enum TestResult {
     Success,
index a0af26f..7b09f06 100644 (file)
@@ -9,7 +9,7 @@ using System.Runtime.Loader;
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-using TestLibrary;
+using Xunit;
 
 public class FakeNativeLibrary
 {
@@ -30,7 +30,7 @@ public class ALC : AssemblyLoadContext
 
     public void Validate(params string[] expectedNames)
     {
-        Assert.AreAllEqual(expectedNames, invocations, $"Unexpected invocations for {nameof(LoadUnmanagedDll)}.");
+        AssertExtensions.CollectionEqual(expectedNames, invocations);
     }
 
     protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
@@ -87,30 +87,30 @@ public class ResolveUnmanagedDllTests
         // ALC implementation returns a fake handle value
         IntPtr ptr = NativeLibrary.Load(FakeNativeLibrary.Name, asm, null);
         alc.Validate(FakeNativeLibrary.Name);
-        Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}");
+        Assert.Equal(FakeNativeLibrary.Handle, ptr);
 
         alc.Reset();
         ptr = IntPtr.Zero;
 
         bool success = NativeLibrary.TryLoad(FakeNativeLibrary.Name, asm, null, out ptr);
-        Assert.IsTrue(success, $"NativeLibrary.TryLoad should have succeeded");
+        Assert.True(success, $"NativeLibrary.TryLoad should have succeeded");
         alc.Validate(FakeNativeLibrary.Name);
-        Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}");
+        Assert.Equal(FakeNativeLibrary.Handle, ptr);
 
         alc.Reset();
 
         // ALC implementation calls NativeLibrary.TryLoad with a different name
         ptr = NativeLibrary.Load(FakeNativeLibrary.RedirectName, asm, null);
         alc.Validate(FakeNativeLibrary.RedirectName, FakeNativeLibrary.Name);
-        Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}");
+        Assert.Equal(FakeNativeLibrary.Handle, ptr);
 
         alc.Reset();
         ptr = IntPtr.Zero;
 
         success = NativeLibrary.TryLoad(FakeNativeLibrary.RedirectName, asm, null, out ptr);
-        Assert.IsTrue(success, $"NativeLibrary.TryLoad should have succeeded");
+        Assert.True(success, $"NativeLibrary.TryLoad should have succeeded");
         alc.Validate(FakeNativeLibrary.RedirectName, FakeNativeLibrary.Name);
-        Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}");
+        Assert.Equal(FakeNativeLibrary.Handle, ptr);
 
         alc.Reset();
 
@@ -121,7 +121,7 @@ public class ResolveUnmanagedDllTests
 
         int value = NativeSumInAssemblyLoadContext(alc, addend1, addend2);
         alc.Validate(NativeLibraryToLoad.InvalidName);
-        Assert.AreEqual(expected, value, $"Unexpected return value for {nameof(NativeSum)}");
+        Assert.Equal(expected, value);
     }
 
     public static void ValidateResolvingUnmanagedDllEvent()
@@ -150,14 +150,14 @@ public class ResolveUnmanagedDllTests
         using (var handler = new Handlers(alc, returnValid: false))
         {
             Assert.Throws<DllNotFoundException>(() => NativeLibrary.Load(FakeNativeLibrary.Name, assembly, null));
-            Assert.IsTrue(handler.EventHandlerInvoked, "Event handler should have been invoked");
+            Assert.True(handler.EventHandlerInvoked);
         }
 
         using (var handler = new Handlers(alc, returnValid: true))
         {
             IntPtr ptr = NativeLibrary.Load(FakeNativeLibrary.Name, assembly, null);
-            Assert.IsTrue(handler.EventHandlerInvoked, "Event handler should have been invoked");
-            Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}");
+            Assert.True(handler.EventHandlerInvoked);
+            Assert.Equal(FakeNativeLibrary.Handle, ptr);
         }
     }
 
@@ -176,10 +176,10 @@ public class ResolveUnmanagedDllTests
             else
             {
                 TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => NativeSumInAssemblyLoadContext(alc, addend1, addend2));
-                Assert.AreEqual(typeof(DllNotFoundException), ex.InnerException.GetType());
+                Assert.Equal(typeof(DllNotFoundException), ex.InnerException.GetType());
             }
 
-            Assert.IsTrue(handler.EventHandlerInvoked, "Event handler should have been invoked");
+            Assert.True(handler.EventHandlerInvoked);
         }
 
         // Multiple handlers - first valid result is used
@@ -192,10 +192,10 @@ public class ResolveUnmanagedDllTests
                 ? NativeSum(addend1, addend2)
                 : NativeSumInAssemblyLoadContext(alc, addend1, addend2);
 
-            Assert.IsTrue(handlerInvalid.EventHandlerInvoked, "Event handler should have been invoked");
-            Assert.IsTrue(handlerValid1.EventHandlerInvoked, "Event handler should have been invoked");
-            Assert.IsFalse(handlerValid2.EventHandlerInvoked, "Event handler should not have been invoked");
-            Assert.AreEqual(expected, value, $"Unexpected return value for {nameof(NativeSum)} in {alc}");
+            Assert.True(handlerInvalid.EventHandlerInvoked);
+            Assert.True(handlerValid1.EventHandlerInvoked);
+            Assert.False(handlerValid2.EventHandlerInvoked);
+            Assert.Equal(expected, value);
         }
     }
 
index 5f4a0d7..c77a187 100644 (file)
@@ -6,7 +6,7 @@ using System.IO;
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-using TestLibrary;
+using Xunit;
 
 [assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
 public class CallbackTests
@@ -40,8 +40,8 @@ public class CallbackTests
         DllImportResolver resolver = Resolver.Instance.Callback;
 
         // Invalid arguments
-        Assert.Throws<ArgumentNullException>(() => NativeLibrary.SetDllImportResolver(null, resolver), "Exception expected for null assembly parameter");
-        Assert.Throws<ArgumentNullException>(() => NativeLibrary.SetDllImportResolver(assembly, null), "Exception expected for null resolver parameter");
+        Assert.Throws<ArgumentNullException>(() => NativeLibrary.SetDllImportResolver(null, resolver));
+        Assert.Throws<ArgumentNullException>(() => NativeLibrary.SetDllImportResolver(assembly, null));
 
         // No callback registered yet
         Assert.Throws<DllNotFoundException>(() => NativeSum(10, 10));
@@ -50,13 +50,13 @@ public class CallbackTests
         NativeLibrary.SetDllImportResolver(assembly, resolver);
 
         // Try to set the resolver again on the same assembly
-        Assert.Throws<InvalidOperationException>(() => NativeLibrary.SetDllImportResolver(assembly, resolver), "Should not be able to re-register resolver");
+        Assert.Throws<InvalidOperationException>(() => NativeLibrary.SetDllImportResolver(assembly, resolver));
 
         // Try to set another resolver on the same assembly
         DllImportResolver anotherResolver =
             (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) =>
                 IntPtr.Zero;
-        Assert.Throws<InvalidOperationException>(() => NativeLibrary.SetDllImportResolver(assembly, anotherResolver), "Should not be able to register another resolver");
+        Assert.Throws<InvalidOperationException>(() => NativeLibrary.SetDllImportResolver(assembly, anotherResolver));
     }
 
     public static void ValidatePInvoke()
@@ -69,7 +69,7 @@ public class CallbackTests
         Resolver.Instance.Reset();
         int value = NativeSum(addend1, addend2);
         Resolver.Instance.Validate(NativeLibraryToLoad.InvalidName);
-        Assert.AreEqual(expected, value, $"Unexpected return value from {nameof(NativeSum)}");
+        Assert.Equal(expected, value);
     }
 
     private class Resolver
@@ -87,9 +87,9 @@ public class CallbackTests
 
         public void Validate(params string[] expectedNames)
         {
-            Assert.AreEqual(expectedNames.Length, invocations.Count, $"Unexpected invocation count for registered {nameof(DllImportResolver)}.");
+            Assert.Equal(expectedNames.Length, invocations.Count);
             for (int i = 0; i < expectedNames.Length; i++)
-                Assert.AreEqual(expectedNames[i], invocations[i], $"Unexpected library name received by registered resolver.");
+                Assert.Equal(expectedNames[i], invocations[i]);
         }
 
         private IntPtr ResolveDllImport(string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath)
@@ -98,7 +98,7 @@ public class CallbackTests
 
             if (string.Equals(libraryName, NativeLibraryToLoad.InvalidName))
             {
-                Assert.AreEqual(DllImportSearchPath.System32, dllImportSearchPath, $"Unexpected {nameof(dllImportSearchPath)}: {dllImportSearchPath.ToString()}");
+                Assert.Equal(DllImportSearchPath.System32, dllImportSearchPath);
                 return NativeLibrary.Load(NativeLibraryToLoad.Name, asm, null);
             }
 
index b3efd22..6096794 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Threading;
-using TestLibrary;
+using Xunit;
 
 internal static unsafe class ObjectiveC
 {
@@ -47,7 +47,7 @@ public class AutoReleaseTest
             GC.Collect();
             GC.WaitForPendingFinalizers();
 
-            Assert.AreEqual(numReleaseCalls + 1, ObjectiveC.getNumReleaseCalls());
+            Assert.Equal(numReleaseCalls + 1, ObjectiveC.getNumReleaseCalls());
         }
 
         static void RunScenario(AutoResetEvent evt)
@@ -80,7 +80,7 @@ public class AutoReleaseTest
             evt.WaitOne();
             // Wait 60 ms after the signal to ensure that the thread has finished the work item and has drained the thread's autorelease pool.
             Thread.Sleep(60);
-            Assert.AreEqual(numReleaseCalls + 1, ObjectiveC.getNumReleaseCalls());
+            Assert.Equal(numReleaseCalls + 1, ObjectiveC.getNumReleaseCalls());
         }
     }
 }
index 9072890..b9d06dd 100644 (file)
@@ -9,7 +9,7 @@ namespace ObjectiveCMarshalAPI
     using System.Runtime.InteropServices;
     using System.Runtime.InteropServices.ObjectiveC;
 
-    using TestLibrary;
+    using Xunit;
 
     class NativeObjCMarshalTests
     {
@@ -97,8 +97,8 @@ namespace ObjectiveCMarshalAPI
             {
                 if (_contract != null)
                 {
-                    Assert.AreEqual(nuint.MaxValue, _contract->RefCountDown);  // Validate finalizer queue callback
-                    Assert.AreEqual(_expectedCount, _contract->RefCountUp);    // Validate "is referenced" callback
+                    Assert.Equal(nuint.MaxValue, _contract->RefCountDown);  // Validate finalizer queue callback
+                    Assert.Equal(_expectedCount, _contract->RefCountUp);    // Validate "is referenced" callback
                 }
 
                 FinalizeCount++;
@@ -111,8 +111,8 @@ namespace ObjectiveCMarshalAPI
                 _contract = (Contract*)mem;
 
                 // Contract should be 0 initialized when supplied.
-                Assert.AreEqual((nuint)0, _contract->RefCountDown);
-                Assert.AreEqual((nuint)0, _contract->RefCountUp);
+                Assert.Equal((nuint)0, _contract->RefCountDown);
+                Assert.Equal((nuint)0, _contract->RefCountUp);
 
                 _expectedCount = (nuint)count;
                 _contract->RefCountDown = _expectedCount;
@@ -145,7 +145,7 @@ namespace ObjectiveCMarshalAPI
             GCHandle h = ObjectiveCMarshal.CreateReferenceTrackingHandle(obj, out Span<IntPtr> s);
 
             // Validate contract length for tagged memory.
-            Assert.AreEqual(2, s.Length);
+            Assert.Equal(2, s.Length);
 
             // Make the "is referenced" callback run at least 'count' number of times.
             fixed (void* p = s)
@@ -160,9 +160,9 @@ namespace ObjectiveCMarshalAPI
 
             // Validate the memory is the same but the GCHandles are distinct.
             fixed (void* p = s)
-                Assert.AreEqual(obj.Contract, new IntPtr(p));
+                Assert.Equal(obj.Contract, new IntPtr(p));
 
-            Assert.AreNotEqual(handle, h);
+            Assert.NotEqual(handle, h);
             h.Free();
         }
 
@@ -217,7 +217,7 @@ namespace ObjectiveCMarshalAPI
             // Validate we finalized all the objects we allocated.
             // It is important to validate the count prior to freeing
             // the handles to verify they are not keeping objects alive.
-            Assert.AreEqual(Base.FinalizeCount, Base.AllocCount);
+            Assert.Equal(Base.FinalizeCount, Base.AllocCount);
 
             // Clean up all allocated handles that are no longer needed.
             foreach (var h in handles)
@@ -255,7 +255,7 @@ namespace ObjectiveCMarshalAPI
             out IntPtr context)
         {
             var lastMethod = (MethodInfo)MethodBase.GetMethodFromHandle(lastMethodHandle);
-            Assert.IsTrue(lastMethod != null);
+            Assert.True(lastMethod != null);
 
             context = IntPtr.Zero;
             if (e is IntException ie)
@@ -268,7 +268,7 @@ namespace ObjectiveCMarshalAPI
                 return (delegate* unmanaged<IntPtr, void>)NativeObjCMarshalTests.GetThrowException();
             }
 
-            Assert.Fail("Unknown exception type");
+            Assert.True(false, "Unknown exception type");
             throw new Exception("Unreachable");
         }
 
@@ -296,7 +296,7 @@ namespace ObjectiveCMarshalAPI
             {
                 delegate* unmanaged<int, void> testNativeMethod = scen.Fptr;
                 int ret = NativeObjCMarshalTests.CallAndCatch((IntPtr)testNativeMethod, scen.Expected);
-                Assert.AreEqual(scen.Expected, ret);
+                Assert.Equal(scen.Expected, ret);
             }
 
             GC.KeepAlive(delThrowInt);
@@ -306,7 +306,7 @@ namespace ObjectiveCMarshalAPI
         static void Validate_Initialize_FailsOnSecondAttempt()
         {
             Console.WriteLine($"Running {nameof(Validate_Initialize_FailsOnSecondAttempt)}...");
-            
+
             Assert.Throws<InvalidOperationException>(
                 () =>
                 {
@@ -331,4 +331,4 @@ namespace ObjectiveCMarshalAPI
             return 100;
         }
     }
-}
\ No newline at end of file
+}
index 3336eba..e728712 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 #region Sequential
 #region sequential struct definition
@@ -605,10 +605,10 @@ class Test
 
     [DllImport("MarshalArrayByValArrayNative", CallingConvention = CallingConvention.Cdecl)]
     static extern bool TakeLPSTRArrayExpStructByVal([In]S_LPSTRArray_Exp s, int size);
-    
+
     [DllImport("MarshalArrayByValArrayNative", CallingConvention = CallingConvention.Cdecl)]
     static extern bool TakeLPCSTRArrayExpStructByVal([In]S_LPCSTRArray_Exp s, int size);
-    
+
     [DllImport("MarshalArrayByValArrayNative", CallingConvention = CallingConvention.Cdecl)]
     static extern bool TakeBSTRArrayExpStructByVal([In]S_BSTRArray_Exp s, int size);
 
@@ -805,62 +805,62 @@ class Test
 
         S_INTArray_Seq s1 = new S_INTArray_Seq();
         s1.arr = InitArray<int>(ARRAY_SIZE);
-        Assert.IsTrue(TakeIntArraySeqStructByVal(s1, s1.arr.Length), "TakeIntArraySeqStructByVal");
+        Assert.True(TakeIntArraySeqStructByVal(s1, s1.arr.Length));
 
         S_UINTArray_Seq s2 = new S_UINTArray_Seq();
         s2.arr = InitArray<uint>(ARRAY_SIZE);
-        Assert.IsTrue(TakeUIntArraySeqStructByVal(s2, s2.arr.Length), "TakeUIntArraySeqStructByVal");
+        Assert.True(TakeUIntArraySeqStructByVal(s2, s2.arr.Length));
 
         S_SHORTArray_Seq s3 = new S_SHORTArray_Seq();
         s3.arr = InitArray<short>(ARRAY_SIZE);
-        Assert.IsTrue(TakeShortArraySeqStructByVal(s3, s3.arr.Length), "TakeShortArraySeqStructByVal");
+        Assert.True(TakeShortArraySeqStructByVal(s3, s3.arr.Length));
 
         S_WORDArray_Seq s4 = new S_WORDArray_Seq();
         s4.arr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.IsTrue(TakeWordArraySeqStructByVal(s4, s4.arr.Length), "TakeWordArraySeqStructByVal");
+        Assert.True(TakeWordArraySeqStructByVal(s4, s4.arr.Length));
 
         S_LONG64Array_Seq s5 = new S_LONG64Array_Seq();
         s5.arr = InitArray<long>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLong64ArraySeqStructByVal(s5, s5.arr.Length), "TakeLong64ArraySeqStructByVal");
+        Assert.True(TakeLong64ArraySeqStructByVal(s5, s5.arr.Length));
 
         S_ULONG64Array_Seq s6 = new S_ULONG64Array_Seq();
         s6.arr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.IsTrue(TakeULong64ArraySeqStructByVal(s6, s6.arr.Length), "TakeULong64ArraySeqStructByVal");
+        Assert.True(TakeULong64ArraySeqStructByVal(s6, s6.arr.Length));
 
         S_DOUBLEArray_Seq s7 = new S_DOUBLEArray_Seq();
         s7.arr = InitArray<double>(ARRAY_SIZE);
-        Assert.IsTrue(TakeDoubleArraySeqStructByVal(s7, s7.arr.Length), "TakeDoubleArraySeqStructByVal");
+        Assert.True(TakeDoubleArraySeqStructByVal(s7, s7.arr.Length));
 
         S_FLOATArray_Seq s8 = new S_FLOATArray_Seq();
         s8.arr = InitArray<float>(ARRAY_SIZE);
-        Assert.IsTrue(TakeFloatArraySeqStructByVal(s8, s8.arr.Length), "TakeFloatArraySeqStructByVal");
+        Assert.True(TakeFloatArraySeqStructByVal(s8, s8.arr.Length));
 
         S_BYTEArray_Seq s9 = new S_BYTEArray_Seq();
         s9.arr = InitArray<byte>(ARRAY_SIZE);
-        Assert.IsTrue(TakeByteArraySeqStructByVal(s9, s9.arr.Length), "TakeByteArraySeqStructByVal");
+        Assert.True(TakeByteArraySeqStructByVal(s9, s9.arr.Length));
 
         S_CHARArray_Seq s10 = new S_CHARArray_Seq();
         s10.arr = InitArray<char>(ARRAY_SIZE);
-        Assert.IsTrue(TakeCharArraySeqStructByVal(s10, s10.arr.Length), "TakeCharArraySeqStructByVal");
+        Assert.True(TakeCharArraySeqStructByVal(s10, s10.arr.Length));
 
         S_LPSTRArray_Seq s11 = new S_LPSTRArray_Seq();
         s11.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLPSTRArraySeqStructByVal(s11, s11.arr.Length),"TakeLPSTRArraySeqStructByVal");
+        Assert.True(TakeLPSTRArraySeqStructByVal(s11, s11.arr.Length),"TakeLPSTRArraySeqStructByVal");
 
         S_LPCSTRArray_Seq s12 = new S_LPCSTRArray_Seq();
         s12.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLPCSTRArraySeqStructByVal(s12, s12.arr.Length),"TakeLPCSTRArraySeqStructByVal");
+        Assert.True(TakeLPCSTRArraySeqStructByVal(s12, s12.arr.Length),"TakeLPCSTRArraySeqStructByVal");
 
         if (OperatingSystem.IsWindows())
         {
             S_BSTRArray_Seq s13 = new S_BSTRArray_Seq();
             s13.arr = InitArray<string>(ARRAY_SIZE);
-            Assert.IsTrue(TakeBSTRArraySeqStructByVal(s13, s13.arr.Length),"TakeBSTRArraySeqStructByVal");
+            Assert.True(TakeBSTRArraySeqStructByVal(s13, s13.arr.Length),"TakeBSTRArraySeqStructByVal");
         }
 
         S_StructArray_Seq s14 = new S_StructArray_Seq();
         s14.arr = InitStructArray(ARRAY_SIZE);
-        Assert.IsTrue(TakeStructArraySeqStructByVal(s14, s14.arr.Length),"TakeStructArraySeqStructByVal");
+        Assert.True(TakeStructArraySeqStructByVal(s14, s14.arr.Length),"TakeStructArraySeqStructByVal");
 
         EnregisterableNonBlittable_Seq s15 = new EnregisterableNonBlittable_Seq
         {
@@ -872,7 +872,7 @@ class Test
             }
         };
 
-        Assert.IsTrue(TakeEnregistrableNonBlittableSeqStructByVal(s15, s15.arr), "EnregisterableNonBlittableSeqStructByVal");
+        Assert.True(TakeEnregistrableNonBlittableSeqStructByVal(s15, s15.arr));
 
         EnregisterableUserType s16 = new EnregisterableUserType
         {
@@ -884,7 +884,7 @@ class Test
             }
         };
 
-        Assert.IsTrue(TakeEnregisterableUserTypeStructByVal(s16, s16.arr), "TakeEnregisterableUserTypeStructByVal");
+        Assert.True(TakeEnregisterableUserTypeStructByVal(s16, s16.arr));
     }
 
     static void RunTest2(string report)
@@ -893,62 +893,62 @@ class Test
 
         C_INTArray_Seq c1 = new C_INTArray_Seq();
         c1.arr = InitArray<int>(ARRAY_SIZE);
-        Assert.IsTrue(TakeIntArraySeqClassByVal(c1, c1.arr.Length));
+        Assert.True(TakeIntArraySeqClassByVal(c1, c1.arr.Length));
 
         C_UINTArray_Seq c2 = new C_UINTArray_Seq();
         c2.arr = InitArray<uint>(ARRAY_SIZE);
-        Assert.IsTrue(TakeUIntArraySeqClassByVal(c2, c2.arr.Length));
+        Assert.True(TakeUIntArraySeqClassByVal(c2, c2.arr.Length));
 
         C_SHORTArray_Seq c3 = new C_SHORTArray_Seq();
         c3.arr = InitArray<short>(ARRAY_SIZE);
-        Assert.IsTrue(TakeShortArraySeqClassByVal(c3, c3.arr.Length));
+        Assert.True(TakeShortArraySeqClassByVal(c3, c3.arr.Length));
 
         C_WORDArray_Seq c4 = new C_WORDArray_Seq();
         c4.arr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.IsTrue(TakeWordArraySeqClassByVal(c4, c4.arr.Length));
+        Assert.True(TakeWordArraySeqClassByVal(c4, c4.arr.Length));
 
         C_LONG64Array_Seq c5 = new C_LONG64Array_Seq();
         c5.arr = InitArray<long>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLong64ArraySeqClassByVal(c5, c5.arr.Length));
+        Assert.True(TakeLong64ArraySeqClassByVal(c5, c5.arr.Length));
 
         C_ULONG64Array_Seq c6 = new C_ULONG64Array_Seq();
         c6.arr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.IsTrue(TakeULong64ArraySeqClassByVal(c6, c6.arr.Length));
+        Assert.True(TakeULong64ArraySeqClassByVal(c6, c6.arr.Length));
 
         C_DOUBLEArray_Seq c7 = new C_DOUBLEArray_Seq();
         c7.arr = InitArray<double>(ARRAY_SIZE);
-        Assert.IsTrue(TakeDoubleArraySeqClassByVal(c7, c7.arr.Length));
+        Assert.True(TakeDoubleArraySeqClassByVal(c7, c7.arr.Length));
 
         C_FLOATArray_Seq c8 = new C_FLOATArray_Seq();
         c8.arr = InitArray<float>(ARRAY_SIZE);
-        Assert.IsTrue(TakeFloatArraySeqClassByVal(c8, c8.arr.Length));
+        Assert.True(TakeFloatArraySeqClassByVal(c8, c8.arr.Length));
 
         C_BYTEArray_Seq c9 = new C_BYTEArray_Seq();
         c9.arr = InitArray<byte>(ARRAY_SIZE);
-        Assert.IsTrue(TakeByteArraySeqClassByVal(c9, c9.arr.Length));
+        Assert.True(TakeByteArraySeqClassByVal(c9, c9.arr.Length));
 
         C_CHARArray_Seq c10 = new C_CHARArray_Seq();
         c10.arr = InitArray<char>(ARRAY_SIZE);
-        Assert.IsTrue(TakeCharArraySeqClassByVal(c10, c10.arr.Length));
+        Assert.True(TakeCharArraySeqClassByVal(c10, c10.arr.Length));
 
         C_LPSTRArray_Seq c11 = new C_LPSTRArray_Seq();
         c11.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLPSTRArraySeqClassByVal(c11, c11.arr.Length));
+        Assert.True(TakeLPSTRArraySeqClassByVal(c11, c11.arr.Length));
 
         C_LPCSTRArray_Seq c12 = new C_LPCSTRArray_Seq();
         c12.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLPCSTRArraySeqClassByVal(c12, c12.arr.Length));
+        Assert.True(TakeLPCSTRArraySeqClassByVal(c12, c12.arr.Length));
 
         if (OperatingSystem.IsWindows())
         {
             C_BSTRArray_Seq c13 = new C_BSTRArray_Seq();
             c13.arr = InitArray<string>(ARRAY_SIZE);
-            Assert.IsTrue(TakeBSTRArraySeqClassByVal(c13, c13.arr.Length));
+            Assert.True(TakeBSTRArraySeqClassByVal(c13, c13.arr.Length));
         }
 
         C_StructArray_Seq c14 = new C_StructArray_Seq();
         c14.arr = InitStructArray(ARRAY_SIZE);
-        Assert.IsTrue(TakeStructArraySeqClassByVal(c14, c14.arr.Length));
+        Assert.True(TakeStructArraySeqClassByVal(c14, c14.arr.Length));
     }
 
     static void RunTest3(string report)
@@ -957,62 +957,62 @@ class Test
 
         S_INTArray_Exp s1 = new S_INTArray_Exp();
         s1.arr = InitArray<int>(ARRAY_SIZE);
-        Assert.IsTrue(TakeIntArrayExpStructByVal(s1, s1.arr.Length), "TakeIntArrayExpStructByVal");
+        Assert.True(TakeIntArrayExpStructByVal(s1, s1.arr.Length));
 
         S_UINTArray_Exp s2 = new S_UINTArray_Exp();
         s2.arr = InitArray<uint>(ARRAY_SIZE);
-        Assert.IsTrue(TakeUIntArrayExpStructByVal(s2, s2.arr.Length), "TakeUIntArrayExpStructByVal");
+        Assert.True(TakeUIntArrayExpStructByVal(s2, s2.arr.Length));
 
         S_SHORTArray_Exp s3 = new S_SHORTArray_Exp();
         s3.arr = InitArray<short>(ARRAY_SIZE);
-        Assert.IsTrue(TakeShortArrayExpStructByVal(s3, s3.arr.Length), "TakeShortArrayExpStructByVal");
+        Assert.True(TakeShortArrayExpStructByVal(s3, s3.arr.Length));
 
         S_WORDArray_Exp s4 = new S_WORDArray_Exp();
         s4.arr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.IsTrue(TakeWordArrayExpStructByVal(s4, s4.arr.Length), "TakeWordArrayExpStructByVal");
+        Assert.True(TakeWordArrayExpStructByVal(s4, s4.arr.Length));
 
         S_LONG64Array_Exp s5 = new S_LONG64Array_Exp();
         s5.arr = InitArray<long>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLong64ArrayExpStructByVal(s5, s5.arr.Length), "TakeLong64ArrayExpStructByVal");
+        Assert.True(TakeLong64ArrayExpStructByVal(s5, s5.arr.Length));
 
         S_ULONG64Array_Exp s6 = new S_ULONG64Array_Exp();
         s6.arr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.IsTrue(TakeULong64ArrayExpStructByVal(s6, s6.arr.Length), "TakeULong64ArrayExpStructByVal");
+        Assert.True(TakeULong64ArrayExpStructByVal(s6, s6.arr.Length));
 
         S_DOUBLEArray_Exp s7 = new S_DOUBLEArray_Exp();
         s7.arr = InitArray<double>(ARRAY_SIZE);
-        Assert.IsTrue(TakeDoubleArrayExpStructByVal(s7, s7.arr.Length), "TakeDoubleArrayExpStructByVal");
+        Assert.True(TakeDoubleArrayExpStructByVal(s7, s7.arr.Length));
 
         S_FLOATArray_Exp s8 = new S_FLOATArray_Exp();
         s8.arr = InitArray<float>(ARRAY_SIZE);
-        Assert.IsTrue(TakeFloatArrayExpStructByVal(s8, s8.arr.Length), "TakeFloatArrayExpStructByVal");
+        Assert.True(TakeFloatArrayExpStructByVal(s8, s8.arr.Length));
 
         S_BYTEArray_Exp s9 = new S_BYTEArray_Exp();
         s9.arr = InitArray<byte>(ARRAY_SIZE);
-        Assert.IsTrue(TakeByteArrayExpStructByVal(s9, s9.arr.Length), "TakeByteArrayExpStructByVal");
+        Assert.True(TakeByteArrayExpStructByVal(s9, s9.arr.Length));
 
         S_CHARArray_Exp s10 = new S_CHARArray_Exp();
         s10.arr = InitArray<char>(ARRAY_SIZE);
-        Assert.IsTrue(TakeCharArrayExpStructByVal(s10, s10.arr.Length), "TakeCharArrayExpStructByVal");
+        Assert.True(TakeCharArrayExpStructByVal(s10, s10.arr.Length));
 
         S_LPSTRArray_Exp s11 = new S_LPSTRArray_Exp();
         s11.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLPSTRArrayExpStructByVal(s11, s11.arr.Length));
+        Assert.True(TakeLPSTRArrayExpStructByVal(s11, s11.arr.Length));
 
         S_LPCSTRArray_Exp s12 = new S_LPCSTRArray_Exp();
         s12.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLPCSTRArrayExpStructByVal(s12, s12.arr.Length));
+        Assert.True(TakeLPCSTRArrayExpStructByVal(s12, s12.arr.Length));
 
         if (OperatingSystem.IsWindows())
         {
             S_BSTRArray_Exp c13 = new S_BSTRArray_Exp();
             c13.arr = InitArray<string>(ARRAY_SIZE);
-            Assert.IsTrue(TakeBSTRArrayExpStructByVal(c13, c13.arr.Length));
+            Assert.True(TakeBSTRArrayExpStructByVal(c13, c13.arr.Length));
         }
 
         S_StructArray_Exp s14 = new S_StructArray_Exp();
         s14.arr = InitStructArray(ARRAY_SIZE);
-        Assert.IsTrue(TakeStructArrayExpStructByVal(s14, s14.arr.Length));
+        Assert.True(TakeStructArrayExpStructByVal(s14, s14.arr.Length));
     }
 
     static void RunTest4(string report)
@@ -1021,112 +1021,112 @@ class Test
 
         C_INTArray_Exp c1 = new C_INTArray_Exp();
         c1.arr = InitArray<int>(ARRAY_SIZE);
-        Assert.IsTrue(TakeIntArrayExpClassByVal(c1, c1.arr.Length));
+        Assert.True(TakeIntArrayExpClassByVal(c1, c1.arr.Length));
 
         C_UINTArray_Exp c2 = new C_UINTArray_Exp();
         c2.arr = InitArray<uint>(ARRAY_SIZE);
-        Assert.IsTrue(TakeUIntArrayExpClassByVal(c2, c2.arr.Length));
+        Assert.True(TakeUIntArrayExpClassByVal(c2, c2.arr.Length));
 
         C_SHORTArray_Exp c3 = new C_SHORTArray_Exp();
         c3.arr = InitArray<short>(ARRAY_SIZE);
-        Assert.IsTrue(TakeShortArrayExpClassByVal(c3, c3.arr.Length));
+        Assert.True(TakeShortArrayExpClassByVal(c3, c3.arr.Length));
 
         C_WORDArray_Exp c4 = new C_WORDArray_Exp();
         c4.arr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.IsTrue(TakeWordArrayExpClassByVal(c4, c4.arr.Length));
+        Assert.True(TakeWordArrayExpClassByVal(c4, c4.arr.Length));
 
         C_LONG64Array_Exp c5 = new C_LONG64Array_Exp();
         c5.arr = InitArray<long>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLong64ArrayExpClassByVal(c5, c5.arr.Length));
+        Assert.True(TakeLong64ArrayExpClassByVal(c5, c5.arr.Length));
 
         C_ULONG64Array_Exp c6 = new C_ULONG64Array_Exp();
         c6.arr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.IsTrue(TakeULong64ArrayExpClassByVal(c6, c6.arr.Length));
+        Assert.True(TakeULong64ArrayExpClassByVal(c6, c6.arr.Length));
 
         C_DOUBLEArray_Exp c7 = new C_DOUBLEArray_Exp();
         c7.arr = InitArray<double>(ARRAY_SIZE);
-        Assert.IsTrue(TakeDoubleArrayExpClassByVal(c7, c7.arr.Length));
+        Assert.True(TakeDoubleArrayExpClassByVal(c7, c7.arr.Length));
 
         C_FLOATArray_Exp c8 = new C_FLOATArray_Exp();
         c8.arr = InitArray<float>(ARRAY_SIZE);
-        Assert.IsTrue(TakeFloatArrayExpClassByVal(c8, c8.arr.Length));
+        Assert.True(TakeFloatArrayExpClassByVal(c8, c8.arr.Length));
 
         C_BYTEArray_Exp c9 = new C_BYTEArray_Exp();
         c9.arr = InitArray<byte>(ARRAY_SIZE);
-        Assert.IsTrue(TakeByteArrayExpClassByVal(c9, c9.arr.Length));
+        Assert.True(TakeByteArrayExpClassByVal(c9, c9.arr.Length));
 
         C_CHARArray_Exp c10 = new C_CHARArray_Exp();
         c10.arr = InitArray<char>(ARRAY_SIZE);
-        Assert.IsTrue(TakeCharArrayExpClassByVal(c10, c10.arr.Length));
+        Assert.True(TakeCharArrayExpClassByVal(c10, c10.arr.Length));
 
         C_LPSTRArray_Exp c11 = new C_LPSTRArray_Exp();
         c11.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLPSTRArrayExpClassByVal(c11, c11.arr.Length));
+        Assert.True(TakeLPSTRArrayExpClassByVal(c11, c11.arr.Length));
 
         C_LPCSTRArray_Exp c12 = new C_LPCSTRArray_Exp();
         c12.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.IsTrue(TakeLPCSTRArrayExpClassByVal(c12, c12.arr.Length));
+        Assert.True(TakeLPCSTRArrayExpClassByVal(c12, c12.arr.Length));
 
         if (OperatingSystem.IsWindows())
         {
             C_BSTRArray_Exp c13 = new C_BSTRArray_Exp();
             c13.arr = InitArray<string>(ARRAY_SIZE);
-            Assert.IsTrue(TakeBSTRArrayExpClassByVal(c13, c13.arr.Length));
+            Assert.True(TakeBSTRArrayExpClassByVal(c13, c13.arr.Length));
         }
 
         C_StructArray_Exp c14 = new C_StructArray_Exp();
         c14.arr = InitStructArray(ARRAY_SIZE);
-        Assert.IsTrue(TakeStructArrayExpClassByVal(c14, c14.arr.Length));
+        Assert.True(TakeStructArrayExpClassByVal(c14, c14.arr.Length));
     }
 
     static void RunTest5(string report)
     {
         Console.WriteLine(report);
-        
+
         S_INTArray_Seq retval = S_INTArray_Ret_ByValue();
-        Assert.IsTrue(Equals(InitArray<int>(ARRAY_SIZE), retval.arr));
+        Assert.True(Equals(InitArray<int>(ARRAY_SIZE), retval.arr));
 
         C_INTArray_Seq retval1 = S_INTArray_Ret();
-        Assert.IsTrue(Equals(InitArray<int>(ARRAY_SIZE), retval1.arr));
+        Assert.True(Equals(InitArray<int>(ARRAY_SIZE), retval1.arr));
 
         C_UINTArray_Seq retval2 = S_UINTArray_Ret();
-        Assert.IsTrue(Equals(InitArray<uint>(ARRAY_SIZE), retval2.arr));
+        Assert.True(Equals(InitArray<uint>(ARRAY_SIZE), retval2.arr));
 
         C_SHORTArray_Seq retval3 = S_SHORTArray_Ret();
-        Assert.IsTrue(Equals(InitArray<short>(ARRAY_SIZE), retval3.arr));
+        Assert.True(Equals(InitArray<short>(ARRAY_SIZE), retval3.arr));
 
         C_WORDArray_Seq retval4 = S_WORDArray_Ret();
-        Assert.IsTrue(Equals(InitArray<ushort>(ARRAY_SIZE), retval4.arr));
+        Assert.True(Equals(InitArray<ushort>(ARRAY_SIZE), retval4.arr));
 
         C_LONG64Array_Seq retval5 = S_LONG64Array_Ret();
-        Assert.IsTrue(Equals(InitArray<long>(ARRAY_SIZE), retval5.arr));
+        Assert.True(Equals(InitArray<long>(ARRAY_SIZE), retval5.arr));
 
         C_ULONG64Array_Seq retval6 = S_ULONG64Array_Ret();
-        Assert.IsTrue(Equals(InitArray<ulong>(ARRAY_SIZE), retval6.arr));
+        Assert.True(Equals(InitArray<ulong>(ARRAY_SIZE), retval6.arr));
 
         C_DOUBLEArray_Seq retval7 = S_DOUBLEArray_Ret();
-        Assert.IsTrue(Equals(InitArray<double>(ARRAY_SIZE), retval7.arr));
+        Assert.True(Equals(InitArray<double>(ARRAY_SIZE), retval7.arr));
 
         C_FLOATArray_Seq retval8 = S_FLOATArray_Ret();
-        Assert.IsTrue(Equals(InitArray<float>(ARRAY_SIZE), retval8.arr));
+        Assert.True(Equals(InitArray<float>(ARRAY_SIZE), retval8.arr));
 
         C_BYTEArray_Seq retval9 = S_BYTEArray_Ret();
-        Assert.IsTrue(Equals(InitArray<byte>(ARRAY_SIZE), retval9.arr));
+        Assert.True(Equals(InitArray<byte>(ARRAY_SIZE), retval9.arr));
 
         C_CHARArray_Seq retval10 = S_CHARArray_Ret();
-        Assert.IsTrue(Equals(InitArray<char>(ARRAY_SIZE), retval10.arr));
+        Assert.True(Equals(InitArray<char>(ARRAY_SIZE), retval10.arr));
 
         C_LPSTRArray_Seq retval11 = S_LPSTRArray_Ret();
-        Assert.IsTrue(Equals(InitArray<string>(ARRAY_SIZE), retval11.arr));
+        Assert.True(Equals(InitArray<string>(ARRAY_SIZE), retval11.arr));
 
         if (OperatingSystem.IsWindows())
         {
             C_BSTRArray_Seq retval12 = S_BSTRArray_Ret();
-            Assert.IsTrue(Equals(InitArray<string>(ARRAY_SIZE), retval12.arr));
+            Assert.True(Equals(InitArray<string>(ARRAY_SIZE), retval12.arr));
         }
 
         C_StructArray_Seq retval13 = S_StructArray_Ret();
-        Assert.IsTrue(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr));
+        Assert.True(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr));
     }
 
     static void RunTest6(string report)
@@ -1134,46 +1134,46 @@ class Test
         Console.WriteLine(report);
 
         C_INTArray_Exp retval1 = S_INTArray_Ret2();
-        Assert.IsTrue(Equals(InitArray<int>(ARRAY_SIZE), retval1.arr));
+        Assert.True(Equals(InitArray<int>(ARRAY_SIZE), retval1.arr));
 
         C_UINTArray_Exp retval2 = S_UINTArray_Ret2();
-        Assert.IsTrue(Equals(InitArray<uint>(ARRAY_SIZE), retval2.arr));
+        Assert.True(Equals(InitArray<uint>(ARRAY_SIZE), retval2.arr));
 
         C_SHORTArray_Exp retval3 = S_SHORTArray_Ret2();
-        Assert.IsTrue(Equals(InitArray<short>(ARRAY_SIZE), retval3.arr));
+        Assert.True(Equals(InitArray<short>(ARRAY_SIZE), retval3.arr));
 
         C_WORDArray_Exp retval4 = S_WORDArray_Ret2();
-        Assert.IsTrue(Equals(InitArray<ushort>(ARRAY_SIZE), retval4.arr));
+        Assert.True(Equals(InitArray<ushort>(ARRAY_SIZE), retval4.arr));
 
         C_LONG64Array_Exp retval5 = S_LONG64Array_Ret2();
-        Assert.IsTrue(Equals(InitArray<long>(ARRAY_SIZE), retval5.arr));
+        Assert.True(Equals(InitArray<long>(ARRAY_SIZE), retval5.arr));
 
         C_ULONG64Array_Exp retval6 = S_ULONG64Array_Ret2();
-        Assert.IsTrue(Equals(InitArray<ulong>(ARRAY_SIZE), retval6.arr));
+        Assert.True(Equals(InitArray<ulong>(ARRAY_SIZE), retval6.arr));
 
         C_DOUBLEArray_Exp retval7 = S_DOUBLEArray_Ret2();
-        Assert.IsTrue(Equals(InitArray<double>(ARRAY_SIZE), retval7.arr));
+        Assert.True(Equals(InitArray<double>(ARRAY_SIZE), retval7.arr));
 
         C_FLOATArray_Exp retval8 = S_FLOATArray_Ret2();
-        Assert.IsTrue(Equals(InitArray<float>(ARRAY_SIZE), retval8.arr));
+        Assert.True(Equals(InitArray<float>(ARRAY_SIZE), retval8.arr));
 
         C_BYTEArray_Exp retval9 = S_BYTEArray_Ret2();
-        Assert.IsTrue(Equals(InitArray<byte>(ARRAY_SIZE), retval9.arr));
+        Assert.True(Equals(InitArray<byte>(ARRAY_SIZE), retval9.arr));
 
         C_CHARArray_Exp retval10 = S_CHARArray_Ret2();
-        Assert.IsTrue(Equals(InitArray<char>(ARRAY_SIZE), retval10.arr));
+        Assert.True(Equals(InitArray<char>(ARRAY_SIZE), retval10.arr));
 
         C_LPSTRArray_Exp retval11 = S_LPSTRArray_Ret2();
-        Assert.IsTrue(Equals(InitArray<string>(ARRAY_SIZE), retval11.arr));
+        Assert.True(Equals(InitArray<string>(ARRAY_SIZE), retval11.arr));
 
         if (OperatingSystem.IsWindows())
         {
             C_BSTRArray_Exp retval12 = S_BSTRArray_Ret2();
-            Assert.IsTrue(Equals(InitArray<string>(ARRAY_SIZE), retval12.arr));
+            Assert.True(Equals(InitArray<string>(ARRAY_SIZE), retval12.arr));
         }
 
         C_StructArray_Exp retval13 = S_StructArray_Ret2();
-        Assert.IsTrue(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr));
+        Assert.True(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr));
     }
 
     static int Main(string[] args)
@@ -1186,7 +1186,7 @@ class Test
             RunTest4("RunTest4 : Marshal array as field as ByValArray in explicit class as parameter.");
             RunTest5("RunTest5 : Marshal array as field as ByValArray in sequential class as return type.");
             RunTest6("RunTest6 : Marshal array as field as ByValArray in explicit class as return type.");
-        
+
             Console.WriteLine("\nTest PASS.");
             return 100;
         }
index 70b9618..b2de3fe 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 class Test
 {
@@ -172,62 +172,62 @@ class Test
         Console.WriteLine(report);
         S_INTArray_Seq s1 = new S_INTArray_Seq();
         s1.arr = InitArray<int>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeIntArraySeqStructByVal(s1, ARRAY_SIZE), "TakeIntArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeIntArraySeqStructByVal(s1, ARRAY_SIZE));
 
         S_UINTArray_Seq s2 = new S_UINTArray_Seq();
         s2.arr = InitArray<uint>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeUIntArraySeqStructByVal(s2, ARRAY_SIZE), "TakeUIntArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeUIntArraySeqStructByVal(s2, ARRAY_SIZE));
 
         S_SHORTArray_Seq s3 = new S_SHORTArray_Seq();
         s3.arr = InitArray<short>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeShortArraySeqStructByVal(s3, ARRAY_SIZE), "TakeShortArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeShortArraySeqStructByVal(s3, ARRAY_SIZE));
 
         S_WORDArray_Seq s4 = new S_WORDArray_Seq();
         s4.arr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeWordArraySeqStructByVal(s4, ARRAY_SIZE), "TakeWordArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeWordArraySeqStructByVal(s4, ARRAY_SIZE));
 
         S_LONG64Array_Seq s5 = new S_LONG64Array_Seq();
         s5.arr = InitArray<long>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLong64ArraySeqStructByVal(s5, ARRAY_SIZE), "TakeLong64ArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLong64ArraySeqStructByVal(s5, ARRAY_SIZE));
 
         S_ULONG64Array_Seq s6 = new S_ULONG64Array_Seq();
         s6.arr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeULong64ArraySeqStructByVal(s6, ARRAY_SIZE), "TakeULong64ArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeULong64ArraySeqStructByVal(s6, ARRAY_SIZE));
 
         S_DOUBLEArray_Seq s7 = new S_DOUBLEArray_Seq();
         s7.arr = InitArray<double>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeDoubleArraySeqStructByVal(s7, ARRAY_SIZE), "TakeDoubleArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeDoubleArraySeqStructByVal(s7, ARRAY_SIZE));
 
         S_FLOATArray_Seq s8 = new S_FLOATArray_Seq();
         s8.arr = InitArray<float>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeFloatArraySeqStructByVal(s8, ARRAY_SIZE), "TakeFloatArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeFloatArraySeqStructByVal(s8, ARRAY_SIZE));
 
         S_BYTEArray_Seq s9 = new S_BYTEArray_Seq();
         s9.arr = InitArray<byte>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeByteArraySeqStructByVal(s9, ARRAY_SIZE), "TakeByteArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeByteArraySeqStructByVal(s9, ARRAY_SIZE));
 
         S_CHARArray_Seq s10 = new S_CHARArray_Seq();
         s10.arr = InitArray<char>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeCharArraySeqStructByVal(s10, ARRAY_SIZE), "TakeCharArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeCharArraySeqStructByVal(s10, ARRAY_SIZE));
 
         S_LPSTRArray_Seq s11 = new S_LPSTRArray_Seq();
         s11.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLPSTRArraySeqStructByVal(s11, ARRAY_SIZE), "TakeLPSTRArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLPSTRArraySeqStructByVal(s11, ARRAY_SIZE));
 
         S_LPCSTRArray_Seq s12 = new S_LPCSTRArray_Seq();
         s12.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLPCSTRArraySeqStructByVal(s12, ARRAY_SIZE), "TakeLPCSTRArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLPCSTRArraySeqStructByVal(s12, ARRAY_SIZE));
 
         if (OperatingSystem.IsWindows())
         {
             S_BSTRArray_Seq s13 = new S_BSTRArray_Seq();
             s13.arr = InitArray<string>(ARRAY_SIZE);
-            Assert.Throws<TypeLoadException>(() => TakeBSTRArraySeqStructByVal(s13, ARRAY_SIZE), "TakeBSTRArraySeqStructByVal"); 
+            Assert.Throws<TypeLoadException>(() => TakeBSTRArraySeqStructByVal(s13, ARRAY_SIZE));
         }
 
         S_StructArray_Seq s14 = new S_StructArray_Seq();
         s14.arr = InitStructArray(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeStructArraySeqStructByVal(s14, ARRAY_SIZE), "TakeStructArraySeqStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeStructArraySeqStructByVal(s14, ARRAY_SIZE));
     }
 
     static void RunTest2(string report)
@@ -235,62 +235,62 @@ class Test
         Console.WriteLine(report);
         C_INTArray_Seq c1 = new C_INTArray_Seq();
         c1.arr = InitArray<int>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeIntArraySeqClassByVal(c1, ARRAY_SIZE), "TakeIntArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeIntArraySeqClassByVal(c1, ARRAY_SIZE));
 
         C_UINTArray_Seq c2 = new C_UINTArray_Seq();
         c2.arr = InitArray<uint>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeUIntArraySeqClassByVal(c2, ARRAY_SIZE), "TakeUIntArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeUIntArraySeqClassByVal(c2, ARRAY_SIZE));
 
         C_SHORTArray_Seq c3 = new C_SHORTArray_Seq();
         c3.arr = InitArray<short>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeShortArraySeqClassByVal(c3, ARRAY_SIZE), "TakeShortArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeShortArraySeqClassByVal(c3, ARRAY_SIZE));
 
         C_WORDArray_Seq c4 = new C_WORDArray_Seq();
         c4.arr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeWordArraySeqClassByVal(c4, ARRAY_SIZE), "TakeWordArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeWordArraySeqClassByVal(c4, ARRAY_SIZE));
 
         C_LONG64Array_Seq c5 = new C_LONG64Array_Seq();
         c5.arr = InitArray<long>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLong64ArraySeqClassByVal(c5, ARRAY_SIZE), "TakeLong64ArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLong64ArraySeqClassByVal(c5, ARRAY_SIZE));
 
         C_ULONG64Array_Seq c6 = new C_ULONG64Array_Seq();
         c6.arr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeULong64ArraySeqClassByVal(c6, ARRAY_SIZE), "TakeULong64ArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeULong64ArraySeqClassByVal(c6, ARRAY_SIZE));
 
         C_DOUBLEArray_Seq c7 = new C_DOUBLEArray_Seq();
         c7.arr = InitArray<double>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeDoubleArraySeqClassByVal(c7, ARRAY_SIZE), "TakeDoubleArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeDoubleArraySeqClassByVal(c7, ARRAY_SIZE));
 
         C_FLOATArray_Seq c8 = new C_FLOATArray_Seq();
         c8.arr = InitArray<float>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeFloatArraySeqClassByVal(c8, ARRAY_SIZE), "TakeFloatArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeFloatArraySeqClassByVal(c8, ARRAY_SIZE));
 
         C_BYTEArray_Seq c9 = new C_BYTEArray_Seq();
         c9.arr = InitArray<byte>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeByteArraySeqClassByVal(c9, ARRAY_SIZE), "TakeByteArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeByteArraySeqClassByVal(c9, ARRAY_SIZE));
 
         C_CHARArray_Seq c10 = new C_CHARArray_Seq();
         c10.arr = InitArray<char>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeCharArraySeqClassByVal(c10, ARRAY_SIZE), "TakeCharArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeCharArraySeqClassByVal(c10, ARRAY_SIZE));
 
         C_LPSTRArray_Seq c11 = new C_LPSTRArray_Seq();
         c11.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLPSTRArraySeqClassByVal(c11, ARRAY_SIZE), "TakeLPSTRArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLPSTRArraySeqClassByVal(c11, ARRAY_SIZE));
 
         C_LPCSTRArray_Seq c12 = new C_LPCSTRArray_Seq();
         c12.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLPCSTRArraySeqClassByVal(c12, ARRAY_SIZE), "TakeLPCSTRArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLPCSTRArraySeqClassByVal(c12, ARRAY_SIZE));
 
         if (OperatingSystem.IsWindows())
         {
             C_BSTRArray_Seq c13 = new C_BSTRArray_Seq();
             c13.arr = InitArray<string>(ARRAY_SIZE);
-            Assert.Throws<TypeLoadException>(() => TakeBSTRArraySeqClassByVal(c13, ARRAY_SIZE), "TakeBSTRArraySeqClassByVal"); 
+            Assert.Throws<TypeLoadException>(() => TakeBSTRArraySeqClassByVal(c13, ARRAY_SIZE));
         }
 
         C_StructArray_Seq c14 = new C_StructArray_Seq();
         c14.arr = InitStructArray(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeStructArraySeqClassByVal(c14, ARRAY_SIZE), "TakeStructArraySeqClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeStructArraySeqClassByVal(c14, ARRAY_SIZE));
     }
 
     static void RunTest3(string report)
@@ -299,62 +299,62 @@ class Test
 
         S_INTArray_Exp s1 = new S_INTArray_Exp();
         s1.arr = InitArray<int>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeIntArrayExpStructByVal(s1, ARRAY_SIZE), "TakeIntArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeIntArrayExpStructByVal(s1, ARRAY_SIZE));
 
         S_UINTArray_Exp s2 = new S_UINTArray_Exp();
         s2.arr = InitArray<uint>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeUIntArrayExpStructByVal(s2, ARRAY_SIZE), "TakeUIntArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeUIntArrayExpStructByVal(s2, ARRAY_SIZE));
 
         S_SHORTArray_Exp s3 = new S_SHORTArray_Exp();
         s3.arr = InitArray<short>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeShortArrayExpStructByVal(s3, ARRAY_SIZE), "TakeShortArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeShortArrayExpStructByVal(s3, ARRAY_SIZE));
 
         S_WORDArray_Exp s4 = new S_WORDArray_Exp();
         s4.arr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeWordArrayExpStructByVal(s4, ARRAY_SIZE), "TakeWordArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeWordArrayExpStructByVal(s4, ARRAY_SIZE));
 
         S_LONG64Array_Exp s5 = new S_LONG64Array_Exp();
         s5.arr = InitArray<long>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLong64ArrayExpStructByVal(s5, ARRAY_SIZE), "TakeLong64ArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLong64ArrayExpStructByVal(s5, ARRAY_SIZE));
 
         S_ULONG64Array_Exp s6 = new S_ULONG64Array_Exp();
         s6.arr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeULong64ArrayExpStructByVal(s6, ARRAY_SIZE), "TakeULong64ArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeULong64ArrayExpStructByVal(s6, ARRAY_SIZE));
 
         S_DOUBLEArray_Exp s7 = new S_DOUBLEArray_Exp();
         s7.arr = InitArray<double>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeDoubleArrayExpStructByVal(s7, ARRAY_SIZE), "TakeDoubleArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeDoubleArrayExpStructByVal(s7, ARRAY_SIZE));
 
         S_FLOATArray_Exp s8 = new S_FLOATArray_Exp();
         s8.arr = InitArray<float>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeFloatArrayExpStructByVal(s8, ARRAY_SIZE), "TakeFloatArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeFloatArrayExpStructByVal(s8, ARRAY_SIZE));
 
         S_BYTEArray_Exp s9 = new S_BYTEArray_Exp();
         s9.arr = InitArray<byte>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeByteArrayExpStructByVal(s9, ARRAY_SIZE), "TakeByteArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeByteArrayExpStructByVal(s9, ARRAY_SIZE));
 
         S_CHARArray_Exp s10 = new S_CHARArray_Exp();
         s10.arr = InitArray<char>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeCharArrayExpStructByVal(s10, ARRAY_SIZE), "TakeCharArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeCharArrayExpStructByVal(s10, ARRAY_SIZE));
 
         S_LPSTRArray_Exp s11 = new S_LPSTRArray_Exp();
         s11.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLPSTRArrayExpStructByVal(s11, ARRAY_SIZE), "TakeLPSTRArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLPSTRArrayExpStructByVal(s11, ARRAY_SIZE));
 
         S_LPCSTRArray_Exp s12 = new S_LPCSTRArray_Exp();
         s12.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLPCSTRArrayExpStructByVal(s12, ARRAY_SIZE), "TakeLPCSTRArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLPCSTRArrayExpStructByVal(s12, ARRAY_SIZE));
 
         if (OperatingSystem.IsWindows())
         {
             S_BSTRArray_Exp s13 = new S_BSTRArray_Exp();
             s13.arr = InitArray<string>(ARRAY_SIZE);
-            Assert.Throws<TypeLoadException>(() => TakeBSTRArrayExpStructByVal(s13, ARRAY_SIZE), "TakeBSTRArrayExpStructByVal"); 
+            Assert.Throws<TypeLoadException>(() => TakeBSTRArrayExpStructByVal(s13, ARRAY_SIZE));
         }
 
         S_StructArray_Exp s14 = new S_StructArray_Exp();
         s14.arr = InitStructArray(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeStructArrayExpStructByVal(s14, ARRAY_SIZE), "TakeStructArrayExpStructByVal");
+        Assert.Throws<TypeLoadException>(() => TakeStructArrayExpStructByVal(s14, ARRAY_SIZE));
     }
 
     static void RunTest4(string report)
@@ -363,62 +363,62 @@ class Test
 
         C_INTArray_Exp c1 = new C_INTArray_Exp();
         c1.arr = InitArray<int>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeIntArrayExpClassByVal(c1, ARRAY_SIZE), "TakeIntArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeIntArrayExpClassByVal(c1, ARRAY_SIZE));
 
         C_UINTArray_Exp c2 = new C_UINTArray_Exp();
         c2.arr = InitArray<uint>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeUIntArrayExpClassByVal(c2, ARRAY_SIZE), "TakeUIntArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeUIntArrayExpClassByVal(c2, ARRAY_SIZE));
 
         C_SHORTArray_Exp c3 = new C_SHORTArray_Exp();
         c3.arr = InitArray<short>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeShortArrayExpClassByVal(c3, ARRAY_SIZE), "TakeShortArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeShortArrayExpClassByVal(c3, ARRAY_SIZE));
 
         C_WORDArray_Exp c4 = new C_WORDArray_Exp();
         c4.arr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeWordArrayExpClassByVal(c4, ARRAY_SIZE), "TakeWordArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeWordArrayExpClassByVal(c4, ARRAY_SIZE));
 
         C_LONG64Array_Exp c5 = new C_LONG64Array_Exp();
         c5.arr = InitArray<long>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLong64ArrayExpClassByVal(c5, ARRAY_SIZE), "TakeLong64ArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLong64ArrayExpClassByVal(c5, ARRAY_SIZE));
 
         C_ULONG64Array_Exp c6 = new C_ULONG64Array_Exp();
         c6.arr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeULong64ArrayExpClassByVal(c6, ARRAY_SIZE), "TakeULong64ArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeULong64ArrayExpClassByVal(c6, ARRAY_SIZE));
 
         C_DOUBLEArray_Exp c7 = new C_DOUBLEArray_Exp();
         c7.arr = InitArray<double>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeDoubleArrayExpClassByVal(c7, ARRAY_SIZE), "TakeDoubleArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeDoubleArrayExpClassByVal(c7, ARRAY_SIZE));
 
         C_FLOATArray_Exp c8 = new C_FLOATArray_Exp();
         c8.arr = InitArray<float>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeFloatArrayExpClassByVal(c8, ARRAY_SIZE), "TakeFloatArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeFloatArrayExpClassByVal(c8, ARRAY_SIZE));
 
         C_BYTEArray_Exp c9 = new C_BYTEArray_Exp();
         c9.arr = InitArray<byte>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeByteArrayExpClassByVal(c9, ARRAY_SIZE), "TakeByteArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeByteArrayExpClassByVal(c9, ARRAY_SIZE));
 
         C_CHARArray_Exp c10 = new C_CHARArray_Exp();
         c10.arr = InitArray<char>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeCharArrayExpClassByVal(c10, ARRAY_SIZE), "TakeCharArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeCharArrayExpClassByVal(c10, ARRAY_SIZE));
 
         C_LPSTRArray_Exp c11 = new C_LPSTRArray_Exp();
         c11.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLPSTRArrayExpClassByVal(c11, ARRAY_SIZE), "TakeLPSTRArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLPSTRArrayExpClassByVal(c11, ARRAY_SIZE));
 
         C_LPCSTRArray_Exp c12 = new C_LPCSTRArray_Exp();
         c12.arr = InitArray<string>(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeLPCSTRArrayExpClassByVal(c12, ARRAY_SIZE), "TakeLPCSTRArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeLPCSTRArrayExpClassByVal(c12, ARRAY_SIZE));
 
         if (OperatingSystem.IsWindows())
         {
             C_BSTRArray_Exp c13 = new C_BSTRArray_Exp();
             c13.arr = InitArray<string>(ARRAY_SIZE);
-            Assert.Throws<TypeLoadException>(() => TakeBSTRArrayExpClassByVal(c13, ARRAY_SIZE), "TakeBSTRArrayExpClassByVal"); 
+            Assert.Throws<TypeLoadException>(() => TakeBSTRArrayExpClassByVal(c13, ARRAY_SIZE));
         }
 
         C_StructArray_Exp c14 = new C_StructArray_Exp();
         c14.arr = InitStructArray(ARRAY_SIZE);
-        Assert.Throws<TypeLoadException>(() => TakeStructArrayExpClassByVal(c14, ARRAY_SIZE), "TakeStructArrayExpClassByVal");
+        Assert.Throws<TypeLoadException>(() => TakeStructArrayExpClassByVal(c14, ARRAY_SIZE));
     }
 
     static int Main(string[] args)
@@ -429,7 +429,7 @@ class Test
             RunTest2("RunTest 2 : Marshal Array In Sequential Class As LPArray. ");
             if (OperatingSystem.IsWindows())
             {
-                RunTest3("RunTest 3 : Marshal Array In Explicit Struct As LPArray. "); 
+                RunTest3("RunTest 3 : Marshal Array In Explicit Struct As LPArray. ");
             }
             RunTest4("RunTest 4 : Marshal Array In Explicit Class As LPArray. ");
             Console.WriteLine("\nTest PASS.");
index d30ef8b..afc96f9 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class ArrayMarshal
 {
@@ -314,32 +314,32 @@ public class ArrayMarshal
     {
         Console.WriteLine("ByVal marshaling CLR array as c-style-array no attributes");
 
-        Assert.IsTrue(CStyle_Array_Int(InitArray<int>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Int");
-        Assert.IsTrue(CStyle_Array_Uint(InitArray<uint>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Uint") ;
-        Assert.IsTrue(CStyle_Array_Short(InitArray<short>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Short");
-        Assert.IsTrue(CStyle_Array_Word(InitArray<ushort>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Word");
-        Assert.IsTrue(CStyle_Array_Long64(InitArray<long>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Long64");
-        Assert.IsTrue(CStyle_Array_ULong64(InitArray<ulong>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_ULong64");
-        Assert.IsTrue(CStyle_Array_Double(InitArray<double>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Double");
-        Assert.IsTrue(CStyle_Array_Float(InitArray<float>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Float");
-        Assert.IsTrue(CStyle_Array_Byte(InitArray<byte>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Byte");
-        Assert.IsTrue(CStyle_Array_Char(InitArray<char>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Char");
+        Assert.True(CStyle_Array_Int(InitArray<int>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Uint(InitArray<uint>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Uint") ;
+        Assert.True(CStyle_Array_Short(InitArray<short>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Short");
+        Assert.True(CStyle_Array_Word(InitArray<ushort>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Word");
+        Assert.True(CStyle_Array_Long64(InitArray<long>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Long64");
+        Assert.True(CStyle_Array_ULong64(InitArray<ulong>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_ULong64");
+        Assert.True(CStyle_Array_Double(InitArray<double>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Double");
+        Assert.True(CStyle_Array_Float(InitArray<float>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Float");
+        Assert.True(CStyle_Array_Byte(InitArray<byte>(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Byte");
+        Assert.True(CStyle_Array_Char(InitArray<char>(ARRAY_SIZE), ARRAY_SIZE));
 
         string[] strArr = InitArray<string>(ARRAY_SIZE);
         // Test nesting null value scenario
         strArr[strArr.Length / 2] = null;
-        Assert.IsTrue(CStyle_Array_LPCSTR(strArr, ARRAY_SIZE), "CStyle_Array_LPCSTR");
-        Assert.IsTrue(CStyle_Array_LPSTR(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR");
-        Assert.IsTrue(CStyle_Array_Struct(InitStructArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Struct");
+        Assert.True(CStyle_Array_LPCSTR(strArr, ARRAY_SIZE));
+        Assert.True(CStyle_Array_LPSTR(strArr, ARRAY_SIZE));
+        Assert.True(CStyle_Array_Struct(InitStructArray(ARRAY_SIZE), ARRAY_SIZE));
 
-        Assert.IsTrue(CStyle_Array_Bool(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Bool");
+        Assert.True(CStyle_Array_Bool(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE));
 
         if (OperatingSystem.IsWindows())
         {
             object[] oArr = InitArray<object>(ARRAY_SIZE);
             // Test nesting null value scenario
             oArr[oArr.Length / 2] = null;
-            Assert.IsTrue(CStyle_Array_Object(oArr, ARRAY_SIZE), "CStyle_Array_Object"); 
+            Assert.True(CStyle_Array_Object(oArr, ARRAY_SIZE));
         }
     }
 
@@ -347,31 +347,31 @@ public class ArrayMarshal
     {
         Console.WriteLine("ByVal marshaling  CLR array as c-style-array with InAttribute applied");
 
-        Assert.IsTrue(CStyle_Array_Int_In(InitArray<int>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Int_In");
-        Assert.IsTrue(CStyle_Array_Uint_In(InitArray<uint>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Uint_In");
-        Assert.IsTrue(CStyle_Array_Short_In(InitArray<short>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Short_In");
-        Assert.IsTrue(CStyle_Array_Word_In(InitArray<ushort>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Word_In");
-        Assert.IsTrue(CStyle_Array_Long64_In(InitArray<long>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Long64_In");
-        Assert.IsTrue(CStyle_Array_ULong64_In(InitArray<ulong>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_ULong64_In");
-        Assert.IsTrue(CStyle_Array_Double_In(InitArray<double>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Double_In");
-        Assert.IsTrue(CStyle_Array_Float_In(InitArray<float>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Float_In");
-        Assert.IsTrue(CStyle_Array_Byte_In(InitArray<byte>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Byte_In");
-        Assert.IsTrue(CStyle_Array_Char_In(InitArray<char>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Char_In");
+        Assert.True(CStyle_Array_Int_In(InitArray<int>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Uint_In(InitArray<uint>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Short_In(InitArray<short>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Word_In(InitArray<ushort>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Long64_In(InitArray<long>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_ULong64_In(InitArray<ulong>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Double_In(InitArray<double>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Float_In(InitArray<float>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Byte_In(InitArray<byte>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Char_In(InitArray<char>(ARRAY_SIZE), ARRAY_SIZE));
 
         string[] strArr = InitArray<string>(ARRAY_SIZE);
         // Test nesting null value scenario
         strArr[strArr.Length / 2] = null;
 
-        Assert.IsTrue(CStyle_Array_LPCSTR_In(strArr, ARRAY_SIZE), "CStyle_Array_LPCSTR_In");
-        Assert.IsTrue(CStyle_Array_LPSTR_In(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_In");
-        Assert.IsTrue(CStyle_Array_Struct_In(InitStructArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Struct_In");
-        Assert.IsTrue(CStyle_Array_Bool_In(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Bool_In");
+        Assert.True(CStyle_Array_LPCSTR_In(strArr, ARRAY_SIZE));
+        Assert.True(CStyle_Array_LPSTR_In(strArr, ARRAY_SIZE));
+        Assert.True(CStyle_Array_Struct_In(InitStructArray(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Bool_In(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE));
         if (OperatingSystem.IsWindows())
         {
             object[] oArr = InitArray<object>(ARRAY_SIZE);
             // Test nesting null value scenario
             oArr[oArr.Length / 2] = null;
-            Assert.IsTrue(CStyle_Array_Object_In(oArr, ARRAY_SIZE), "CStyle_Array_Object_In"); 
+            Assert.True(CStyle_Array_Object_In(oArr, ARRAY_SIZE));
         }
     }
 
@@ -384,94 +384,94 @@ public class ArrayMarshal
         Console.WriteLine("By value marshaling CLR array as c-style-array with InAttribute and OutAttribute applied");
         Console.WriteLine("CStyle_Array_Int_InOut");
         int[] iArr = InitArray<int>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Int_InOut(iArr, ARRAY_SIZE), "CStyle_Array_Int_InOut");
-        Assert.IsTrue(Equals<int>(iArr, GetExpectedOutArray<int>(ARRAY_SIZE)), "CStyle_Array_Int_InOut:Equals<int>");
+        Assert.True(CStyle_Array_Int_InOut(iArr, ARRAY_SIZE));
+        Assert.True(Equals<int>(iArr, GetExpectedOutArray<int>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Int_InOut_Null");
         int[] iArrNull = null;
-        Assert.IsTrue(CStyle_Array_Int_InOut_Null(iArrNull), "CStyle_Array_Int_InOut_Null");
-        Assert.IsNull(iArrNull, "CStyle_Array_Int_InOut_Null:Equals<null>");
+        Assert.True(CStyle_Array_Int_InOut_Null(iArrNull));
+        Assert.Null(iArrNull);
 
         Console.WriteLine("CStyle_Array_Int_InOut_ZeroLength");
         int[] iArrLength0 = InitArray<int>(0);
-        Assert.IsTrue(CStyle_Array_Int_InOut_ZeroLength(iArrLength0), "CStyle_Array_Int_InOut_ZeroLength");
-        Assert.AreEqual(0, iArrLength0.Length, "CStyle_Array_Int_InOut_ZeroLength:Length<!0>");
+        Assert.True(CStyle_Array_Int_InOut_ZeroLength(iArrLength0));
+        Assert.Equal(0, iArrLength0.Length);
 
         Console.WriteLine("CStyle_Array_Uint_InOut");
         uint[] uiArr = InitArray<uint>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Uint_InOut(uiArr, ARRAY_SIZE), "CStyle_Array_Uint_InOut");
-        Assert.IsTrue(Equals<uint>(uiArr, GetExpectedOutArray<uint>(ARRAY_SIZE)), "CStyle_Array_Uint_InOut:Equals<uint>");
+        Assert.True(CStyle_Array_Uint_InOut(uiArr, ARRAY_SIZE));
+        Assert.True(Equals<uint>(uiArr, GetExpectedOutArray<uint>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Short_InOut");
         short[] sArr = InitArray<short>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Short_InOut(sArr, ARRAY_SIZE), "CStyle_Array_Short_InOut");
-        Assert.IsTrue(Equals<short>(sArr, GetExpectedOutArray<short>(ARRAY_SIZE)), "CStyle_Array_Short_InOut:Equals<short>");
+        Assert.True(CStyle_Array_Short_InOut(sArr, ARRAY_SIZE));
+        Assert.True(Equals<short>(sArr, GetExpectedOutArray<short>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Word_InOut");
         ushort[] usArr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Word_InOut(usArr, ARRAY_SIZE), "CStyle_Array_Word_InOut");
-        Assert.IsTrue(Equals<ushort>(usArr, GetExpectedOutArray<ushort>(ARRAY_SIZE)), "CStyle_Array_Word_InOut:Equals<ushort>");
+        Assert.True(CStyle_Array_Word_InOut(usArr, ARRAY_SIZE));
+        Assert.True(Equals<ushort>(usArr, GetExpectedOutArray<ushort>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Long64_InOut");
         long[] lArr = InitArray<long>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Long64_InOut(lArr, ARRAY_SIZE), "CStyle_Array_Long64_InOut");
-        Assert.IsTrue(Equals<long>(lArr, GetExpectedOutArray<long>(ARRAY_SIZE)), "CStyle_Array_Long64_InOut:Equals<long>");
+        Assert.True(CStyle_Array_Long64_InOut(lArr, ARRAY_SIZE));
+        Assert.True(Equals<long>(lArr, GetExpectedOutArray<long>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_ULong64_InOut");
         ulong[] ulArr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_ULong64_InOut(ulArr, ARRAY_SIZE), "CStyle_Array_ULong64_InOut");
-        Assert.IsTrue(Equals<ulong>(ulArr, GetExpectedOutArray<ulong>(ARRAY_SIZE)), "CStyle_Array_ULong64_InOut:Equals<ulong>");
+        Assert.True(CStyle_Array_ULong64_InOut(ulArr, ARRAY_SIZE));
+        Assert.True(Equals<ulong>(ulArr, GetExpectedOutArray<ulong>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Double_InOut");
         double[] dArr = InitArray<double>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Double_InOut(dArr, ARRAY_SIZE), "CStyle_Array_Double_InOut");
-        Assert.IsTrue(Equals<double>(dArr, GetExpectedOutArray<double>(ARRAY_SIZE)), "CStyle_Array_Double_InOut:Equals<double>");
+        Assert.True(CStyle_Array_Double_InOut(dArr, ARRAY_SIZE));
+        Assert.True(Equals<double>(dArr, GetExpectedOutArray<double>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Float_InOut");
         float[] fArr = InitArray<float>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Float_InOut(fArr, ARRAY_SIZE), "CStyle_Array_Float_InOut");
-        Assert.IsTrue(Equals<float>(fArr, GetExpectedOutArray<float>(ARRAY_SIZE)), "CStyle_Array_Float_InOut:Equals<float>");
+        Assert.True(CStyle_Array_Float_InOut(fArr, ARRAY_SIZE));
+        Assert.True(Equals<float>(fArr, GetExpectedOutArray<float>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Byte_InOut");
         byte[] bArr = InitArray<byte>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Byte_InOut(bArr, ARRAY_SIZE), "CStyle_Array_Byte_InOut");
-        Assert.IsTrue(Equals<byte>(bArr, GetExpectedOutArray<byte>(ARRAY_SIZE)), "CStyle_Array_Byte_InOut:Equals<byte>");
+        Assert.True(CStyle_Array_Byte_InOut(bArr, ARRAY_SIZE));
+        Assert.True(Equals<byte>(bArr, GetExpectedOutArray<byte>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Char_InOut");
         char[] cArr = InitArray<char>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Char_InOut(cArr, ARRAY_SIZE), "CStyle_Array_Char_InOut");
-        Assert.IsTrue(Equals<char>(cArr, GetExpectedOutArray<char>(ARRAY_SIZE)), "CStyle_Array_Char_InOut:Equals<char>");
+        Assert.True(CStyle_Array_Char_InOut(cArr, ARRAY_SIZE));
+        Assert.True(Equals<char>(cArr, GetExpectedOutArray<char>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_LPSTR_InOut");
         string[] strArr = InitArray<string>(ARRAY_SIZE);
         strArr[strArr.Length / 2] = null;
-        Assert.IsTrue(CStyle_Array_LPSTR_InOut(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_InOut");
+        Assert.True(CStyle_Array_LPSTR_InOut(strArr, ARRAY_SIZE));
         string[] expectedArr = GetExpectedOutArray<string>(ARRAY_SIZE);
         // Test nesting null value scenario
         expectedArr[expectedArr.Length / 2 - 1] = null;
-        Assert.IsTrue(Equals<string>(strArr, expectedArr), "CStyle_Array_LPSTR_InOut:Equals<string>");
+        Assert.True(Equals<string>(strArr, expectedArr));
 
         Console.WriteLine("CStyle_Array_Struct_InOut");
         TestStruct[] tsArr = InitStructArray(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Struct_InOut(tsArr, ARRAY_SIZE), "CStyle_Array_Struct_InOut");
-        Assert.IsTrue(Equals<TestStruct>(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)), "CStyle_Array_Struct_InOut:Equals<TestStruct>");
+        Assert.True(CStyle_Array_Struct_InOut(tsArr, ARRAY_SIZE));
+        Assert.True(Equals<TestStruct>(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Bool_InOut");
         bool[] boolArr = InitBoolArray(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Bool_InOut(boolArr, ARRAY_SIZE), "CStyle_Array_Bool_InOut");
-        Assert.IsTrue(Equals<bool>(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)), "CStyle_Array_Bool_InOut:Equals<bool>");
+        Assert.True(CStyle_Array_Bool_InOut(boolArr, ARRAY_SIZE));
+        Assert.True(Equals<bool>(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)));
 
         if (OperatingSystem.IsWindows())
         {
             Console.WriteLine("CStyle_Array_Object_InOut");
             object[] oArr = InitArray<object>(ARRAY_SIZE);
             oArr[oArr.Length / 2] = null;
-            Assert.IsTrue(CStyle_Array_Object_InOut(oArr, ARRAY_SIZE), "CStyle_Array_Object_InOut");
+            Assert.True(CStyle_Array_Object_InOut(oArr, ARRAY_SIZE));
 
             object[] expectedOArr = GetExpectedOutArray<object>(ARRAY_SIZE);
             // Test nesting null value scenario
             expectedOArr[expectedOArr.Length / 2 - 1] = null;
-            Assert.IsTrue(Equals<object>(oArr, expectedOArr), "CStyle_Array_Object_InOut:Equals<object>"); 
+            Assert.True(Equals<object>(oArr, expectedOArr));
         }
     }
 
@@ -549,91 +549,91 @@ public class ArrayMarshal
 
         Console.WriteLine("CStyle_Array_Int_Out");
         int[] iArr = new int[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Int_Out(iArr, ARRAY_SIZE), "CStyle_Array_Int_Out");
-        Assert.IsTrue(Equals<int>(iArr, GetExpectedOutArray<int>(ARRAY_SIZE)), "CStyle_Array_Int_Out:Equals<int>");
+        Assert.True(CStyle_Array_Int_Out(iArr, ARRAY_SIZE));
+        Assert.True(Equals<int>(iArr, GetExpectedOutArray<int>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Int_Out_Null");
         int[] iArrNull = null;
-        Assert.IsTrue(CStyle_Array_Int_Out_Null(iArrNull), "CStyle_Array_Int_Out_Null");
-        Assert.IsNull(iArrNull, "CStyle_Array_Int_Out_Null:Equals<null>");
+        Assert.True(CStyle_Array_Int_Out_Null(iArrNull));
+        Assert.Null(iArrNull);
 
         Console.WriteLine("CStyle_Array_Int_Out_ZeroLength");
         int[] iArrLength0 = new int[0];
-        Assert.IsTrue(CStyle_Array_Int_Out_ZeroLength(iArrLength0), "CStyle_Array_Int_Out_ZeroLength");
-        Assert.AreEqual(0, iArrLength0.Length, "CStyle_Array_Int_Out_ZeroLength:Length<!0>");
+        Assert.True(CStyle_Array_Int_Out_ZeroLength(iArrLength0));
+        Assert.Equal(0, iArrLength0.Length);
 
         Console.WriteLine("CStyle_Array_Uint_Out");
         uint[] uiArr = new uint[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Uint_Out(uiArr, ARRAY_SIZE), "CStyle_Array_Uint_Out");
-        Assert.IsTrue(Equals<uint>(uiArr, GetExpectedOutArray<uint>(ARRAY_SIZE)), "CStyle_Array_Uint_Out:Equals<uint>");
+        Assert.True(CStyle_Array_Uint_Out(uiArr, ARRAY_SIZE));
+        Assert.True(Equals<uint>(uiArr, GetExpectedOutArray<uint>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Short_Out");
         short[] sArr = new short[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Short_Out(sArr, ARRAY_SIZE), "CStyle_Array_Short_Out");
-        Assert.IsTrue(Equals<short>(sArr, GetExpectedOutArray<short>(ARRAY_SIZE)), "CStyle_Array_Short_Out:Equals<short>");
+        Assert.True(CStyle_Array_Short_Out(sArr, ARRAY_SIZE));
+        Assert.True(Equals<short>(sArr, GetExpectedOutArray<short>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Word_Out");
         ushort[] usArr = new ushort[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Word_Out(usArr, ARRAY_SIZE), "CStyle_Array_Word_Out");
-        Assert.IsTrue(Equals<ushort>(usArr, GetExpectedOutArray<ushort>(ARRAY_SIZE)), "CStyle_Array_Word_Out:Equals<ushort>");
+        Assert.True(CStyle_Array_Word_Out(usArr, ARRAY_SIZE));
+        Assert.True(Equals<ushort>(usArr, GetExpectedOutArray<ushort>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Long64_Out");
         long[] lArr = new long[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Long64_Out(lArr, ARRAY_SIZE), "CStyle_Array_Long64_Out");
-        Assert.IsTrue(Equals<long>(lArr, GetExpectedOutArray<long>(ARRAY_SIZE)), "CStyle_Array_Long64_Out:Equals<long>");
+        Assert.True(CStyle_Array_Long64_Out(lArr, ARRAY_SIZE));
+        Assert.True(Equals<long>(lArr, GetExpectedOutArray<long>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_ULong64_Out");
         ulong[] ulArr = new ulong[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_ULong64_Out(ulArr, ARRAY_SIZE), "CStyle_Array_ULong64_Out");
-        Assert.IsTrue(Equals<ulong>(ulArr, GetExpectedOutArray<ulong>(ARRAY_SIZE)), "CStyle_Array_ULong64_Out:Equals<ulong>");
+        Assert.True(CStyle_Array_ULong64_Out(ulArr, ARRAY_SIZE));
+        Assert.True(Equals<ulong>(ulArr, GetExpectedOutArray<ulong>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Double_Out");
         double[] dArr = new double[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Double_Out(dArr, ARRAY_SIZE), "CStyle_Array_Double_Out");
-        Assert.IsTrue(Equals<double>(dArr, GetExpectedOutArray<double>(ARRAY_SIZE)), "CStyle_Array_Double_Out:Equals<double>");
+        Assert.True(CStyle_Array_Double_Out(dArr, ARRAY_SIZE));
+        Assert.True(Equals<double>(dArr, GetExpectedOutArray<double>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Float_Out");
         float[] fArr = new float[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Float_Out(fArr, ARRAY_SIZE), "CStyle_Array_Float_Out");
-        Assert.IsTrue(Equals<float>(fArr, GetExpectedOutArray<float>(ARRAY_SIZE)), "CStyle_Array_Float_Out:Equals<float>");
+        Assert.True(CStyle_Array_Float_Out(fArr, ARRAY_SIZE));
+        Assert.True(Equals<float>(fArr, GetExpectedOutArray<float>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Byte_Out");
         byte[] bArr = new byte[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Byte_Out(bArr, ARRAY_SIZE), "CStyle_Array_Byte_Out");
-        Assert.IsTrue(Equals<byte>(bArr, GetExpectedOutArray<byte>(ARRAY_SIZE)), "CStyle_Array_Byte_Out:Equals<byte>");
+        Assert.True(CStyle_Array_Byte_Out(bArr, ARRAY_SIZE));
+        Assert.True(Equals<byte>(bArr, GetExpectedOutArray<byte>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Char_Out");
         char[] cArr = new char[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Char_Out(cArr, ARRAY_SIZE), "CStyle_Array_Char_Out");
-        Assert.IsTrue(Equals<char>(cArr, GetExpectedOutArray<char>(ARRAY_SIZE)), "CStyle_Array_Char_Out:Equals<char>");
+        Assert.True(CStyle_Array_Char_Out(cArr, ARRAY_SIZE));
+        Assert.True(Equals<char>(cArr, GetExpectedOutArray<char>(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_LPSTR_Out");
         string[] strArr = new string[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_LPSTR_Out(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_Out");
+        Assert.True(CStyle_Array_LPSTR_Out(strArr, ARRAY_SIZE));
         string[] expectedArr = GetExpectedOutArray<string>(ARRAY_SIZE);
         // Test nesting null value scenario
         expectedArr[expectedArr.Length / 2 - 1] = null;
-        Assert.IsTrue(Equals<string>(strArr, expectedArr), "CStyle_Array_LPSTR_Out:Equals<string>");
+        Assert.True(Equals<string>(strArr, expectedArr));
         Console.WriteLine("CStyle_Array_Struct_Out");
         TestStruct[] tsArr = new TestStruct[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Struct_Out(tsArr, ARRAY_SIZE), "CStyle_Array_Struct_Out");
-        Assert.IsTrue(Equals<TestStruct>(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)), "Equals<TestStruct>");
+        Assert.True(CStyle_Array_Struct_Out(tsArr, ARRAY_SIZE));
+        Assert.True(Equals<TestStruct>(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)));
 
         Console.WriteLine("CStyle_Array_Bool_Out");
         bool[] boolArr = new bool[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Bool_Out(boolArr, ARRAY_SIZE), "CStyle_Array_Bool_Out");
-        Assert.IsTrue(Equals<bool>(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)), "CStyle_Array_Bool_Out:Equals<bool>");
+        Assert.True(CStyle_Array_Bool_Out(boolArr, ARRAY_SIZE));
+        Assert.True(Equals<bool>(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)));
 
         if (OperatingSystem.IsWindows())
         {
             Console.WriteLine("CStyle_Array_Object_Out");
             object[] oArr = new object[ARRAY_SIZE];
-            Assert.IsTrue(CStyle_Array_Object_Out(oArr, ARRAY_SIZE), "CStyle_Array_Object_Out");
+            Assert.True(CStyle_Array_Object_Out(oArr, ARRAY_SIZE));
 
             object[] expectedOArr = GetExpectedOutArray<object>(ARRAY_SIZE);
             // Test nesting null value scenario
             expectedOArr[expectedOArr.Length / 2 - 1] = null;
-            Assert.IsTrue(Equals<object>(oArr, expectedOArr), "CStyle_Array_Object_Out:Equals<object>"); 
+            Assert.True(Equals<object>(oArr, expectedOArr));
         }
     }
 
@@ -649,7 +649,7 @@ public class ArrayMarshal
             sum += item;
         }
 
-        Assert.AreEqual(sum, Get_Multidimensional_Array_Sum(array, ROWS, COLUMNS));
+        Assert.Equal(sum, Get_Multidimensional_Array_Sum(array, ROWS, COLUMNS));
     }
 
     public static int Main()
@@ -661,7 +661,7 @@ public class ArrayMarshal
             TestMarshalInOut_ByVal();
             TestMarshalOut_ByVal();
             TestMultidimensional();
-            
+
             Console.WriteLine("\nTest PASS.");
             return 100;
         }
index b152744..899f15f 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class ArrayMarshal
 {
@@ -77,7 +77,7 @@ public class ArrayMarshal
 
     [DllImport("MarshalArrayLPArrayNative")]
     private static extern bool CStyle_Array_Bool([MarshalAs(UnmanagedType.LPArray)] bool[] actual, int cActual);
-    
+
     [DllImport("MarshalArrayLPArrayNative")]
     private static extern bool MarshalArrayOfStructAsLPArrayByVal([MarshalAs(UnmanagedType.LPArray, SizeConst = ARRAY_SIZE)] S2[] arrS2, int cActual, [In, MarshalAs(UnmanagedType.LPArray, SizeConst = ARRAY_SIZE)]S2[] pExpect);
 
@@ -129,7 +129,7 @@ public class ArrayMarshal
 
     [DllImport("MarshalArrayLPArrayNative", EntryPoint = "CStyle_Array_Bool")]
     private static extern bool CStyle_Array_Bool_In([In, MarshalAs(UnmanagedType.LPArray)] bool[] actual, int cActual);
-    
+
 
     [DllImport("MarshalArrayLPArrayNative", EntryPoint = "MarshalArrayOfStructAsLPArrayByVal")]
     private static extern bool MarshalArrayOfStructAsLPArrayByValIn([In, MarshalAs(UnmanagedType.LPArray, SizeConst = ARRAY_SIZE)] S2[] arrS2, int cActual, [In, MarshalAs(UnmanagedType.LPArray, SizeConst = ARRAY_SIZE)]S2[] pExpect);
@@ -195,7 +195,7 @@ public class ArrayMarshal
 
     [DllImport("MarshalArrayLPArrayNative")]
     private static extern bool CStyle_Array_Int_Out_Null([Out, MarshalAs(UnmanagedType.LPArray)] int[] actual);
-    
+
     [DllImport("MarshalArrayLPArrayNative")]
     private static extern bool CStyle_Array_Int_Out_ZeroLength([Out, MarshalAs(UnmanagedType.LPArray)] int[] actual);
 
@@ -297,64 +297,64 @@ public class ArrayMarshal
     {
         Console.WriteLine("ByVal marshaling CLR array as c-style-array no attributes");
 
-        Assert.IsTrue(CStyle_Array_Int(InitArray<int>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Int");
-        Assert.IsTrue(CStyle_Array_Uint(InitArray<uint>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Uint");
-        Assert.IsTrue(CStyle_Array_Short(InitArray<short>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Short");
-        Assert.IsTrue(CStyle_Array_Word(InitArray<ushort>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Word");
-        Assert.IsTrue(CStyle_Array_Long64(InitArray<long>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Long64");
-        Assert.IsTrue(CStyle_Array_ULong64(InitArray<ulong>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_ULong64");
-        Assert.IsTrue(CStyle_Array_Double(InitArray<double>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Double");
-        Assert.IsTrue(CStyle_Array_Float(InitArray<float>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Float");
-        Assert.IsTrue(CStyle_Array_Byte(InitArray<byte>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Byte");
-        Assert.IsTrue(CStyle_Array_Char(InitArray<char>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Char");
+        Assert.True(CStyle_Array_Int(InitArray<int>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Uint(InitArray<uint>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Short(InitArray<short>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Word(InitArray<ushort>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Long64(InitArray<long>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_ULong64(InitArray<ulong>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Double(InitArray<double>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Float(InitArray<float>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Byte(InitArray<byte>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Char(InitArray<char>(ARRAY_SIZE), ARRAY_SIZE));
 
         string[] strArr = InitArray<string>(ARRAY_SIZE);
         // Test nesting null value scenario
         strArr[strArr.Length / 2] = null;
-        Assert.IsTrue(CStyle_Array_LPCSTR(strArr, ARRAY_SIZE), "CStyle_Array_LPCSTR");
-        Assert.IsTrue(CStyle_Array_LPSTR(strArr, ARRAY_SIZE), "CStyle_Array_LPSTRs");
-        Assert.IsTrue(CStyle_Array_Struct(InitStructArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Struct");
-        Assert.IsTrue(CStyle_Array_Bool(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Bool");
+        Assert.True(CStyle_Array_LPCSTR(strArr, ARRAY_SIZE));
+        Assert.True(CStyle_Array_LPSTR(strArr, ARRAY_SIZE));
+        Assert.True(CStyle_Array_Struct(InitStructArray(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Bool(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE));
 
         if (OperatingSystem.IsWindows())
         {
             object[] oArr = InitArray<object>(ARRAY_SIZE);
             // Test nesting null value scenario
             oArr[oArr.Length / 2] = null;
-            Assert.IsTrue(CStyle_Array_Object(oArr, ARRAY_SIZE), "CStyle_Array_Object"); 
-        } 
-        
+            Assert.True(CStyle_Array_Object(oArr, ARRAY_SIZE));
+        }
+
     }
 
     private static void TestMarshalByVal_In()
     {
         Console.WriteLine("ByVal marshaling  CLR array as c-style-array with InAttribute applied");
 
-        Assert.IsTrue(CStyle_Array_Int_In(InitArray<int>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Int_In");
-        Assert.IsTrue(CStyle_Array_Uint_In(InitArray<uint>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Uint_In");
-        Assert.IsTrue(CStyle_Array_Short_In(InitArray<short>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Short_In");
-        Assert.IsTrue(CStyle_Array_Word_In(InitArray<ushort>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Word_In");
-        Assert.IsTrue(CStyle_Array_Long64_In(InitArray<long>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Long64_In");
-        Assert.IsTrue(CStyle_Array_ULong64_In(InitArray<ulong>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_ULong64_In");
-        Assert.IsTrue(CStyle_Array_Double_In(InitArray<double>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Double_In");
-        Assert.IsTrue(CStyle_Array_Float_In(InitArray<float>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Float_In");
-        Assert.IsTrue(CStyle_Array_Byte_In(InitArray<byte>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Byte_In");
-        Assert.IsTrue(CStyle_Array_Char_In(InitArray<char>(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Char_In");
+        Assert.True(CStyle_Array_Int_In(InitArray<int>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Uint_In(InitArray<uint>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Short_In(InitArray<short>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Word_In(InitArray<ushort>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Long64_In(InitArray<long>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_ULong64_In(InitArray<ulong>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Double_In(InitArray<double>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Float_In(InitArray<float>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Byte_In(InitArray<byte>(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Char_In(InitArray<char>(ARRAY_SIZE), ARRAY_SIZE));
 
         string[] strArr = InitArray<string>(ARRAY_SIZE);
         // Test nesting null value scenario
         strArr[strArr.Length / 2] = null;
-        Assert.IsTrue(CStyle_Array_LPCSTR_In(strArr, ARRAY_SIZE), "CStyle_Array_LPCSTR_In");
-        Assert.IsTrue(CStyle_Array_LPSTR_In(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_In");
-        Assert.IsTrue(CStyle_Array_Struct_In(InitStructArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Struct_In");
-        Assert.IsTrue(CStyle_Array_Bool_In(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Bool_In");
+        Assert.True(CStyle_Array_LPCSTR_In(strArr, ARRAY_SIZE));
+        Assert.True(CStyle_Array_LPSTR_In(strArr, ARRAY_SIZE));
+        Assert.True(CStyle_Array_Struct_In(InitStructArray(ARRAY_SIZE), ARRAY_SIZE));
+        Assert.True(CStyle_Array_Bool_In(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE));
 
         if (OperatingSystem.IsWindows())
         {
             object[] oArr = InitArray<object>(ARRAY_SIZE);
             // Test nesting null value scenario
             oArr[oArr.Length / 2] = null;
-            Assert.IsTrue(CStyle_Array_Object_In(oArr, ARRAY_SIZE), "CStyle_Array_Object_In"); 
+            Assert.True(CStyle_Array_Object_In(oArr, ARRAY_SIZE));
         }
     }
     #endregion
@@ -364,69 +364,69 @@ public class ArrayMarshal
     {
         Console.WriteLine("By value marshaling CLR array as c-style-array with InAttribute and OutAttribute applied");
         int[] iArr = InitArray<int>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Int_InOut(iArr, ARRAY_SIZE), "CStyle_Array_Int_InOut");
-        Assert.IsTrue(Equals<int>(iArr, GetExpectedOutArray<int>(ARRAY_SIZE)), "CStyle_Array_Int_InOut:Equals<int>");
+        Assert.True(CStyle_Array_Int_InOut(iArr, ARRAY_SIZE));
+        Assert.True(Equals<int>(iArr, GetExpectedOutArray<int>(ARRAY_SIZE)));
 
         int[] iArrNull = null;
-        Assert.IsTrue(CStyle_Array_Int_InOut_Null(iArrNull), "CStyle_Array_Int_InOut_Null");
-        Assert.IsNull(iArrNull, "CStyle_Array_Int_InOut_Null:Equals<null>");
+        Assert.True(CStyle_Array_Int_InOut_Null(iArrNull));
+        Assert.Null(iArrNull);
 
         int[] iArrLength0 = InitArray<int>(0);
-        Assert.IsTrue(CStyle_Array_Int_InOut_ZeroLength(iArrLength0), "CStyle_Array_Int_InOut_ZeroLength");
-        Assert.AreEqual(0, iArrLength0.Length, "CStyle_Array_Int_InOut_ZeroLength:Length<!0>");
+        Assert.True(CStyle_Array_Int_InOut_ZeroLength(iArrLength0));
+        Assert.Equal(0, iArrLength0.Length);
 
         uint[] uiArr = InitArray<uint>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Uint_InOut(uiArr, ARRAY_SIZE), "CStyle_Array_Uint_InOut");
-        Assert.IsTrue(Equals<uint>(uiArr, GetExpectedOutArray<uint>(ARRAY_SIZE)), "CStyle_Array_Uint_InOut:Equals<uint>");
+        Assert.True(CStyle_Array_Uint_InOut(uiArr, ARRAY_SIZE));
+        Assert.True(Equals<uint>(uiArr, GetExpectedOutArray<uint>(ARRAY_SIZE)));
 
         short[] sArr = InitArray<short>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Short_InOut(sArr, ARRAY_SIZE), "CStyle_Array_Short_InOut");
-        Assert.IsTrue(Equals<short>(sArr, GetExpectedOutArray<short>(ARRAY_SIZE)), "CStyle_Array_Short_InOut:Equals<short>");
+        Assert.True(CStyle_Array_Short_InOut(sArr, ARRAY_SIZE));
+        Assert.True(Equals<short>(sArr, GetExpectedOutArray<short>(ARRAY_SIZE)));
 
         ushort[] usArr = InitArray<ushort>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Word_InOut(usArr, ARRAY_SIZE), "CStyle_Array_Word_InOut");
-        Assert.IsTrue(Equals<ushort>(usArr, GetExpectedOutArray<ushort>(ARRAY_SIZE)), "CStyle_Array_Word_InOut:Equals<ushort>");
+        Assert.True(CStyle_Array_Word_InOut(usArr, ARRAY_SIZE));
+        Assert.True(Equals<ushort>(usArr, GetExpectedOutArray<ushort>(ARRAY_SIZE)));
 
         long[] lArr = InitArray<long>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Long64_InOut(lArr, ARRAY_SIZE), "CStyle_Array_Long64_InOut");
-        Assert.IsTrue(Equals<long>(lArr, GetExpectedOutArray<long>(ARRAY_SIZE)), "CStyle_Array_Long64_InOut:Equals<long>");
+        Assert.True(CStyle_Array_Long64_InOut(lArr, ARRAY_SIZE));
+        Assert.True(Equals<long>(lArr, GetExpectedOutArray<long>(ARRAY_SIZE)));
 
         ulong[] ulArr = InitArray<ulong>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_ULong64_InOut(ulArr, ARRAY_SIZE), "CStyle_Array_ULong64_InOut");
-        Assert.IsTrue(Equals<ulong>(ulArr, GetExpectedOutArray<ulong>(ARRAY_SIZE)), "CStyle_Array_ULong64_InOut:Equals<ulong>");
+        Assert.True(CStyle_Array_ULong64_InOut(ulArr, ARRAY_SIZE));
+        Assert.True(Equals<ulong>(ulArr, GetExpectedOutArray<ulong>(ARRAY_SIZE)));
 
         double[] dArr = InitArray<double>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Double_InOut(dArr, ARRAY_SIZE), "CStyle_Array_Double_InOut");
-        Assert.IsTrue(Equals<double>(dArr, GetExpectedOutArray<double>(ARRAY_SIZE)), "CStyle_Array_Double_InOut:Equals<double>");
+        Assert.True(CStyle_Array_Double_InOut(dArr, ARRAY_SIZE));
+        Assert.True(Equals<double>(dArr, GetExpectedOutArray<double>(ARRAY_SIZE)));
 
         float[] fArr = InitArray<float>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Float_InOut(fArr, ARRAY_SIZE), "CStyle_Array_Float_InOut");
-        Assert.IsTrue(Equals<float>(fArr, GetExpectedOutArray<float>(ARRAY_SIZE)), "CStyle_Array_Float_InOut:Equals<float>");
+        Assert.True(CStyle_Array_Float_InOut(fArr, ARRAY_SIZE));
+        Assert.True(Equals<float>(fArr, GetExpectedOutArray<float>(ARRAY_SIZE)));
 
         byte[] bArr = InitArray<byte>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Byte_InOut(bArr, ARRAY_SIZE), "CStyle_Array_Byte_InOut");
-        Assert.IsTrue(Equals<byte>(bArr, GetExpectedOutArray<byte>(ARRAY_SIZE)), "CStyle_Array_Byte_InOut:Equals<byte>");
+        Assert.True(CStyle_Array_Byte_InOut(bArr, ARRAY_SIZE));
+        Assert.True(Equals<byte>(bArr, GetExpectedOutArray<byte>(ARRAY_SIZE)));
 
         char[] cArr = InitArray<char>(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Char_InOut(cArr, ARRAY_SIZE), "CStyle_Array_Char_InOut");
-        Assert.IsTrue(Equals<char>(cArr, GetExpectedOutArray<char>(ARRAY_SIZE)), "CStyle_Array_Char_InOut:Equals<char>");
+        Assert.True(CStyle_Array_Char_InOut(cArr, ARRAY_SIZE));
+        Assert.True(Equals<char>(cArr, GetExpectedOutArray<char>(ARRAY_SIZE)));
 
         string[] strArr = InitArray<string>(ARRAY_SIZE);
         strArr[strArr.Length / 2] = null;
-        Assert.IsTrue(CStyle_Array_LPSTR_InOut(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_InOut");
+        Assert.True(CStyle_Array_LPSTR_InOut(strArr, ARRAY_SIZE));
 
         string[] expectedArr = GetExpectedOutArray<string>(ARRAY_SIZE);
         // Test nesting null value scenario
         expectedArr[expectedArr.Length / 2 - 1] = null;
-        Assert.IsTrue(Equals<string>(strArr, expectedArr), "CStyle_Array_LPSTR_InOut:Equals<string>");
+        Assert.True(Equals<string>(strArr, expectedArr));
 
         TestStruct[] tsArr = InitStructArray(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Struct_InOut(tsArr, ARRAY_SIZE), "CStyle_Array_Struct_InOut");
-        Assert.IsTrue(Equals<TestStruct>(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)), "CStyle_Array_Struct_InOut:Equals<TestStruct>");
+        Assert.True(CStyle_Array_Struct_InOut(tsArr, ARRAY_SIZE));
+        Assert.True(Equals<TestStruct>(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)));
 
         bool[] boolArr = InitBoolArray(ARRAY_SIZE);
-        Assert.IsTrue(CStyle_Array_Bool_InOut(boolArr, ARRAY_SIZE), "CStyle_Array_Bool_InOut");
-        Assert.IsTrue(Equals<bool>(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)), "CStyle_Array_Bool_InOut:Equals<bool>");
+        Assert.True(CStyle_Array_Bool_InOut(boolArr, ARRAY_SIZE));
+        Assert.True(Equals<bool>(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)));
     }
 
     private static bool Equals<T>(T[] arr1, T[] arr2)
@@ -493,77 +493,77 @@ public class ArrayMarshal
         Console.WriteLine("By value marshaling CLR array as c-style-array with OutAttribute applied");
 
         int[] iArr = new int[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Int_Out(iArr, ARRAY_SIZE), "CStyle_Array_Int_Out");
-        Assert.IsTrue(Equals<int>(iArr, GetExpectedOutArray<int>(ARRAY_SIZE)), "CStyle_Array_Int_Out:Equals<int>");
+        Assert.True(CStyle_Array_Int_Out(iArr, ARRAY_SIZE));
+        Assert.True(Equals<int>(iArr, GetExpectedOutArray<int>(ARRAY_SIZE)));
 
         int[] iArrNull = null;
-        Assert.IsTrue(CStyle_Array_Int_Out_Null(iArrNull), "CStyle_Array_Int_Out_Null");
-        Assert.IsNull(iArrNull, "CStyle_Array_Int_Out_Null:Equals<null>");
+        Assert.True(CStyle_Array_Int_Out_Null(iArrNull));
+        Assert.Null(iArrNull);
 
         int[] iArrLength0 = new int[0];
-        Assert.IsTrue(CStyle_Array_Int_Out_ZeroLength(iArrLength0), "CStyle_Array_Int_Out_ZeroLength");
-        Assert.AreEqual(0, iArrLength0.Length, "CStyle_Array_Int_Out_ZeroLength:Length<!0>");
+        Assert.True(CStyle_Array_Int_Out_ZeroLength(iArrLength0));
+        Assert.Equal(0, iArrLength0.Length);
 
         uint[] uiArr = new uint[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Uint_Out(uiArr, ARRAY_SIZE), "CStyle_Array_Uint_Out");
-        Assert.IsTrue(Equals<uint>(uiArr, GetExpectedOutArray<uint>(ARRAY_SIZE)), "CStyle_Array_Uint_Out:Equals<uint>");
+        Assert.True(CStyle_Array_Uint_Out(uiArr, ARRAY_SIZE));
+        Assert.True(Equals<uint>(uiArr, GetExpectedOutArray<uint>(ARRAY_SIZE)));
 
         short[] sArr = new short[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Short_Out(sArr, ARRAY_SIZE), "CStyle_Array_Short_Out");
-        Assert.IsTrue(Equals<short>(sArr, GetExpectedOutArray<short>(ARRAY_SIZE)), "CStyle_Array_Short_Out:Equals<short>");
+        Assert.True(CStyle_Array_Short_Out(sArr, ARRAY_SIZE));
+        Assert.True(Equals<short>(sArr, GetExpectedOutArray<short>(ARRAY_SIZE)));
 
         ushort[] usArr = new ushort[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Word_Out(usArr, ARRAY_SIZE), "CStyle_Array_Word_Out");
-        Assert.IsTrue(Equals<ushort>(usArr, GetExpectedOutArray<ushort>(ARRAY_SIZE)), "CStyle_Array_Word_Out:Equals<ushort>");
+        Assert.True(CStyle_Array_Word_Out(usArr, ARRAY_SIZE));
+        Assert.True(Equals<ushort>(usArr, GetExpectedOutArray<ushort>(ARRAY_SIZE)));
 
         long[] lArr = new long[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Long64_Out(lArr, ARRAY_SIZE), "CStyle_Array_Long64_Out");
-        Assert.IsTrue(Equals<long>(lArr, GetExpectedOutArray<long>(ARRAY_SIZE)), "CStyle_Array_Long64_Out:Equals<long>");
+        Assert.True(CStyle_Array_Long64_Out(lArr, ARRAY_SIZE));
+        Assert.True(Equals<long>(lArr, GetExpectedOutArray<long>(ARRAY_SIZE)));
 
         ulong[] ulArr = new ulong[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_ULong64_Out(ulArr, ARRAY_SIZE), "CStyle_Array_ULong64_Out");
-        Assert.IsTrue(Equals<ulong>(ulArr, GetExpectedOutArray<ulong>(ARRAY_SIZE)), "CStyle_Array_ULong64_Out:Equals<ulong>");
+        Assert.True(CStyle_Array_ULong64_Out(ulArr, ARRAY_SIZE));
+        Assert.True(Equals<ulong>(ulArr, GetExpectedOutArray<ulong>(ARRAY_SIZE)));
 
         double[] dArr = new double[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Double_Out(dArr, ARRAY_SIZE), "CStyle_Array_Double_Out");
-        Assert.IsTrue(Equals<double>(dArr, GetExpectedOutArray<double>(ARRAY_SIZE)), "CStyle_Array_Double_Out:Equals<double>");
+        Assert.True(CStyle_Array_Double_Out(dArr, ARRAY_SIZE));
+        Assert.True(Equals<double>(dArr, GetExpectedOutArray<double>(ARRAY_SIZE)));
 
         float[] fArr = new float[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Float_Out(fArr, ARRAY_SIZE), "CStyle_Array_Float_Out");
-        Assert.IsTrue(Equals<float>(fArr, GetExpectedOutArray<float>(ARRAY_SIZE)), "CStyle_Array_Float_Out:Equals<float>");
+        Assert.True(CStyle_Array_Float_Out(fArr, ARRAY_SIZE));
+        Assert.True(Equals<float>(fArr, GetExpectedOutArray<float>(ARRAY_SIZE)));
 
         byte[] bArr = new byte[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Byte_Out(bArr, ARRAY_SIZE), "CStyle_Array_Byte_Out");
-        Assert.IsTrue(Equals<byte>(bArr, GetExpectedOutArray<byte>(ARRAY_SIZE)), "CStyle_Array_Byte_Out:Equals<byte>");
+        Assert.True(CStyle_Array_Byte_Out(bArr, ARRAY_SIZE));
+        Assert.True(Equals<byte>(bArr, GetExpectedOutArray<byte>(ARRAY_SIZE)));
 
         char[] cArr = new char[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Char_Out(cArr, ARRAY_SIZE), "CStyle_Array_Char_Out");
-        Assert.IsTrue(Equals<char>(cArr, GetExpectedOutArray<char>(ARRAY_SIZE)), "CStyle_Array_Char_Out:Equals<char>");
+        Assert.True(CStyle_Array_Char_Out(cArr, ARRAY_SIZE));
+        Assert.True(Equals<char>(cArr, GetExpectedOutArray<char>(ARRAY_SIZE)));
 
         string[] strArr = new string[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_LPSTR_Out(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_Out");
+        Assert.True(CStyle_Array_LPSTR_Out(strArr, ARRAY_SIZE));
 
         string[] expectedArr = GetExpectedOutArray<string>(ARRAY_SIZE);
         // Test nesting null value scenario
         expectedArr[expectedArr.Length / 2 - 1] = null;
-        Assert.IsTrue(Equals<string>(strArr, expectedArr), "CStyle_Array_LPSTR_Out:Equals<string>");
+        Assert.True(Equals<string>(strArr, expectedArr));
 
         TestStruct[] tsArr = new TestStruct[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Struct_Out(tsArr, ARRAY_SIZE), "CStyle_Array_Struct_Out");
-        Assert.IsTrue(Equals<TestStruct>(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)), "CStyle_Array_Struct_Out:Equals<TestStruct>");
+        Assert.True(CStyle_Array_Struct_Out(tsArr, ARRAY_SIZE));
+        Assert.True(Equals<TestStruct>(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)));
 
         bool[] boolArr = new bool[ARRAY_SIZE];
-        Assert.IsTrue(CStyle_Array_Bool_Out(boolArr, ARRAY_SIZE), "CStyle_Array_Bool_Out");
-        Assert.IsTrue(Equals<bool>(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)), "CStyle_Array_Bool_Out:Equals<bool>");
-        
+        Assert.True(CStyle_Array_Bool_Out(boolArr, ARRAY_SIZE));
+        Assert.True(Equals<bool>(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)));
+
         if (OperatingSystem.IsWindows())
         {
             object[] oArr = new object[ARRAY_SIZE];
-            Assert.IsTrue(CStyle_Array_Object_Out(oArr, ARRAY_SIZE), "CStyle_Array_Object_Out");
+            Assert.True(CStyle_Array_Object_Out(oArr, ARRAY_SIZE));
             object[] expectedOArr = GetExpectedOutArray<object>(ARRAY_SIZE);
             // Test nesting null value scenario
             expectedOArr[expectedOArr.Length / 2 - 1] = null;
-            Assert.IsTrue(Equals<object>(oArr, expectedOArr), "CStyle_Array_Object_Out:Equals<object>"); 
+            Assert.True(Equals<object>(oArr, expectedOArr));
         }
 
     }
@@ -636,7 +636,7 @@ public class ArrayMarshal
             TestMarshalByVal_In();
             TestMarshalByVal_InOut();
             TestMarshalByVal_Out();
-            
+
             Console.WriteLine("\nTest PASS.");
             return 100;
         }
index 56c7a61..a2096d4 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe class ArrayWithOffsetTest
 {
@@ -23,17 +23,17 @@ unsafe class ArrayWithOffsetTest
                 fixed (int* expectedSubArray = expected.Slice(i))
                 fixed (int* newValueSubArray = newValue.Slice(i))
                 {
-                    Assert.IsTrue(ArrayWithOffsetNative.Marshal_InOut(expectedSubArray, offset, expected.Length - i, newValueSubArray), $"Native call failed with element offset {i}.");
+                    Assert.True(ArrayWithOffsetNative.Marshal_InOut(expectedSubArray, offset, expected.Length - i, newValueSubArray), $"Native call failed with element offset {i}.");
                 }
 
                 for (int j = 0; j < i; j++)
                 {
-                    Assert.AreEqual(expected[j], array[j]);
+                    Assert.Equal(expected[j], array[j]);
                 }
 
                 for (int j = i; j < array.Length; j++)
                 {
-                    Assert.AreEqual(newValue[j], array[j]);
+                    Assert.Equal(newValue[j], array[j]);
                 }
             }
 
index 71c26a8..d4f4925 100644 (file)
@@ -6,7 +6,7 @@ using System.Threading;
 using System.Text;
 using System.Runtime.InteropServices;
 using System.Reflection;
-using TestLibrary;
+using Xunit;
 
 #pragma warning disable CS0612, CS0618
 
@@ -31,7 +31,7 @@ class AsAnyTests
 
     private static readonly string MappableString = "" + NormalChar1 + mappableChar + NormalChar2;
     private static readonly string UnmappableString = "" + NormalChar1 + unmappableChar + NormalChar2;
-        
+
     [DllImport("AsAnyNative")]
     public static extern bool PassArraySbyte(
         [MarshalAs(UnmanagedType.AsAny)] object sbyteArray,
@@ -41,7 +41,7 @@ class AsAnyTests
         sbyte[] expected,
         int len
     );
-    
+
     [DllImport("AsAnyNative")]
     public static extern bool PassArrayByte(
         [MarshalAs(UnmanagedType.AsAny)] object byteArray,
@@ -172,12 +172,12 @@ class AsAnyTests
         UIntPtr[] expected,
         int len
     );
-    
+
     [DllImport("AsAnyNative")]
     public static extern long PassLayout(
     [MarshalAs(UnmanagedType.AsAny)] Object i);
 
-    [DllImport("AsAnyNative", EntryPoint = "PassUnicodeStr", CharSet = CharSet.Unicode, 
+    [DllImport("AsAnyNative", EntryPoint = "PassUnicodeStr", CharSet = CharSet.Unicode,
     BestFitMapping = true, ThrowOnUnmappableChar = true)]
     public static extern bool PassUnicodeStrTT(
     [MarshalAs(UnmanagedType.AsAny)]
@@ -191,7 +191,7 @@ class AsAnyTests
 
     [DllImport("AsAnyNative", EntryPoint = "PassUnicodeStr", CharSet = CharSet.Unicode,
    BestFitMapping = false, ThrowOnUnmappableChar = false)]
-    public static extern bool PassUnicodeStrFF(                              
+    public static extern bool PassUnicodeStrFF(
     [MarshalAs(UnmanagedType.AsAny)]
     Object i);
 
@@ -367,9 +367,9 @@ class AsAnyTests
 
         CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out,
            mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString);
-        Assert.IsTrue(PassAnsiCharArrayTT(mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, false));
-        Assert.AreAllEqual(mappableAnsiStr_back.ToCharArray(), mappableCharArray_InOut);
-        Assert.AreAllEqual(mappableAnsiStr_back.ToCharArray(), mappableCharArray_Out);
+        Assert.True(PassAnsiCharArrayTT(mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, false));
+        AssertExtensions.CollectionEqual(mappableAnsiStr_back.ToCharArray(), mappableCharArray_InOut);
+        AssertExtensions.CollectionEqual(mappableAnsiStr_back.ToCharArray(), mappableCharArray_Out);
 
         CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out,
            mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString);
@@ -381,9 +381,9 @@ class AsAnyTests
 
         CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out,
            mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString);
-        Assert.IsTrue(PassAnsiCharArrayFF(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, true));
-        Assert.AreAllEqual(unMappableAnsiStr_back.ToCharArray(), unMappableCharArray_InOut);
-        Assert.AreAllEqual(unMappableAnsiStr_back.ToCharArray(), unMappableCharArray_Out);
+        Assert.True(PassAnsiCharArrayFF(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, true));
+        AssertExtensions.CollectionEqual(unMappableAnsiStr_back.ToCharArray(), unMappableCharArray_InOut);
+        AssertExtensions.CollectionEqual(unMappableAnsiStr_back.ToCharArray(), unMappableCharArray_Out);
     }
 
     private static void TestUnicodeStringArray()
@@ -399,21 +399,21 @@ class AsAnyTests
 
         CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out,
             mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString);
-        Assert.IsTrue(PassUnicodeCharArrayTT(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out));
-        Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut);
-        Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out);
+        Assert.True(PassUnicodeCharArrayTT(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out));
+        AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut);
+        AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out);
 
         CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out,
             mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString);
-        Assert.IsTrue(PassUnicodeCharArrayFT(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out));
-        Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut);
-        Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out);
+        Assert.True(PassUnicodeCharArrayFT(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out));
+        AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut);
+        AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out);
 
         CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out,
             mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString);
-        Assert.IsTrue(PassUnicodeCharArrayFF(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out));
-        Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut);
-        Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out);
+        Assert.True(PassUnicodeCharArrayFF(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out));
+        AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut);
+        AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out);
     }
 
     private static void TestAnsiStringBuilder()
@@ -422,34 +422,34 @@ class AsAnyTests
         StringBuilder mappableStrbd = new StringBuilder(MappableString);
 
         Assert.Throws<ArgumentException>(() => PassAnsiStrbdTT(unMappableStrbd, true));
-        Assert.IsTrue(PassAnsiStrbdTT(mappableStrbd, false));
+        Assert.True(PassAnsiStrbdTT(mappableStrbd, false));
         Assert.Throws<ArgumentException>(() => PassAnsiStrbdFT(unMappableStrbd, true));
         Assert.Throws<ArgumentException>(() => PassAnsiStrbdFT(mappableStrbd, false));
-        Assert.IsTrue(PassAnsiStrbdFF(unMappableStrbd, true));
+        Assert.True(PassAnsiStrbdFF(unMappableStrbd, true));
     }
 
     private static void TestUnicodeStringBuilder()
     {
         StringBuilder unMappableStrbd = new StringBuilder(UnmappableString);
-        Assert.IsTrue(PassUnicodeStrbdTT(unMappableStrbd));
-        Assert.IsTrue(PassUnicodeStrbdFT(unMappableStrbd));
-        Assert.IsTrue(PassUnicodeStrbdFF(unMappableStrbd));
+        Assert.True(PassUnicodeStrbdTT(unMappableStrbd));
+        Assert.True(PassUnicodeStrbdFT(unMappableStrbd));
+        Assert.True(PassUnicodeStrbdFF(unMappableStrbd));
     }
 
     private static void TestAnsiStringBestFitMapping()
     {
         Assert.Throws<ArgumentException>(() => PassAnsiStrTT(UnmappableString, true));
-        Assert.IsTrue(PassAnsiStrTT(MappableString, false));
+        Assert.True(PassAnsiStrTT(MappableString, false));
         Assert.Throws<ArgumentException>(() => PassAnsiStrFT(UnmappableString, true));
         Assert.Throws<ArgumentException>(() => PassAnsiStrFT(MappableString, false));
-        Assert.IsTrue(PassAnsiStrFF(UnmappableString, true));
+        Assert.True(PassAnsiStrFF(UnmappableString, true));
     }
 
     private static void TestUnicodeString()
     {
-        Assert.IsTrue(PassUnicodeStrTT(UnmappableString));
-        Assert.IsTrue(PassUnicodeStrFT(UnmappableString));
-        Assert.IsTrue(PassUnicodeStrFF(UnmappableString));
+        Assert.True(PassUnicodeStrTT(UnmappableString));
+        Assert.True(PassUnicodeStrFT(UnmappableString));
+        Assert.True(PassUnicodeStrFF(UnmappableString));
     }
 
     private static void TestUIntPtrArray()
@@ -461,9 +461,9 @@ class AsAnyTests
         UIntPtr[] uIntPtrArray_Out = new UIntPtr[] { new UIntPtr(0), new UIntPtr(1), new UIntPtr(2) };
         UIntPtr[] uIntPtrArray_Back = new UIntPtr[] { new UIntPtr(10), new UIntPtr(11), new UIntPtr(12) };
         UIntPtr[] expected = new UIntPtr[] { new UIntPtr(0), new UIntPtr(1), new UIntPtr(2) };
-        Assert.IsTrue(PassArrayUIntPtr(uIntPtrArray, uIntPtrArray_In, uIntPtrArray_InOut, uIntPtrArray_Out, expected, 3));
-        Assert.AreAllEqual(uIntPtrArray_Back, uIntPtrArray_InOut);
-        Assert.AreAllEqual(uIntPtrArray_Back, uIntPtrArray_Out);
+        Assert.True(PassArrayUIntPtr(uIntPtrArray, uIntPtrArray_In, uIntPtrArray_InOut, uIntPtrArray_Out, expected, 3));
+        AssertExtensions.CollectionEqual(uIntPtrArray_Back, uIntPtrArray_InOut);
+        AssertExtensions.CollectionEqual(uIntPtrArray_Back, uIntPtrArray_Out);
     }
 
     private static void TestIntPtrArray()
@@ -475,9 +475,9 @@ class AsAnyTests
         IntPtr[] intPtrArray_Out = new IntPtr[] { new IntPtr(0), new IntPtr(1), new IntPtr(2) };
         IntPtr[] intPtrArray_Back = new IntPtr[] { new IntPtr(10), new IntPtr(11), new IntPtr(12) };
         IntPtr[] expected = new IntPtr[] { new IntPtr(0), new IntPtr(1), new IntPtr(2) };
-        Assert.IsTrue(PassArrayIntPtr(intPtrArray, intPtrArray_In, intPtrArray_InOut, intPtrArray_Out, expected, 3));
-        Assert.AreAllEqual(intPtrArray_Back, intPtrArray_InOut);
-        Assert.AreAllEqual(intPtrArray_Back, intPtrArray_Out);
+        Assert.True(PassArrayIntPtr(intPtrArray, intPtrArray_In, intPtrArray_InOut, intPtrArray_Out, expected, 3));
+        AssertExtensions.CollectionEqual(intPtrArray_Back, intPtrArray_InOut);
+        AssertExtensions.CollectionEqual(intPtrArray_Back, intPtrArray_Out);
     }
 
     private static void TestBoolArray()
@@ -488,9 +488,9 @@ class AsAnyTests
         bool[] boolArray_InOut = new bool[] { true, false, false };
         bool[] boolArray_Out = new bool[] { true, false, false };
         bool[] boolArray_Back = new bool[] { false, true, true };
-        Assert.IsTrue(PassArrayBool(boolArray, boolArray_In, boolArray_InOut, boolArray_Out, new bool[] { true, false, false }, 3));
-        Assert.AreAllEqual(boolArray_Back, boolArray_InOut);
-        Assert.AreAllEqual(boolArray_Back, boolArray_Out);
+        Assert.True(PassArrayBool(boolArray, boolArray_In, boolArray_InOut, boolArray_Out, new bool[] { true, false, false }, 3));
+        AssertExtensions.CollectionEqual(boolArray_Back, boolArray_InOut);
+        AssertExtensions.CollectionEqual(boolArray_Back, boolArray_Out);
     }
 
     private static void TestCharArray()
@@ -501,9 +501,9 @@ class AsAnyTests
         char[] charArray_InOut = new char[] { 'a', 'b', 'c' };
         char[] charArray_Out = new char[] { 'a', 'b', 'c' };
         char[] charArray_Back = new char[] { 'd', 'e', 'f' };
-        Assert.IsTrue(PassArrayChar(charArray, charArray_In, charArray_InOut, charArray_Out, new char[] { 'a', 'b', 'c' }, 3));
-        Assert.AreAllEqual(charArray_Back, charArray_InOut);
-        Assert.AreAllEqual(charArray_Back, charArray_Out);
+        Assert.True(PassArrayChar(charArray, charArray_In, charArray_InOut, charArray_Out, new char[] { 'a', 'b', 'c' }, 3));
+        AssertExtensions.CollectionEqual(charArray_Back, charArray_InOut);
+        AssertExtensions.CollectionEqual(charArray_Back, charArray_Out);
     }
 
     private static void TestDoubleArray()
@@ -514,9 +514,9 @@ class AsAnyTests
         double[] doubleArray_InOut = new double[] { 0.0, 1.1, 2.2 };
         double[] doubleArray_Out = new double[] { 0.0, 1.1, 2.2 };
         double[] doubleArray_Back = new double[] { 10.0, 11.1, 12.2 };
-        Assert.IsTrue(PassArrayDouble(doubleArray, doubleArray_In, doubleArray_InOut, doubleArray_Out, new double[] { 0.0, 1.1, 2.2 }, 3));
-        Assert.AreAllEqual(doubleArray_Back, doubleArray_InOut);
-        Assert.AreAllEqual(doubleArray_Back, doubleArray_Out);
+        Assert.True(PassArrayDouble(doubleArray, doubleArray_In, doubleArray_InOut, doubleArray_Out, new double[] { 0.0, 1.1, 2.2 }, 3));
+        AssertExtensions.CollectionEqual(doubleArray_Back, doubleArray_InOut);
+        AssertExtensions.CollectionEqual(doubleArray_Back, doubleArray_Out);
     }
 
     private static void TestSingleArray()
@@ -527,9 +527,9 @@ class AsAnyTests
         float[] singleArray_InOut = new float[] { 0, 1, 2 };
         float[] singleArray_Out = new float[] { 0, 1, 2 };
         float[] singleArray_Back = new float[] { 10, 11, 12 };
-        Assert.IsTrue(PassArraySingle(singleArray, singleArray_In, singleArray_InOut, singleArray_Out, new float[] { 0, 1, 2 }, 3));
-        Assert.AreAllEqual(singleArray_Back, singleArray_InOut);
-        Assert.AreAllEqual(singleArray_Back, singleArray_Out);
+        Assert.True(PassArraySingle(singleArray, singleArray_In, singleArray_InOut, singleArray_Out, new float[] { 0, 1, 2 }, 3));
+        AssertExtensions.CollectionEqual(singleArray_Back, singleArray_InOut);
+        AssertExtensions.CollectionEqual(singleArray_Back, singleArray_Out);
     }
 
     private static void TestULongArray()
@@ -540,9 +540,9 @@ class AsAnyTests
         ulong[] ulongArray_InOut = new ulong[] { 0, 1, 2 };
         ulong[] ulongArray_Out = new ulong[] { 0, 1, 2 };
         ulong[] ulongArray_Back = new ulong[] { 10, 11, 12 };
-        Assert.IsTrue(PassArrayUlong(ulongArray, ulongArray_In, ulongArray_InOut, ulongArray_Out, new ulong[] { 0, 1, 2 }, 3));
-        Assert.AreAllEqual(ulongArray_Back, ulongArray_InOut);
-        Assert.AreAllEqual(ulongArray_Back, ulongArray_Out);
+        Assert.True(PassArrayUlong(ulongArray, ulongArray_In, ulongArray_InOut, ulongArray_Out, new ulong[] { 0, 1, 2 }, 3));
+        AssertExtensions.CollectionEqual(ulongArray_Back, ulongArray_InOut);
+        AssertExtensions.CollectionEqual(ulongArray_Back, ulongArray_Out);
     }
 
     private static void TestLongArray()
@@ -553,9 +553,9 @@ class AsAnyTests
         long[] longArray_InOut = new long[] { 0, 1, 2 };
         long[] longArray_Out = new long[] { 0, 1, 2 };
         long[] longArray_Back = new long[] { 10, 11, 12 };
-        Assert.IsTrue(PassArrayLong(longArray, longArray_In, longArray_InOut, longArray_Out, new long[] { 0, 1, 2 }, 3));
-        Assert.AreAllEqual(longArray_Back, longArray_InOut);
-        Assert.AreAllEqual(longArray_Back, longArray_Out);
+        Assert.True(PassArrayLong(longArray, longArray_In, longArray_InOut, longArray_Out, new long[] { 0, 1, 2 }, 3));
+        AssertExtensions.CollectionEqual(longArray_Back, longArray_InOut);
+        AssertExtensions.CollectionEqual(longArray_Back, longArray_Out);
     }
 
     private static void TestUInt32Array()
@@ -566,9 +566,9 @@ class AsAnyTests
         uint[] uintArray_InOut = new uint[] { 0, 1, 2 };
         uint[] uintArray_Out = new uint[] { 0, 1, 2 };
         uint[] uintArray_Back = new uint[] { 10, 11, 12 };
-        Assert.IsTrue(PassArrayUint(uintArray, uintArray_In, uintArray_InOut, uintArray_Out, new uint[] { 0, 1, 2 }, 3));
-        Assert.AreAllEqual(uintArray_Back, uintArray_InOut);
-        Assert.AreAllEqual(uintArray_Back, uintArray_Out);
+        Assert.True(PassArrayUint(uintArray, uintArray_In, uintArray_InOut, uintArray_Out, new uint[] { 0, 1, 2 }, 3));
+        AssertExtensions.CollectionEqual(uintArray_Back, uintArray_InOut);
+        AssertExtensions.CollectionEqual(uintArray_Back, uintArray_Out);
     }
 
     private static void TestInt32Array()
@@ -579,9 +579,9 @@ class AsAnyTests
         int[] intArray_InOut = new int[] { 0, 1, 2 };
         int[] intArray_Out = new int[] { 0, 1, 2 };
         int[] intArray_Back = new int[] { 10, 11, 12 };
-        Assert.IsTrue(PassArrayInt(intArray, intArray_In, intArray_InOut, intArray_Out, new int[] { 0, 1, 2 }, 3));
-        Assert.AreAllEqual(intArray_Back, intArray_InOut);
-        Assert.AreAllEqual(intArray_Back, intArray_Out);
+        Assert.True(PassArrayInt(intArray, intArray_In, intArray_InOut, intArray_Out, new int[] { 0, 1, 2 }, 3));
+        AssertExtensions.CollectionEqual(intArray_Back, intArray_InOut);
+        AssertExtensions.CollectionEqual(intArray_Back, intArray_Out);
     }
 
     private static void TestUInt16Array()
@@ -592,9 +592,9 @@ class AsAnyTests
         ushort[] ushortArray_InOut = new ushort[] { 0, 1, 2 };
         ushort[] ushortArray_Out = new ushort[] { 0, 1, 2 };
         ushort[] ushortArray_Back = new ushort[] { 10, 11, 12 };
-        Assert.IsTrue(PassArrayUshort(ushortArray, ushortArray_In, ushortArray_InOut, ushortArray_Out, new ushort[] { 0, 1, 2 }, 3));
-        Assert.AreAllEqual(ushortArray_Back, ushortArray_InOut);
-        Assert.AreAllEqual(ushortArray_Back, ushortArray_Out);
+        Assert.True(PassArrayUshort(ushortArray, ushortArray_In, ushortArray_InOut, ushortArray_Out, new ushort[] { 0, 1, 2 }, 3));
+        AssertExtensions.CollectionEqual(ushortArray_Back, ushortArray_InOut);
+        AssertExtensions.CollectionEqual(ushortArray_Back, ushortArray_Out);
     }
 
     private static void TestInt16Array()
@@ -605,9 +605,9 @@ class AsAnyTests
         short[] shortArray_InOut = new short[] { -1, 0, 1 };
         short[] shortArray_Out = new short[] { -1, 0, 1 };
         short[] shortArray_Back = new short[] { 9, 10, 11 };
-        Assert.IsTrue(PassArrayShort(shortArray, shortArray_In, shortArray_InOut, shortArray_Out, new short[] { -1, 0, 1 }, 3));
-        Assert.AreAllEqual(shortArray_Back, shortArray_InOut);
-        Assert.AreAllEqual(shortArray_Back, shortArray_Out);
+        Assert.True(PassArrayShort(shortArray, shortArray_In, shortArray_InOut, shortArray_Out, new short[] { -1, 0, 1 }, 3));
+        AssertExtensions.CollectionEqual(shortArray_Back, shortArray_InOut);
+        AssertExtensions.CollectionEqual(shortArray_Back, shortArray_Out);
     }
 
     private static void TestByteArray()
@@ -618,9 +618,9 @@ class AsAnyTests
         byte[] byteArray_InOut = new byte[] { 0, 1, 2 };
         byte[] byteArray_Out = new byte[] { 0, 1, 2 };
         byte[] byteArray_Back = new byte[] { 10, 11, 12 };
-        Assert.IsTrue(PassArrayByte(byteArray, byteArray_In, byteArray_InOut, byteArray_Out, new byte[] { 0, 1, 2 }, 3));
-        Assert.AreAllEqual(byteArray_Back, byteArray_InOut);
-        Assert.AreAllEqual(byteArray_Back, byteArray_Out);
+        Assert.True(PassArrayByte(byteArray, byteArray_In, byteArray_InOut, byteArray_Out, new byte[] { 0, 1, 2 }, 3));
+        AssertExtensions.CollectionEqual(byteArray_Back, byteArray_InOut);
+        AssertExtensions.CollectionEqual(byteArray_Back, byteArray_Out);
     }
 
     private static void TestSByteArray()
@@ -631,9 +631,9 @@ class AsAnyTests
         sbyte[] sbyteArray_InOut = new sbyte[] { -1, 0, 1 };
         sbyte[] sbyteArray_Out = new sbyte[] { -1, 0, 1 };
         sbyte[] sbyteArray_Back = new sbyte[] { 9, 10, 11 };
-        Assert.IsTrue(PassArraySbyte(sbyteArray, sbyteArray_In, sbyteArray_InOut, sbyteArray_Out, new sbyte[] {-1, 0, 1}, 3));
-        Assert.AreAllEqual(sbyteArray_Back, sbyteArray_InOut);
-        Assert.AreAllEqual(sbyteArray_Back, sbyteArray_Out);
+        Assert.True(PassArraySbyte(sbyteArray, sbyteArray_In, sbyteArray_InOut, sbyteArray_Out, new sbyte[] {-1, 0, 1}, 3));
+        AssertExtensions.CollectionEqual(sbyteArray_Back, sbyteArray_InOut);
+        AssertExtensions.CollectionEqual(sbyteArray_Back, sbyteArray_Out);
     }
 
     public static void TestLayout() {
@@ -645,8 +645,8 @@ class AsAnyTests
             a = 12,
             b = 3
         };
-        
-        Assert.AreEqual(layoutStruct.b, PassLayout(layoutStruct));   
+
+        Assert.Equal(layoutStruct.b, PassLayout(layoutStruct));
         Console.WriteLine("------------------------");
     }
 
index 193acfa..065c4b3 100644 (file)
@@ -6,7 +6,7 @@ using System.Globalization;
 using System.Reflection;
 using System.Runtime.InteropServices;
 using System.Text;
-using TestLibrary;
+using Xunit;
 
 class LCIDNative
 {
@@ -34,13 +34,13 @@ class LCIDTest
         {
             string testString = "Test string";
             LCIDNative.ReverseString(testString, out string reversed);
-            Assert.AreEqual(Reverse(testString), reversed);
+            Assert.Equal(Reverse(testString), reversed);
             CultureInfo originalCulture = CultureInfo.CurrentCulture;
             try
             {
                 CultureInfo spanishCulture = new CultureInfo("es-ES", false);
                 CultureInfo.CurrentCulture = spanishCulture;
-                Assert.IsTrue(LCIDNative.VerifyValidLCIDPassed(CultureInfo.CurrentCulture.LCID));
+                Assert.True(LCIDNative.VerifyValidLCIDPassed(CultureInfo.CurrentCulture.LCID));
             }
             finally
             {
index 77a0504..451035e 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -84,71 +84,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual('?', cTemp, "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal('?', cTemp);
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -173,8 +173,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index e40e3fe..2a1901c 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -84,63 +84,63 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
     }
 
     static void testCharBufferString()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -165,8 +165,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 9cb1250..0d07109 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -84,82 +84,82 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetInvalidChar()));
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
-        
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
+
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -184,8 +184,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 5b26eee..1551a01 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -84,71 +84,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
-        
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetInvalidChar()));
+
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
+
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.True(Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static void runTest()
@@ -173,8 +173,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 5cee92f..69c0cb4 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
 
@@ -84,71 +84,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual('?', cTemp, "[Error] Location tc66");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal('?', cTemp);
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs88");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -173,8 +173,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index f0fdec9..48a7ca4 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
 
@@ -84,65 +84,65 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc7");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs7");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -167,8 +167,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 166ea35..ef2153c 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
 
@@ -84,83 +84,83 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Locationtcbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -185,8 +185,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index e6827f9..1e5ad9c 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
 
@@ -84,71 +84,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
-        
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetInvalidChar()));
+
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.True(Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static void runTest()
@@ -173,8 +173,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index a67b2c5..c3f90b4 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -84,71 +84,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual('?', cTemp, "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal('?', cTemp);
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -173,8 +173,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 5dae898..b9a4057 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -84,64 +84,64 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
     }
 
     static void testCharBufferString()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7");
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -166,8 +166,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 6b4cef5..a69d3e7 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -84,83 +84,83 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "Error location tcbs1");
-        
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "Error location tcbs2");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
+
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "Error location tcbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "Error location tcbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "Error location tcbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "Error location tcbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "Error location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "Error location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "Error location tcbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "Error location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "Error location tcbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "Error location tcbsb6");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "Error location tcbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "Error location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "Error location tcbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "Error location tcbsb10");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -185,8 +185,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index b015a90..f3df143 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -84,71 +84,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.True(Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static void runTest()
@@ -173,8 +173,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 704069b..64105ef 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -84,71 +84,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual('?', cTemp, "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal('?', cTemp);
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -173,8 +173,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index c75979c..3d98ca4 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -84,65 +84,65 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location t4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp), "[Error] Location tc55");
+        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc7");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs7");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -167,8 +167,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index e89ff5e..483d1cc 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -84,83 +84,83 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -185,8 +185,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 82ef753..bd1a276 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -84,71 +84,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.True(Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static void runTest()
@@ -173,8 +173,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 29d39df..1890bea 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -84,71 +84,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual('?', cTemp, "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal('?', cTemp);
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -173,8 +173,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index ea17e49..92bad6b 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
 
@@ -84,65 +84,65 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc7");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs7");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -167,8 +167,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 09fbd50..6dbfc40 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -87,83 +87,83 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static char[] GetInvalidArray()
@@ -192,11 +192,11 @@ public class BFM_CharMarshaler
     {
         char[] c = GetInvalidArray();
         ArrayWithOffset arrWOff_0 = new ArrayWithOffset(c, 0);
-        Assert.IsTrue(Char_InOut_ArrayWithOffset(arrWOff_0), "[Error] Location ctlpsawo11");
+        Assert.True(Char_InOut_ArrayWithOffset(arrWOff_0));
 
         c = GetValidArray();
         ArrayWithOffset arrWOff_1 = new ArrayWithOffset(c, 1);
-        Assert.IsTrue(Char_InOut_ArrayWithOffset(arrWOff_1), "[Error] Location ctlpsawo22");
+        Assert.True(Char_InOut_ArrayWithOffset(arrWOff_1));
     }
 
     static void runTest()
@@ -222,8 +222,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index e367098..12b5f7a 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -85,71 +85,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.True(Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static void runTest()
@@ -174,8 +174,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index fce9051..dd337af 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class BFM_CharMarshaler
 {
@@ -82,71 +82,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location t4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc55");
-        Assert.AreEqual('?', cTemp, "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal('?', cTemp);
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs77");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -171,8 +171,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 6339df8..95cfb97 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class BFM_CharMarshaler
 {
@@ -82,65 +82,65 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.Throws<ArgumentException>(() => Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.Throws<ArgumentException>(() => Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
-        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5");
+        Assert.Throws<ArgumentException>(() => Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc7");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs7");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.Throws<ArgumentException>(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.Throws<ArgumentException>(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -165,8 +165,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index b9a2f6c..5511b94 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class BFM_CharMarshaler
 {
@@ -82,83 +82,83 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6");
+        Assert.True(Char_InByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10");
+        Assert.True(Char_InOutByRef(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "Error location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "Error location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "Error location tcbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "Error location tcbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "Error location tcbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "Error location tcbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "Error location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "Error location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "Error location tcbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "Error location tcbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "Error location tcbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "Error location tcbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static void runTest()
@@ -183,8 +183,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 008bc08..4d5aa31 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class BFM_CharMarshaler
 {
@@ -82,71 +82,71 @@ public class BFM_CharMarshaler
 
     static void testChar()
     {
-        Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1");
+        Assert.True(Char_In(GetInvalidChar()));
 
-        Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2");
+        Assert.True(Char_In(GetValidChar()));
 
         char cTemp = GetInvalidChar();
         char cTempClone = GetInvalidChar();
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4");
+        Assert.True(Char_InByRef(ref cTemp));
 
         cTemp = GetInvalidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location t5");
+        Assert.True(Char_InOutByRef(ref cTemp));
 
         cTemp = GetValidChar();
         cTempClone = cTemp;
-        Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6");
+        Assert.True(Char_InOutByRef(ref cTemp));
     }
 
     static void testCharBufferString()
     {
-        Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(CharBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(CharBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(CharBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
+        Assert.True(CharBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testCharBufferStringBuilder()
     {
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(CharBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(CharBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
+        Assert.True(CharBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static void runTest()
@@ -171,8 +171,8 @@ public class BFM_CharMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 6ee1f3b..232e788 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -119,49 +119,49 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs88");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 ;
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -205,78 +205,78 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferStruct()
     {
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbs1");
+        Assert.True(LPStrBuffer_In_Struct_String(lpss));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
         LPStrTestStruct cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp = GetValidStruct();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbs8");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass lpss = new LPStrTestClass();
         lpss.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         lpss.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp.str = GetValidString();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] lpss = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(lpss));
 
-        Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(GetValidArray()));
 
         String[] cTemp = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
-        Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.NotEqual(cTempClone[0], cTemp[0]);
 
         cTemp = GetValidArray();
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -284,22 +284,22 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsba11");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsba22");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsba33");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsba44");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
@@ -309,8 +309,8 @@ public class BFM_LPStrMarshaler
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
 
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsba55");
-        Assert.AreNotEqual(lpssClone[0].str, lpss[0].str, "[Error] Location tlpsba66");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.NotEqual(lpssClone[0].str, lpss[0].str);
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -320,8 +320,8 @@ public class BFM_LPStrMarshaler
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
 
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsba77");
-        Assert.AreEqual(lpssClone[0].str, lpss[0].str, "[Error] Location tlpsba88");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpssClone[0].str, lpss[0].str);
     }
 
     static void runTest()
@@ -349,8 +349,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index e3c152f..811932c 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -120,44 +120,44 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -167,7 +167,7 @@ public class BFM_LPStrMarshaler
 
         return inValidStruct;
     }
-    
+
     static LPStrTestStruct GetValidStruct()
     {
         LPStrTestStruct validStruct = new LPStrTestStruct();
@@ -200,75 +200,75 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
         LPStrTestStruct cTempClone = new LPStrTestStruct();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass cTest = new LPStrTestClass();
         cTest.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1"); 
-        
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest));
+
         cTest.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(cTest));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp));
 
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTemp.str = GetValidString();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] cTest = null;
         cTest = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest));
 
         cTest = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(cTest));
 
         String[] cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp));
 
         String[] cTempClone = new String[3];
         cTemp = GetValidArray();
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -277,27 +277,27 @@ public class BFM_LPStrMarshaler
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -305,8 +305,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str);
     }
 
     static void runTest()
@@ -328,7 +328,7 @@ public class BFM_LPStrMarshaler
             Console.WriteLine("--- Success");
             return 100;
         }
-        
+
         try
         {
             runTest();
@@ -336,7 +336,7 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
+            Console.WriteLine($"Test Failure: {e}");
             return 101;
         }
     }
index 55b0873..e974116 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -119,57 +119,57 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8");              
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10"); 
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4"); 
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); 
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); 
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10"); 
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -190,21 +190,21 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -232,44 +232,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -277,32 +277,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
     }
 
@@ -325,7 +325,7 @@ public class BFM_LPStrMarshaler
             Console.WriteLine("--- Success");
             return 100;
         }
-        
+
         try
         {
             runTest();
@@ -333,7 +333,7 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
+            Console.WriteLine($"Test Failure: {e}");
             return 101;
         }
     }
index ece37c2..62fcd1e 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -119,48 +119,48 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -181,20 +181,20 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -222,44 +222,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -267,32 +267,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -314,7 +314,7 @@ public class BFM_LPStrMarshaler
             Console.WriteLine("--- Success");
             return 100;
         }
-        
+
         try
         {
             runTest();
@@ -322,8 +322,8 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
        }
    }
 }
index ba37d8f..edb1a99 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
 
@@ -118,49 +118,49 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -204,77 +204,77 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferStruct()
     {
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1");
+        Assert.True(LPStrBuffer_In_Struct_String(lpss));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
         LPStrTestStruct cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp = GetValidStruct();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass lpss = new LPStrTestClass();
         lpss.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         lpss.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp.str = GetValidString();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] lpss = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1");
-        Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(lpss));
+        Assert.True(LPStrBuffer_In_Array_String(GetValidArray()));
 
         String[] cTemp = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
-        Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location ttlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.NotEqual(cTempClone[0], cTemp[0]);
 
         cTemp = GetValidArray();
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -282,22 +282,22 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
@@ -305,8 +305,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
-        Assert.AreNotEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.NotEqual(lpss[0].str, lpssClone[0].str);
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -314,8 +314,8 @@ public class BFM_LPStrMarshaler
         lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str);
     }
 
     static void runTest()
@@ -345,7 +345,7 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
+            Console.WriteLine($"Test Failure: {e}");
             return 101;
         }
     }
index a2abff3..eef05a8 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
 
@@ -118,44 +118,44 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -198,75 +198,75 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
         LPStrTestStruct cTempClone = new LPStrTestStruct();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass cTest = new LPStrTestClass();
         cTest.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest));
 
         cTest.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(cTest));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] cTest = null;
         cTest = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest));
 
         cTest = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(cTest));
 
         String[] cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -275,27 +275,27 @@ public class BFM_LPStrMarshaler
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -303,8 +303,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str);
     }
 
     static void runTest()
@@ -334,8 +334,8 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index dded637..76afb9e 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
 
@@ -119,54 +119,54 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -187,20 +187,20 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -228,44 +228,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -273,32 +273,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -328,8 +328,8 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 3d4cbc2..65bd429 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
@@ -131,46 +131,46 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -208,26 +208,26 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferStruct()
     {
         LPStrTestStruct_nothrow lpss_nt = GetInvalidStruct_nothrow();
-        Assert.IsTrue(LPStrBuffer_In_Struct_String_nothrow(lpss_nt), "[Error] Location tlpsbst1");
+        Assert.True(LPStrBuffer_In_Struct_String_nothrow(lpss_nt));
 
         lpss_nt = GetValidStruct_nothrow();
-        Assert.IsTrue(LPStrBuffer_In_Struct_String_nothrow(lpss_nt), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String_nothrow(lpss_nt));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst3");
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_In_Struct_String(lpss));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst7");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst8");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -255,44 +255,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -300,32 +300,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -355,8 +355,8 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
 
     }
index 479f280..799828c 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -119,47 +119,47 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs8");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1");
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(sb));
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -203,76 +203,76 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferStruct()
     {
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1");
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(lpss));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
         LPStrTestStruct cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp = GetValidStruct();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass lpss = new LPStrTestClass();
         lpss.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         lpss.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp.str = GetValidString();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] lpss = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1");
-        Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(lpss));
+        Assert.True(LPStrBuffer_In_Array_String(GetValidArray()));
 
         String[] cTemp = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
-        Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.NotEqual(cTempClone[0], cTemp[0]);
 
         cTemp = GetValidArray();
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -280,22 +280,22 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
@@ -304,8 +304,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
-        Assert.AreNotEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.NotEqual(lpss[0].str, lpssClone[0].str);
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -313,8 +313,8 @@ public class BFM_LPStrMarshaler
         lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str);
     }
 
    static void runTest()
@@ -344,7 +344,7 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
+            Console.WriteLine($"Test Failure: {e}");
             return 101;
         }
     }
index bb7485d..45c2fd1 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -119,42 +119,42 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()));
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -197,74 +197,74 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
         LPStrTestStruct cTempClone = new LPStrTestStruct();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass cTest = new LPStrTestClass();
         cTest.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest));
 
         cTest.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(cTest));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] cTest = null;
         cTest = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest));
 
         cTest = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(cTest));
 
         String[] cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -273,27 +273,27 @@ public class BFM_LPStrMarshaler
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -301,8 +301,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str);
     }
 
     static void runTest()
@@ -332,8 +332,8 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 52a11c9..babd7d2 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -119,54 +119,54 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -188,20 +188,20 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -229,44 +229,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -274,32 +274,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -329,7 +329,7 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
+            Console.WriteLine($"Test Failure: {e}");
             return 101;
         }
     }
index 1b44794..36727bd 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -119,48 +119,48 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -181,21 +181,21 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -223,44 +223,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -268,32 +268,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -321,8 +321,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index b9b698d..7d0e459 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -119,49 +119,49 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -206,78 +206,78 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferStruct()
     {
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1");
+        Assert.True(LPStrBuffer_In_Struct_String(lpss));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
         LPStrTestStruct cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbsqt6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp = GetValidStruct();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass lpss = new LPStrTestClass();
         lpss.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         lpss.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp.str = GetValidString();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] lpss = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(lpss));
 
-        Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(GetValidArray()));
 
         String[] cTemp = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
-        Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.NotEqual(cTempClone[0], cTemp[0]);
 
         cTemp = GetValidArray();
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -285,22 +285,22 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
@@ -308,8 +308,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
-        Assert.AreNotEqual(lpssClone[0].str, lpss[0].str, "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.NotEqual(lpssClone[0].str, lpss[0].str);
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -317,8 +317,8 @@ public class BFM_LPStrMarshaler
         lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7");
-        Assert.AreEqual(lpssClone[0].str, lpss[0].str, "[Error] Location tlpsbaos8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpssClone[0].str, lpss[0].str);
     }
 
     static void runTest()
@@ -346,8 +346,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 79991c0..26c2374 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -119,45 +119,45 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
 
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7");
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -200,75 +200,75 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
         LPStrTestStruct cTempClone = new LPStrTestStruct();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass cTest = new LPStrTestClass();
         cTest.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest));
 
         cTest.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(cTest));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] cTest = null;
         cTest = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest));
 
         cTest = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(cTest));
 
         String[] cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -277,27 +277,27 @@ public class BFM_LPStrMarshaler
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -306,8 +306,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str);
     }
 
     static void runTest()
@@ -335,8 +335,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 2c39b48..784c834 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -119,56 +119,56 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -190,21 +190,21 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -232,44 +232,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -277,32 +277,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -330,8 +330,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 2e4713b..abd0c7c 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -119,48 +119,48 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -181,21 +181,21 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -223,44 +223,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -268,34 +268,34 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
 
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
 
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -323,8 +323,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index a2d9500..6ceacf2 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)]
 
@@ -117,47 +117,47 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs8");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1");
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(sb));
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -201,76 +201,76 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferStruct()
     {
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1");
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(lpss));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
         LPStrTestStruct cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp = GetValidStruct();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass lpss = new LPStrTestClass();
         lpss.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         lpss.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp.str = GetValidString();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] lpss = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1");
-        Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(lpss));
+        Assert.True(LPStrBuffer_In_Array_String(GetValidArray()));
 
         String[] cTemp = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
-        Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.NotEqual(cTempClone[0], cTemp[0]);
 
         cTemp = GetValidArray();
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -278,22 +278,22 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
@@ -301,8 +301,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
-        Assert.AreNotEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.NotEqual(lpss[0].str, lpssClone[0].str);
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -310,8 +310,8 @@ public class BFM_LPStrMarshaler
         lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str , "[Error] Location tlpsbaos8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str );
     }
 
     static void runTest()
@@ -341,8 +341,8 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index c86d0ba..88a5faa 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)]
 
@@ -117,42 +117,42 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()));
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString() , "[Error] Location tlpsbsb7");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString() );
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -195,74 +195,74 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
         LPStrTestStruct cTempClone = new LPStrTestStruct();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass cTest = new LPStrTestClass();
         cTest.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1"); 
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest));
 
         cTest.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(cTest));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] cTest = null;
         cTest = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest));
 
         cTest = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(cTest));
 
         String[] cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -271,27 +271,27 @@ public class BFM_LPStrMarshaler
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -299,8 +299,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str);
     }
 
     static void runTest()
@@ -330,7 +330,7 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
+            Console.WriteLine($"Test Failure: {e}");
             return 101;
         }
     }
index 87fddf0..2fe7af3 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)]
 
@@ -117,54 +117,54 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -185,20 +185,20 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -226,44 +226,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
-        
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
+
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -271,32 +271,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -326,7 +326,7 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
+            Console.WriteLine($"Test Failure: {e}");
             return 101;
         }
     }
index b52de3a..f738c56 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)]
 
@@ -120,47 +120,47 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
 
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -181,20 +181,20 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -222,44 +222,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -267,32 +267,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -322,7 +322,7 @@ public class BFM_LPStrMarshaler
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
+            Console.WriteLine($"Test Failure: {e}");
             return 101;
         }
     }
index 0e3e101..5db6851 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [StructLayout(LayoutKind.Sequential)]
 [BestFitMapping(false, ThrowOnUnmappableChar = false)]
@@ -117,49 +117,49 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs8");       
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
         StringBuilder sb = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(sb));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -204,78 +204,78 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferStruct()
     {
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1");
+        Assert.True(LPStrBuffer_In_Struct_String(lpss));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetInvalidStruct();
         LPStrTestStruct cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp = GetValidStruct();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass lpss = new LPStrTestClass();
         lpss.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         lpss.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(lpss));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
-        Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.NotEqual(cTempClone.str, cTemp.str);
 
         cTemp.str = GetValidString();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] lpss = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(lpss));
 
-        Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(GetValidArray()));
 
         String[] cTemp = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
-        Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.NotEqual(cTempClone[0], cTemp[0]);
 
         cTemp = GetValidArray();
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -283,22 +283,22 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
@@ -306,8 +306,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
-        Assert.AreNotEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.NotEqual(lpss[0].str, lpssClone[0].str);
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -315,8 +315,8 @@ public class BFM_LPStrMarshaler
         lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos8");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str);
     }
 
     static void runTest()
@@ -344,8 +344,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 82529bd..a9bcd73 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [StructLayout(LayoutKind.Sequential)]
 [BestFitMapping(false, ThrowOnUnmappableChar = true)]
@@ -117,44 +117,44 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -164,7 +164,7 @@ public class BFM_LPStrMarshaler
 
         return inValidStruct;
     }
-    
+
     static LPStrTestStruct GetValidStruct()
     {
         LPStrTestStruct validStruct = new LPStrTestStruct();
@@ -197,75 +197,75 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4");
-        
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref cTemp));
+
         cTemp = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
 
         cTemp = GetValidStruct();
         LPStrTestStruct cTempClone = new LPStrTestStruct();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass cTest = new LPStrTestClass();
         cTest.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Class_String(cTest));
 
         cTest.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2");
+        Assert.True(LPStrBuffer_In_Class_String(cTest));
 
         LPStrTestClass cTemp = new LPStrTestClass();
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref cTemp));
 
         cTemp.str = GetInvalidString();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp));
 
         cTemp.str = GetValidString();
         LPStrTestClass cTempClone = new LPStrTestClass();
         cTempClone.str = cTemp.str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6");
-        Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref cTemp));
+        Assert.Equal(cTempClone.str, cTemp.str);
     }
 
     static void testLPStrBufferArray()
     {
         String[] cTest = null;
         cTest = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_String(cTest));
 
         cTest = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(cTest));
 
         String[] cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref cTemp));
 
         cTemp = GetInvalidArray();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp));
 
         cTemp = GetValidArray();
         String[] cTempClone = new String[3];
         cTempClone[0] = cTemp[0];
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6");
-        Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref cTemp));
+        Assert.Equal(cTempClone[0], cTemp[0]);
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -274,27 +274,27 @@ public class BFM_LPStrMarshaler
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.Throws<ArgumentException>(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
@@ -302,8 +302,8 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpssClone = new LPStrTestStruct[2];
         lpssClone[0].str = lpss[0].str;
         lpssClone[1].str = lpss[1].str;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
-        Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+        Assert.Equal(lpss[0].str, lpssClone[0].str);
     }
 
     static void runTest()
@@ -331,8 +331,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 0e70e61..8652eea 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [StructLayout(LayoutKind.Sequential)]
 [BestFitMapping(true, ThrowOnUnmappableChar = false)]
@@ -117,56 +117,56 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4");
-        
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
+
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6");
-        
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
+
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7");
-        Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8");
-        
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.NotEqual(cTempClone, cTemp);
+
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9");
-        Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
+        Assert.Equal(cTempClone, cTemp);
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1");
-        
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2");
-        
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
+
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
+
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4");
-        
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
+
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6");
-        
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
+
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7");
-        Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8");
-        
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.NotEqual(cTempClone.ToString(), cTemp.ToString());
+
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9");
-        Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
+        Assert.Equal(cTempClone.ToString(), cTemp.ToString());
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -188,21 +188,21 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
-        
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
-        
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
+
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
+
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
-        
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
+
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
-        
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
+
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
-        
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
+
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -230,44 +230,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
-        
+        Assert.True(LPStrBuffer_In_Array_String(s));
+
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
-        
+        Assert.True(LPStrBuffer_In_Array_String(s));
+
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
-        
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
+
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
-        
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
+
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
-        
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
+
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1");
-        
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
+
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2");
-        
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
+
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3");
-        
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
+
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4");
-        
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
+
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5");
-        
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
+
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -275,32 +275,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos11");
-        
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
+
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
-        
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
+
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
-        
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
+
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
-        
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
+
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
-        
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
+
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -328,8 +328,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index 942c31a..66a38e2 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 [StructLayout(LayoutKind.Sequential)]
 [BestFitMapping(true, ThrowOnUnmappableChar = true)]
@@ -117,48 +117,48 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferString()
     {
-        Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1");
+        Assert.True(LPStrBuffer_In_String(GetInvalidString()));
 
-        Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tcbs2");
+        Assert.True(LPStrBuffer_In_String(GetValidString()));
 
         String cTemp = GetInvalidString();
         String cTempClone = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4");
+        Assert.True(LPStrBuffer_InByRef_String(ref cTemp));
 
         cTemp = GetInvalidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
 
         cTemp = GetValidString();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6");
+        Assert.True(LPStrBuffer_InOutByRef_String(ref cTemp));
     }
 
     static void testLPStrBufferStringBuilder()
     {
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()));
 
-        Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2");
+        Assert.True(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()));
 
         StringBuilder cTemp = GetInvalidStringBuilder();
         StringBuilder cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4");
+        Assert.True(LPStrBuffer_InByRef_StringBuilder(ref cTemp));
 
         cTemp = GetInvalidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
 
         cTemp = GetValidStringBuilder();
         cTempClone = cTemp;
-        Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6");
+        Assert.True(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp));
     }
 
     static LPStrTestStruct GetInvalidStruct()
@@ -180,21 +180,21 @@ public class BFM_LPStrMarshaler
 
     static void testLPStrBufferStruct()
     {
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1");
+        Assert.True(LPStrBuffer_In_Struct_String(GetInvalidStruct()));
 
-        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2");
+        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));
 
         LPStrTestStruct lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4");
+        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));
 
         lpss = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
 
         lpss = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");
+        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
     }
 
     static String[] GetValidArray()
@@ -222,44 +222,44 @@ public class BFM_LPStrMarshaler
     static void testLPStrBufferArray()
     {
         String[] s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2");
+        Assert.True(LPStrBuffer_In_Array_String(s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4");
+        Assert.True(LPStrBuffer_InByRef_Array_String(ref s));
 
         s = GetInvalidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
 
         s = GetValidArray();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_String(ref s));
     }
 
     static void testLPStrBufferClass()
     {
         LPStrTestClass sClass = new LPStrTestClass();
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc1");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc2");
+        Assert.True(LPStrBuffer_In_Class_String(sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc3");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc4");
+        Assert.True(LPStrBuffer_InByRef_Class_String(ref sClass));
 
         sClass.str = GetInvalidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc5");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
 
         sClass.str = GetValidString();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc6");
+        Assert.True(LPStrBuffer_InOutByRef_Class_String(ref sClass));
     }
 
     static void testLPStrBufferArrayOfStructs()
@@ -267,32 +267,32 @@ public class BFM_LPStrMarshaler
         LPStrTestStruct[] lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2");
+        Assert.True(LPStrBuffer_In_Array_Struct(lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4");
+        Assert.True(LPStrBuffer_InByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetInvalidStruct();
         lpss[1] = GetInvalidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
 
         lpss = new LPStrTestStruct[2];
         lpss[0] = GetValidStruct();
         lpss[1] = GetValidStruct();
-        Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6");
+        Assert.True(LPStrBuffer_InOutByRef_Array_Struct(ref lpss));
     }
 
     static void runTest()
@@ -320,8 +320,8 @@ public class BFM_LPStrMarshaler
             runTest();
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 }
index b2568ad..a198b5d 100644 (file)
@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System;
-using TestLibrary;
+using Xunit;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
@@ -39,17 +39,17 @@ internal class MyCriticalHandle : CriticalHandle
         {
             return handle;
         }
-        set 
+        set
         {
             handle = value;
         }
     }
-    
+
     internal static IntPtr GetUniqueHandle()
     {
         return new IntPtr(s_uniqueHandleValue++);
     }
-    
+
     internal static bool IsHandleClosed(IntPtr handle)
     {
         return s_closedHandles.Contains(handle.ToInt32());
@@ -75,7 +75,7 @@ internal class Native
 
     [DllImport("CriticalHandlesNative", CallingConvention = CallingConvention.StdCall)]
     internal static extern IntPtr RefModify(IntPtr handleValue, [MarshalAs(UnmanagedType.LPArray)]ref MyCriticalHandle[] handle);
-    
+
     [DllImport("CriticalHandlesNative", CallingConvention = CallingConvention.StdCall)]
     internal static extern MyCriticalHandle[] Ret(IntPtr handleValue);
 
@@ -85,7 +85,7 @@ internal class Native
 
 public class CriticalHandleArrayTest
 {
-    private static Native.IsHandleClosed s_isHandleClose = (handleValue) => 
+    private static Native.IsHandleClosed s_isHandleClose = (handleValue) =>
     {
         GC.Collect();
         GC.WaitForPendingFinalizers();
index 756f568..b3a62ab 100644 (file)
@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System;
-using TestLibrary;
+using Xunit;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
@@ -39,17 +39,17 @@ internal class MyCriticalHandle : CriticalHandle
         {
             return handle;
         }
-        set 
+        set
         {
             handle = value;
         }
     }
-    
+
     internal static IntPtr GetUniqueHandle()
     {
         return new IntPtr(s_uniqueHandleValue++);
     }
-    
+
     internal static bool IsHandleClosed(IntPtr handle)
     {
         return s_closedHandles.Contains(handle.ToInt32());
@@ -62,7 +62,7 @@ public class Reverse
     {
         IntPtr handleValue = new IntPtr(1);
         Native.InCallback callback = (handle) => { };
-        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeInCallback(callback, handleValue), "Calling P/Invoke that invokes a delegate that has an CriticalHandle parameter");
+        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeInCallback(callback, handleValue));
         GC.KeepAlive(callback);
     }
 
@@ -70,7 +70,7 @@ public class Reverse
     {
         IntPtr handleValue = new IntPtr(2);
         Native.RetCallback callback = () => new MyCriticalHandle();
-        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeRetCallback(callback), "Calling P/Invoke that invokes a delegate that returns a CriticalHandle parameter");
+        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeRetCallback(callback));
         GC.KeepAlive(callback);
     }
 
@@ -78,7 +78,7 @@ public class Reverse
     {
         IntPtr handleValue = new IntPtr(3);
         Native.OutCallback callback = (out MyCriticalHandle handle) => handle = null;
-        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeOutCallback(callback, ref handleValue), "Calling P/Invoke that invokes a delegate that has an out CriticalHandle parameter");
+        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeOutCallback(callback, ref handleValue));
         GC.KeepAlive(callback);
     }
 
@@ -86,7 +86,7 @@ public class Reverse
     {
         IntPtr handleValue = new IntPtr(4);
         Native.InRefCallback callback = (ref MyCriticalHandle handle) => { };
-        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeInRefCallback(callback, ref handleValue), "Calling P/Invoke that invokes a delegate that has an [In] ref CriticalHandle parameter");
+        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeInRefCallback(callback, ref handleValue));
         GC.KeepAlive(callback);
     }
 
@@ -94,7 +94,7 @@ public class Reverse
     {
         IntPtr handleValue = new IntPtr(5);
         Native.RefCallback callback = (ref MyCriticalHandle handle) => { };
-        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeRefCallback(callback, ref handleValue), "Calling P/Invoke that invokes a delegate that has an ref CriticalHandle parameter");
+        Assert.Throws<MarshalDirectiveException>(() => Native.InvokeRefCallback(callback, ref handleValue));
         GC.KeepAlive(callback);
     }
 
index 54ec48e..80bb6bb 100644 (file)
@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System;
-using TestLibrary;
+using Xunit;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
@@ -39,17 +39,17 @@ internal class MyCriticalHandle : CriticalHandle
         {
             return handle;
         }
-        set 
+        set
         {
             handle = value;
         }
     }
-    
+
     internal static IntPtr GetUniqueHandle()
     {
         return new IntPtr(s_uniqueHandleValue++);
     }
-    
+
     internal static bool IsHandleClosed(IntPtr handle)
     {
         return s_closedHandles.Contains(handle.ToInt32());
@@ -58,7 +58,7 @@ internal class MyCriticalHandle : CriticalHandle
 
 public class CriticalHandleStructTest
 {
-    private static Native.HandleCallback s_handleCallback = (handleValue) => 
+    private static Native.HandleCallback s_handleCallback = (handleValue) =>
     {
         GC.Collect();
         GC.WaitForPendingFinalizers();
@@ -71,7 +71,7 @@ public class CriticalHandleStructTest
         InWorker(handleValue);
         GC.Collect();
         GC.WaitForPendingFinalizers();
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed");
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue));
     }
 
     [MethodImpl(MethodImplOptions.NoInlining)]
@@ -80,7 +80,7 @@ public class CriticalHandleStructTest
         Native.MyCriticalHandleStruct handleStruct = new Native.MyCriticalHandleStruct() { Handle = new MyCriticalHandle() { Handle = handleValue } };
         IntPtr value;
         value = Native.In(handleStruct, s_handleCallback);
-        Assert.AreEqual(handleValue.ToInt32(), value.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), value.ToInt32());
     }
 
     public static void Ret()
@@ -101,7 +101,7 @@ public class CriticalHandleStructTest
     {
         Native.MyCriticalHandleStruct handleStruct;
         Native.Out(handleValue, out handleStruct);
-        Assert.AreEqual(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32());
     }
 
     public static void InRef()
@@ -110,7 +110,7 @@ public class CriticalHandleStructTest
         InRefWorker(handleValue);
         GC.Collect();
         GC.WaitForPendingFinalizers();
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed");
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue));
     }
 
     [MethodImpl(MethodImplOptions.NoInlining)]
@@ -118,7 +118,7 @@ public class CriticalHandleStructTest
     {
         Native.MyCriticalHandleStruct handleStruct = new Native.MyCriticalHandleStruct() { Handle = new MyCriticalHandle() { Handle = handleValue } };
         Native.InRef(ref handleStruct, s_handleCallback);
-        Assert.AreEqual(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32());
     }
 
     public static void Ref()
@@ -127,7 +127,7 @@ public class CriticalHandleStructTest
         RefWorker(handleValue);
         GC.Collect();
         GC.WaitForPendingFinalizers();
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed");
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue));
     }
 
     [MethodImpl(MethodImplOptions.NoInlining)]
@@ -135,7 +135,7 @@ public class CriticalHandleStructTest
     {
         Native.MyCriticalHandleStruct handleStruct = new Native.MyCriticalHandleStruct() { Handle = new MyCriticalHandle() { Handle = handleValue } };
         Native.Ref(ref handleStruct, s_handleCallback);
-        Assert.AreEqual(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32());
     }
 
     public static void RefModify()
index 7f455d0..f8416b3 100644 (file)
@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System;
-using TestLibrary;
+using Xunit;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
@@ -39,17 +39,17 @@ internal class MyCriticalHandle : CriticalHandle
         {
             return handle;
         }
-        set 
+        set
         {
             handle = value;
         }
     }
-    
+
     internal static IntPtr GetUniqueHandle()
     {
         return new IntPtr(s_uniqueHandleValue++);
     }
-    
+
     internal static bool IsHandleClosed(IntPtr handle)
     {
         return s_closedHandles.Contains(handle.ToInt32());
@@ -92,7 +92,7 @@ public class CriticalHandleWithNoDefaultCtor : AbstractCriticalHandle
 
 public class CriticalHandleTest
 {
-    private static Native.HandleCallback s_handleCallback = (handleValue) => 
+    private static Native.HandleCallback s_handleCallback = (handleValue) =>
     {
         GC.Collect();
         GC.WaitForPendingFinalizers();
@@ -105,7 +105,7 @@ public class CriticalHandleTest
         InWorker(handleValue);
         GC.Collect();
         GC.WaitForPendingFinalizers();
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed");
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue));
     }
 
     [MethodImpl(MethodImplOptions.NoInlining)]
@@ -114,7 +114,7 @@ public class CriticalHandleTest
         MyCriticalHandle hande = new MyCriticalHandle() { Handle = handleValue };
         IntPtr value;
         value = Native.In(hande, s_handleCallback);
-        Assert.AreEqual(handleValue.ToInt32(), value.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), value.ToInt32());
     }
 
     public static void Ret()
@@ -123,14 +123,14 @@ public class CriticalHandleTest
         RetWorker(handleValue);
         GC.Collect();
         GC.WaitForPendingFinalizers();
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed");
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue));
     }
 
     [MethodImpl(MethodImplOptions.NoInlining)]
     private static void RetWorker(IntPtr handleValue)
     {
         MyCriticalHandle hande = Native.Ret(handleValue);
-        Assert.AreEqual(handleValue.ToInt32(), hande.Handle.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), hande.Handle.ToInt32());
     }
 
     public static void Out()
@@ -139,7 +139,7 @@ public class CriticalHandleTest
         OutWorker(handleValue);
         GC.Collect();
         GC.WaitForPendingFinalizers();
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed");
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue));
     }
 
     [MethodImpl(MethodImplOptions.NoInlining)]
@@ -147,7 +147,7 @@ public class CriticalHandleTest
     {
         MyCriticalHandle hande;
         Native.Out(handleValue, out hande);
-        Assert.AreEqual(handleValue.ToInt32(), hande.Handle.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), hande.Handle.ToInt32());
     }
 
     public static void InRef()
@@ -156,7 +156,7 @@ public class CriticalHandleTest
         InRefWorker(handleValue);
         GC.Collect();
         GC.WaitForPendingFinalizers();
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed");
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue));
     }
 
     [MethodImpl(MethodImplOptions.NoInlining)]
@@ -164,7 +164,7 @@ public class CriticalHandleTest
     {
         MyCriticalHandle hande = new MyCriticalHandle() { Handle = handleValue };
         Native.InRef(ref hande, s_handleCallback);
-        Assert.AreEqual(handleValue.ToInt32(), hande.Handle.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), hande.Handle.ToInt32());
     }
 
     public static void Ref()
@@ -173,7 +173,7 @@ public class CriticalHandleTest
         RefWorker(handleValue);
         GC.Collect();
         GC.WaitForPendingFinalizers();
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed");
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue));
     }
 
     [MethodImpl(MethodImplOptions.NoInlining)]
@@ -181,7 +181,7 @@ public class CriticalHandleTest
     {
         MyCriticalHandle hande = new MyCriticalHandle() { Handle = handleValue };
         Native.Ref(ref hande, s_handleCallback);
-        Assert.AreEqual(handleValue.ToInt32(), hande.Handle.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), hande.Handle.ToInt32());
     }
 
     public static void RefModify()
@@ -191,8 +191,8 @@ public class CriticalHandleTest
         RefModifyWorker(handleValue1, handleValue2);
         GC.Collect();
         GC.WaitForPendingFinalizers();
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue1), "Handle 1 was not closed");
-        Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue2), "Handle 2 was not closed");
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue1));
+        Assert.True(MyCriticalHandle.IsHandleClosed(handleValue2));
     }
 
     [MethodImpl(MethodImplOptions.NoInlining)]
@@ -200,7 +200,7 @@ public class CriticalHandleTest
     {
         MyCriticalHandle hande = new MyCriticalHandle() { Handle = handleValue1 };
         Native.RefModify(handleValue2, ref hande, s_handleCallback);
-        Assert.AreEqual(handleValue2.ToInt32(), hande.Handle.ToInt32(), "Handle value");
+        Assert.Equal(handleValue2.ToInt32(), hande.Handle.ToInt32());
     }
 
     internal class Native
@@ -237,20 +237,20 @@ public class AbstractCriticalHandleTest
         AbstractCriticalHandle handle = new CriticalHandleWithNoDefaultCtor(handleValue);
         IntPtr value;
         value = Native.In(handle, null);
-        Assert.AreEqual(handleValue.ToInt32(), value.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), value.ToInt32());
     }
 
     public static void Ret()
     {
         IntPtr handleValue = new IntPtr(2);
-        Assert.Throws<MarshalDirectiveException>(() => Native.Ret(handleValue), "Calling P/Invoke that returns an abstract critical handle");
+        Assert.Throws<MarshalDirectiveException>(() => Native.Ret(handleValue));
     }
 
     public static void Out()
     {
         IntPtr handleValue = new IntPtr(3);
         AbstractCriticalHandle handle;
-        Assert.Throws<MarshalDirectiveException>(() => Native.Out(handleValue, out handle), "Calling P/Invoke that has an out abstract critical handle parameter");
+        Assert.Throws<MarshalDirectiveException>(() => Native.Out(handleValue, out handle));
     }
 
     public static void InRef()
@@ -258,14 +258,14 @@ public class AbstractCriticalHandleTest
         IntPtr handleValue = new IntPtr(4);
         AbstractCriticalHandle handle = new CriticalHandleWithNoDefaultCtor(handleValue);
         Native.InRef(ref handle, null);
-        Assert.AreEqual(handleValue.ToInt32(), handle.Handle.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), handle.Handle.ToInt32());
     }
 
     public static void Ref()
     {
         IntPtr handleValue = new IntPtr(5);
         AbstractCriticalHandle handle = new CriticalHandleWithNoDefaultCtor(handleValue);
-        Assert.Throws<MarshalDirectiveException>(() => Native.Ref(ref handle, null), "Calling P/Invoke that has a ref abstract critical handle parameter");
+        Assert.Throws<MarshalDirectiveException>(() => Native.Ref(ref handle, null));
     }
 
     internal class Native
@@ -299,14 +299,14 @@ public class NoDefaultCtorCriticalHandleTest
         CriticalHandleWithNoDefaultCtor handle = new CriticalHandleWithNoDefaultCtor(handleValue);
         IntPtr value;
         value = Native.In(handle, null);
-        Assert.AreEqual(handleValue.ToInt32(), value.ToInt32(), "Handle value");
+        Assert.Equal(handleValue.ToInt32(), value.ToInt32());
     }
 
     public static void Ret()
     {
         IntPtr handleValue = new IntPtr(2);
         //TODO: Expected MissingMemberException but throws MissingMethodException
-        Assert.Throws<MissingMethodException>(() => Native.Ret(handleValue), "Calling P/Invoke that returns an no default ctor critical handle");
+        Assert.Throws<MissingMethodException>(() => Native.Ret(handleValue));
     }
 
     public static void Out()
@@ -314,7 +314,7 @@ public class NoDefaultCtorCriticalHandleTest
         IntPtr handleValue = new IntPtr(3);
         CriticalHandleWithNoDefaultCtor handle;
         //TODO: Expected MissingMemberException but throws MissingMethodException
-        Assert.Throws<MissingMethodException>(() => Native.Out(handleValue, out handle), "Calling P/Invoke that has an out no default ctor critical handle parameter");
+        Assert.Throws<MissingMethodException>(() => Native.Out(handleValue, out handle));
     }
 
     public static void InRef()
@@ -322,7 +322,7 @@ public class NoDefaultCtorCriticalHandleTest
         IntPtr handleValue = new IntPtr(4);
         CriticalHandleWithNoDefaultCtor handle = new CriticalHandleWithNoDefaultCtor(handleValue);
         //TODO: Expected MissingMemberException but throws MissingMethodException
-        Assert.Throws<MissingMethodException>(() => Native.InRef(ref handle, null), "Calling P/Invoke that has a [In] ref no default ctor critical handle parameter");
+        Assert.Throws<MissingMethodException>(() => Native.InRef(ref handle, null));
     }
 
     public static void Ref()
@@ -330,7 +330,7 @@ public class NoDefaultCtorCriticalHandleTest
         IntPtr handleValue = new IntPtr(5);
         CriticalHandleWithNoDefaultCtor handle = new CriticalHandleWithNoDefaultCtor(handleValue);
         //TODO: Expected MissingMemberException but throws MissingMethodException
-        Assert.Throws<MissingMethodException>(() => Native.Ref(ref handle, null), "Calling P/Invoke that has a ref no default ctor critical handle parameter");
+        Assert.Throws<MissingMethodException>(() => Native.Ref(ref handle, null));
     }
 
     internal class Native
index b3983b3..b72beb0 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Globalization;
 using System.Reflection;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace PInvokeTests
 {
index 6f25cfb..08c03e2 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public struct DateWrapper
 {
@@ -31,20 +31,20 @@ class DateTimeTest
         {
             DateTime currentDate = new DateTime(2019, 5, 2);
 
-            Assert.AreEqual(currentDate.AddDays(1), NativeDateTime.GetTomorrow(currentDate));
+            Assert.Equal(currentDate.AddDays(1), NativeDateTime.GetTomorrow(currentDate));
 
             NativeDateTime.GetTomorrowByRef(currentDate, out DateTime nextDay);
-            
-            Assert.AreEqual(currentDate.AddDays(1), nextDay);
+
+            Assert.Equal(currentDate.AddDays(1), nextDay);
 
             DateWrapper wrapper = new DateWrapper { date = currentDate };
 
-            Assert.AreEqual(currentDate.AddDays(1), NativeDateTime.GetTomorrowWrapped(wrapper).date);
+            Assert.Equal(currentDate.AddDays(1), NativeDateTime.GetTomorrowWrapped(wrapper).date);
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
         return 100;
     }
index e98277d..a10193b 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class DecimalTest
 {
@@ -31,71 +31,71 @@ public class DecimalTest
 
     private static void RunDecimalTests()
     {
-        Assert.AreEqual((decimal)StartingIntValue, DecimalTestNative.CreateDecimalFromInt(StartingIntValue));
+        Assert.Equal((decimal)StartingIntValue, DecimalTestNative.CreateDecimalFromInt(StartingIntValue));
 
-        Assert.IsTrue(DecimalTestNative.DecimalEqualToInt((decimal)StartingIntValue, StartingIntValue));
+        Assert.True(DecimalTestNative.DecimalEqualToInt((decimal)StartingIntValue, StartingIntValue));
 
         decimal localDecimal = (decimal)StartingIntValue;
-        Assert.IsTrue(DecimalTestNative.ValidateAndChangeDecimal(ref localDecimal, StartingIntValue, NewIntValue));
-        Assert.AreEqual((decimal)NewIntValue, localDecimal);
+        Assert.True(DecimalTestNative.ValidateAndChangeDecimal(ref localDecimal, StartingIntValue, NewIntValue));
+        Assert.Equal((decimal)NewIntValue, localDecimal);
 
         DecimalTestNative.GetDecimalForInt(NewIntValue, out var dec);
-        Assert.AreEqual((decimal)NewIntValue, dec);
-        
-        Assert.AreEqual((decimal)StartingIntValue, DecimalTestNative.CreateWrappedDecimalFromInt(StartingIntValue).dec);
+        Assert.Equal((decimal)NewIntValue, dec);
 
-        Assert.IsTrue(DecimalTestNative.WrappedDecimalEqualToInt(new DecimalTestNative.DecimalWrapper { dec = (decimal)StartingIntValue }, StartingIntValue));
+        Assert.Equal((decimal)StartingIntValue, DecimalTestNative.CreateWrappedDecimalFromInt(StartingIntValue).dec);
+
+        Assert.True(DecimalTestNative.WrappedDecimalEqualToInt(new DecimalTestNative.DecimalWrapper { dec = (decimal)StartingIntValue }, StartingIntValue));
 
         var localDecimalWrapper = new DecimalTestNative.DecimalWrapper { dec = (decimal)StartingIntValue };
-        Assert.IsTrue(DecimalTestNative.ValidateAndChangeWrappedDecimal(ref localDecimalWrapper, StartingIntValue, NewIntValue));
-        Assert.AreEqual((decimal)NewIntValue, localDecimalWrapper.dec);
+        Assert.True(DecimalTestNative.ValidateAndChangeWrappedDecimal(ref localDecimalWrapper, StartingIntValue, NewIntValue));
+        Assert.Equal((decimal)NewIntValue, localDecimalWrapper.dec);
 
         DecimalTestNative.GetWrappedDecimalForInt(NewIntValue, out var decWrapper);
-        Assert.AreEqual((decimal)NewIntValue, decWrapper.dec);
+        Assert.Equal((decimal)NewIntValue, decWrapper.dec);
 
-        DecimalTestNative.PassThroughDecimalToCallback((decimal)NewIntValue, d => Assert.AreEqual((decimal)NewIntValue, d));  
+        DecimalTestNative.PassThroughDecimalToCallback((decimal)NewIntValue, d => Assert.Equal((decimal)NewIntValue, d));
     }
 
     private static void RunLPDecimalTests()
     {
-        Assert.AreEqual((decimal)StartingIntValue, DecimalTestNative.CreateLPDecimalFromInt(StartingIntValue));
+        Assert.Equal((decimal)StartingIntValue, DecimalTestNative.CreateLPDecimalFromInt(StartingIntValue));
 
-        Assert.IsTrue(DecimalTestNative.LPDecimalEqualToInt((decimal)StartingIntValue, StartingIntValue));
+        Assert.True(DecimalTestNative.LPDecimalEqualToInt((decimal)StartingIntValue, StartingIntValue));
 
         decimal localDecimal = (decimal)StartingIntValue;
-        Assert.IsTrue(DecimalTestNative.ValidateAndChangeLPDecimal(ref localDecimal, StartingIntValue, NewIntValue));
-        Assert.AreEqual((decimal)NewIntValue, localDecimal);
+        Assert.True(DecimalTestNative.ValidateAndChangeLPDecimal(ref localDecimal, StartingIntValue, NewIntValue));
+        Assert.Equal((decimal)NewIntValue, localDecimal);
 
         DecimalTestNative.GetLPDecimalForInt(NewIntValue, out var dec);
-        Assert.AreEqual((decimal)NewIntValue, dec);
+        Assert.Equal((decimal)NewIntValue, dec);
 
-        DecimalTestNative.PassThroughLPDecimalToCallback((decimal)NewIntValue, d => Assert.AreEqual((decimal)NewIntValue, d));
+        DecimalTestNative.PassThroughLPDecimalToCallback((decimal)NewIntValue, d => Assert.Equal((decimal)NewIntValue, d));
     }
 
     private static void RunCurrencyTests()
-    {        
+    {
         Assert.Throws<MarshalDirectiveException>(() => DecimalTestNative.CreateCurrencyFromInt(StartingIntValue));
 
-        Assert.IsTrue(DecimalTestNative.CurrencyEqualToInt((decimal)StartingIntValue, StartingIntValue));
+        Assert.True(DecimalTestNative.CurrencyEqualToInt((decimal)StartingIntValue, StartingIntValue));
 
         decimal localCurrency = (decimal)StartingIntValue;
-        Assert.IsTrue(DecimalTestNative.ValidateAndChangeCurrency(ref localCurrency, StartingIntValue, NewIntValue));
-        Assert.AreEqual((decimal)NewIntValue, localCurrency);
+        Assert.True(DecimalTestNative.ValidateAndChangeCurrency(ref localCurrency, StartingIntValue, NewIntValue));
+        Assert.Equal((decimal)NewIntValue, localCurrency);
 
         DecimalTestNative.GetCurrencyForInt(NewIntValue, out var cy);
-        Assert.AreEqual((decimal)NewIntValue, cy);
-        
-        Assert.AreEqual((decimal)StartingIntValue, DecimalTestNative.CreateWrappedCurrencyFromInt(StartingIntValue).currency);
+        Assert.Equal((decimal)NewIntValue, cy);
 
-        Assert.IsTrue(DecimalTestNative.WrappedCurrencyEqualToInt(new DecimalTestNative.CurrencyWrapper { currency = (decimal)StartingIntValue }, StartingIntValue));
+        Assert.Equal((decimal)StartingIntValue, DecimalTestNative.CreateWrappedCurrencyFromInt(StartingIntValue).currency);
+
+        Assert.True(DecimalTestNative.WrappedCurrencyEqualToInt(new DecimalTestNative.CurrencyWrapper { currency = (decimal)StartingIntValue }, StartingIntValue));
 
         var localCurrencyWrapper = new DecimalTestNative.CurrencyWrapper { currency = (decimal)StartingIntValue };
-        Assert.IsTrue(DecimalTestNative.ValidateAndChangeWrappedCurrency(ref localCurrencyWrapper, StartingIntValue, NewIntValue));
-        Assert.AreEqual((decimal)NewIntValue, localCurrencyWrapper.currency);
+        Assert.True(DecimalTestNative.ValidateAndChangeWrappedCurrency(ref localCurrencyWrapper, StartingIntValue, NewIntValue));
+        Assert.Equal((decimal)NewIntValue, localCurrencyWrapper.currency);
 
         DecimalTestNative.GetWrappedCurrencyForInt(NewIntValue, out var currencyWrapper);
-        Assert.AreEqual((decimal)NewIntValue, currencyWrapper.currency);      
-        
-        DecimalTestNative.PassThroughCurrencyToCallback((decimal)NewIntValue, d => Assert.AreEqual((decimal)NewIntValue, d));
+        Assert.Equal((decimal)NewIntValue, currencyWrapper.currency);
+
+        DecimalTestNative.PassThroughCurrencyToCallback((decimal)NewIntValue, d => Assert.Equal((decimal)NewIntValue, d));
     }
 }
index 37ed43c..c696155 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 using static DelegateTestNative;
 
@@ -15,22 +15,22 @@ class DelegateTest
         int expectedValue = 987654;
         int TestFunction() => expectedValue;
 
-        Assert.IsTrue(ValidateDelegateReturnsExpected(expectedValue, TestFunction));
-        
+        Assert.True(ValidateDelegateReturnsExpected(expectedValue, TestFunction));
+
         {
             TestDelegate localDelegate = TestFunction;
-            Assert.IsTrue(ReplaceDelegate(expectedValue, ref localDelegate, out int newExpectedValue));
-            Assert.AreEqual(newExpectedValue, localDelegate());
+            Assert.True(ReplaceDelegate(expectedValue, ref localDelegate, out int newExpectedValue));
+            Assert.Equal(newExpectedValue, localDelegate());
         }
 
         {
             GetNativeTestFunction(out TestDelegate test, out int value);
-            Assert.AreEqual(value, test());
+            Assert.Equal(value, test());
         }
 
         {
             var returned = GetNativeTestFunctionReturned(out int value);
-            Assert.AreEqual(value, returned());
+            Assert.Equal(value, returned());
         }
 
         {
@@ -40,7 +40,7 @@ class DelegateTest
                 del = TestFunction
             };
 
-            Assert.IsTrue(ValidateCallbackWithValue(cb));
+            Assert.True(ValidateCallbackWithValue(cb));
         }
 
         {
@@ -50,13 +50,13 @@ class DelegateTest
                 del = TestFunction
             };
 
-            Assert.IsTrue(ValidateAndUpdateCallbackWithValue(ref cb));
-            Assert.AreEqual(cb.expectedValue, cb.del());
+            Assert.True(ValidateAndUpdateCallbackWithValue(ref cb));
+            Assert.Equal(cb.expectedValue, cb.del());
         }
 
         {
             GetNativeCallbackAndValue(out CallbackWithExpectedValue cb);
-            Assert.AreEqual(cb.expectedValue, cb.del());
+            Assert.Equal(cb.expectedValue, cb.del());
         }
     }
 
@@ -65,23 +65,23 @@ class DelegateTest
         int expectedValue = 987654;
         int TestFunction() => expectedValue;
 
-        Assert.IsTrue(ValidateDelegateValueMatchesExpected(expectedValue, TestFunction));
-        
+        Assert.True(ValidateDelegateValueMatchesExpected(expectedValue, TestFunction));
+
         {
             TestDelegate localDelegate = TestFunction;
-            Assert.IsTrue(ValidateDelegateValueMatchesExpectedAndClear(expectedValue, ref localDelegate));
-            Assert.AreEqual(null, localDelegate);
+            Assert.True(ValidateDelegateValueMatchesExpectedAndClear(expectedValue, ref localDelegate));
+            Assert.Equal(null, localDelegate);
         }
 
         {
             TestDelegate localDelegate = TestFunction;
-            Assert.IsTrue(DuplicateDelegate(expectedValue, localDelegate, out var outDelegate));
-            Assert.AreEqual(localDelegate, outDelegate);
+            Assert.True(DuplicateDelegate(expectedValue, localDelegate, out var outDelegate));
+            Assert.Equal(localDelegate, outDelegate);
         }
 
         {
             TestDelegate localDelegate = TestFunction;
-            Assert.AreEqual(localDelegate, DuplicateDelegateReturned(localDelegate));
+            Assert.Equal(localDelegate, DuplicateDelegateReturned(localDelegate));
         }
 
         {
@@ -91,7 +91,7 @@ class DelegateTest
                 del = TestFunction
             };
 
-            Assert.IsTrue(ValidateStructDelegateValueMatchesExpected(cb));
+            Assert.True(ValidateStructDelegateValueMatchesExpected(cb));
         }
 
         {
@@ -101,8 +101,8 @@ class DelegateTest
                 del = TestFunction
             };
 
-            Assert.IsTrue(ValidateDelegateValueMatchesExpectedAndClearStruct(ref cb));
-            Assert.AreEqual(null, cb.del);
+            Assert.True(ValidateDelegateValueMatchesExpectedAndClearStruct(ref cb));
+            Assert.Equal(null, cb.del);
         }
 
         {
@@ -112,8 +112,8 @@ class DelegateTest
                 del = TestFunction
             };
 
-            Assert.IsTrue(DuplicateStruct(cb, out var cbOut));
-            Assert.AreEqual(cbOut.expectedValue, cbOut.del());
+            Assert.True(DuplicateStruct(cb, out var cbOut));
+            Assert.Equal(cbOut.expectedValue, cbOut.del());
         }
 
         Assert.Throws<MarshalDirectiveException>(() => MarshalDelegateAsInterface(TestFunction));
@@ -131,8 +131,8 @@ class DelegateTest
         }
         catch (Exception e)
         {
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
         return 100;
     }
index c53add4..3ca01be 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 3ac4589..9259a82 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index edb69da..6fa8426 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 17cff90..0f0e7e1 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 48ad951..2b8cb74 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 9959071..365ad7a 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 82c6412..83d787e 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 62faa82..728ef99 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 1347e9b..ef5a326 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 2a49a83..f5933b1 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 9e26906..6cc2b03 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index ba0b7b5..e51e1a0 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index a1e5337..726628e 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index dede7ad..4c39e0b 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index e940e84..0dc19c5 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,23 +40,23 @@ unsafe partial class GenericsTest
     private static void TestPoint1D()
     {
         GenericsNative.Point1<double> value = GenericsNative.GetPoint1D(1.0);
-        Assert.AreEqual(value.e00, 1.0);
+        Assert.Equal(value.e00, 1.0);
 
         GenericsNative.Point1<double> value2;
         GenericsNative.GetPoint1DOut(1.0, &value2);
-        Assert.AreEqual(value2.e00, 1.0);
+        Assert.Equal(value2.e00, 1.0);
 
         GenericsNative.GetPoint1DOut(1.0, out GenericsNative.Point1<double> value3);
-        Assert.AreEqual(value3.e00, 1.0);
+        Assert.Equal(value3.e00, 1.0);
 
         GenericsNative.Point1<double>* value4 = GenericsNative.GetPoint1DPtr(1.0);
-        Assert.AreEqual(value4->e00, 1.0);
+        Assert.Equal(value4->e00, 1.0);
 
         ref readonly GenericsNative.Point1<double> value5 = ref GenericsNative.GetPoint1DRef(1.0);
-        Assert.AreEqual(value5.e00, 1.0);
+        Assert.Equal(value5.e00, 1.0);
 
         GenericsNative.Point1<double> result = GenericsNative.AddPoint1D(value, value);
-        Assert.AreEqual(result.e00, 2.0);
+        Assert.Equal(result.e00, 2.0);
 
         GenericsNative.Point1<double>[] values = new GenericsNative.Point1<double>[] {
             value,
@@ -69,13 +69,13 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point1<double>* pValues = &values[0])
         {
             GenericsNative.Point1<double> result2 = GenericsNative.AddPoint1Ds(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5.0);
+            Assert.Equal(result2.e00, 5.0);
         }
 
         GenericsNative.Point1<double> result3 = GenericsNative.AddPoint1Ds(values, values.Length);
-        Assert.AreEqual(result3.e00, 5.0);
+        Assert.Equal(result3.e00, 5.0);
 
         GenericsNative.Point1<double> result4 = GenericsNative.AddPoint1Ds(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5.0);
+        Assert.Equal(result4.e00, 5.0);
     }
 }
index 55e2314..29f6acd 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,23 +40,23 @@ unsafe partial class GenericsTest
     private static void TestPoint1F()
     {
         GenericsNative.Point1<float> value = GenericsNative.GetPoint1F(1.0f);
-        Assert.AreEqual(value.e00, 1.0f);
+        Assert.Equal(value.e00, 1.0f);
 
         GenericsNative.Point1<float> value2;
         GenericsNative.GetPoint1FOut(1.0f, &value2);
-        Assert.AreEqual(value2.e00, 1.0f);
+        Assert.Equal(value2.e00, 1.0f);
 
         GenericsNative.GetPoint1FOut(1.0f, out GenericsNative.Point1<float> value3);
-        Assert.AreEqual(value3.e00, 1.0f);
+        Assert.Equal(value3.e00, 1.0f);
 
         GenericsNative.Point1<float>* value4 = GenericsNative.GetPoint1FPtr(1.0f);
-        Assert.AreEqual(value4->e00, 1.0f);
+        Assert.Equal(value4->e00, 1.0f);
 
         ref readonly GenericsNative.Point1<float> value5 = ref GenericsNative.GetPoint1FRef(1.0f);
-        Assert.AreEqual(value5.e00, 1.0f);
+        Assert.Equal(value5.e00, 1.0f);
 
         GenericsNative.Point1<float> result = GenericsNative.AddPoint1F(value, value);
-        Assert.AreEqual(result.e00, 2.0f);
+        Assert.Equal(result.e00, 2.0f);
 
         GenericsNative.Point1<float>[] values = new GenericsNative.Point1<float>[] {
             value,
@@ -69,13 +69,13 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point1<float>* pValues = &values[0])
         {
             GenericsNative.Point1<float> result2 = GenericsNative.AddPoint1Fs(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5.0f);
+            Assert.Equal(result2.e00, 5.0f);
         }
 
         GenericsNative.Point1<float> result3 = GenericsNative.AddPoint1Fs(values, values.Length);
-        Assert.AreEqual(result3.e00, 5.0f);
+        Assert.Equal(result3.e00, 5.0f);
 
         GenericsNative.Point1<float> result4 = GenericsNative.AddPoint1Fs(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5.0f);
+        Assert.Equal(result4.e00, 5.0f);
     }
 }
index 2506e2d..d981f07 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,23 +40,23 @@ unsafe partial class GenericsTest
     private static void TestPoint1L()
     {
         GenericsNative.Point1<long> value = GenericsNative.GetPoint1L(1L);
-        Assert.AreEqual(value.e00, 1L);
+        Assert.Equal(value.e00, 1L);
 
         GenericsNative.Point1<long> value2;
         GenericsNative.GetPoint1LOut(1L, &value2);
-        Assert.AreEqual(value2.e00, 1L);
+        Assert.Equal(value2.e00, 1L);
 
         GenericsNative.GetPoint1LOut(1L, out GenericsNative.Point1<long> value3);
-        Assert.AreEqual(value3.e00, 1L);
+        Assert.Equal(value3.e00, 1L);
 
         GenericsNative.Point1<long>* value4 = GenericsNative.GetPoint1LPtr(1L);
-        Assert.AreEqual(value4->e00, 1L);
+        Assert.Equal(value4->e00, 1L);
 
         ref readonly GenericsNative.Point1<long> value5 = ref GenericsNative.GetPoint1LRef(1L);
-        Assert.AreEqual(value5.e00, 1L);
+        Assert.Equal(value5.e00, 1L);
 
         GenericsNative.Point1<long> result = GenericsNative.AddPoint1L(value, value);
-        Assert.AreEqual(result.e00, 2L);
+        Assert.Equal(result.e00, 2L);
 
         GenericsNative.Point1<long>[] values = new GenericsNative.Point1<long>[] {
             value,
@@ -69,13 +69,13 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point1<long>* pValues = &values[0])
         {
             GenericsNative.Point1<long> result2 = GenericsNative.AddPoint1Ls(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5l);
+            Assert.Equal(result2.e00, 5l);
         }
 
         GenericsNative.Point1<long> result3 = GenericsNative.AddPoint1Ls(values, values.Length);
-        Assert.AreEqual(result3.e00, 5l);
+        Assert.Equal(result3.e00, 5l);
 
         GenericsNative.Point1<long> result4 = GenericsNative.AddPoint1Ls(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5l);
+        Assert.Equal(result4.e00, 5l);
     }
 }
index ecf873e..8aeda75 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,23 +40,23 @@ unsafe partial class GenericsTest
     private static void TestPoint1U()
     {
         GenericsNative.Point1<uint> value = GenericsNative.GetPoint1U(1u);
-        Assert.AreEqual(value.e00, 1u);
+        Assert.Equal(value.e00, 1u);
 
         GenericsNative.Point1<uint> value2;
         GenericsNative.GetPoint1UOut(1u, &value2);
-        Assert.AreEqual(value2.e00, 1u);
+        Assert.Equal(value2.e00, 1u);
 
         GenericsNative.GetPoint1UOut(1u, out GenericsNative.Point1<uint> value3);
-        Assert.AreEqual(value3.e00, 1u);
+        Assert.Equal(value3.e00, 1u);
 
         GenericsNative.Point1<uint>* value4 = GenericsNative.GetPoint1UPtr(1u);
-        Assert.AreEqual(value4->e00, 1u);
+        Assert.Equal(value4->e00, 1u);
 
         ref readonly GenericsNative.Point1<uint> value5 = ref GenericsNative.GetPoint1URef(1u);
-        Assert.AreEqual(value5.e00, 1u);
+        Assert.Equal(value5.e00, 1u);
 
         GenericsNative.Point1<uint> result = GenericsNative.AddPoint1U(value, value);
-        Assert.AreEqual(result.e00, 2u);
+        Assert.Equal(result.e00, 2u);
 
         GenericsNative.Point1<uint>[] values = new GenericsNative.Point1<uint>[] {
             value,
@@ -69,13 +69,13 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point1<uint>* pValues = &values[0])
         {
             GenericsNative.Point1<uint> result2 = GenericsNative.AddPoint1Us(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5u);
+            Assert.Equal(result2.e00, 5u);
         }
 
         GenericsNative.Point1<uint> result3 = GenericsNative.AddPoint1Us(values, values.Length);
-        Assert.AreEqual(result3.e00, 5u);
+        Assert.Equal(result3.e00, 5u);
 
         GenericsNative.Point1<uint> result4 = GenericsNative.AddPoint1Us(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5u);
+        Assert.Equal(result4.e00, 5u);
     }
 }
index da42508..41710f1 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 3bde7d6..e54ff64 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 47e048b..b269a7a 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,29 +40,29 @@ unsafe partial class GenericsTest
     private static void TestPoint2D()
     {
         GenericsNative.Point2<double> value = GenericsNative.GetPoint2D(1.0, 2.0);
-        Assert.AreEqual(value.e00, 1.0);
-        Assert.AreEqual(value.e01, 2.0);
+        Assert.Equal(value.e00, 1.0);
+        Assert.Equal(value.e01, 2.0);
 
         GenericsNative.Point2<double> value2;
         GenericsNative.GetPoint2DOut(1.0, 2.0, &value2);
-        Assert.AreEqual(value2.e00, 1.0);
-        Assert.AreEqual(value2.e01, 2.0);
+        Assert.Equal(value2.e00, 1.0);
+        Assert.Equal(value2.e01, 2.0);
 
         GenericsNative.GetPoint2DOut(1.0, 2.0, out GenericsNative.Point2<double> value3);
-        Assert.AreEqual(value3.e00, 1.0);
-        Assert.AreEqual(value3.e01, 2.0);
+        Assert.Equal(value3.e00, 1.0);
+        Assert.Equal(value3.e01, 2.0);
 
         GenericsNative.Point2<double>* value4 = GenericsNative.GetPoint2DPtr(1.0, 2.0);
-        Assert.AreEqual(value4->e00, 1.0);
-        Assert.AreEqual(value4->e01, 2.0);
+        Assert.Equal(value4->e00, 1.0);
+        Assert.Equal(value4->e01, 2.0);
 
         ref readonly GenericsNative.Point2<double> value5 = ref GenericsNative.GetPoint2DRef(1.0, 2.0);
-        Assert.AreEqual(value5.e00, 1.0);
-        Assert.AreEqual(value5.e01, 2.0);
+        Assert.Equal(value5.e00, 1.0);
+        Assert.Equal(value5.e01, 2.0);
 
         GenericsNative.Point2<double> result = GenericsNative.AddPoint2D(value, value);
-        Assert.AreEqual(result.e00, 2.0);
-        Assert.AreEqual(result.e01, 4.0);
+        Assert.Equal(result.e00, 2.0);
+        Assert.Equal(result.e01, 4.0);
 
         GenericsNative.Point2<double>[] values = new GenericsNative.Point2<double>[] {
             value,
@@ -75,16 +75,16 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point2<double>* pValues = &values[0])
         {
             GenericsNative.Point2<double> result2 = GenericsNative.AddPoint2Ds(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5.0);
-            Assert.AreEqual(result2.e01, 10.0);
+            Assert.Equal(result2.e00, 5.0);
+            Assert.Equal(result2.e01, 10.0);
         }
 
         GenericsNative.Point2<double> result3 = GenericsNative.AddPoint2Ds(values, values.Length);
-        Assert.AreEqual(result3.e00, 5.0);
-        Assert.AreEqual(result3.e01, 10.0);
+        Assert.Equal(result3.e00, 5.0);
+        Assert.Equal(result3.e01, 10.0);
 
         GenericsNative.Point2<double> result4 = GenericsNative.AddPoint2Ds(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5.0);
-        Assert.AreEqual(result4.e01, 10.0);
+        Assert.Equal(result4.e00, 5.0);
+        Assert.Equal(result4.e01, 10.0);
     }
 }
index 4a52605..2785545 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,29 +40,29 @@ unsafe partial class GenericsTest
     private static void TestPoint2F()
     {
         GenericsNative.Point2<float> value = GenericsNative.GetPoint2F(1.0f, 2.0f);
-        Assert.AreEqual(value.e00, 1.0f);
-        Assert.AreEqual(value.e01, 2.0f);
+        Assert.Equal(value.e00, 1.0f);
+        Assert.Equal(value.e01, 2.0f);
 
         GenericsNative.Point2<float> value2;
         GenericsNative.GetPoint2FOut(1.0f, 2.0f, &value2);
-        Assert.AreEqual(value2.e00, 1.0f);
-        Assert.AreEqual(value2.e01, 2.0f);
+        Assert.Equal(value2.e00, 1.0f);
+        Assert.Equal(value2.e01, 2.0f);
 
         GenericsNative.GetPoint2FOut(1.0f, 2.0f, out GenericsNative.Point2<float> value3);
-        Assert.AreEqual(value3.e00, 1.0f);
-        Assert.AreEqual(value3.e01, 2.0f);
+        Assert.Equal(value3.e00, 1.0f);
+        Assert.Equal(value3.e01, 2.0f);
 
         GenericsNative.Point2<float>* value4 = GenericsNative.GetPoint2FPtr(1.0f, 2.0f);
-        Assert.AreEqual(value4->e00, 1.0f);
-        Assert.AreEqual(value4->e01, 2.0f);
+        Assert.Equal(value4->e00, 1.0f);
+        Assert.Equal(value4->e01, 2.0f);
 
         ref readonly GenericsNative.Point2<float> value5 = ref GenericsNative.GetPoint2FRef(1.0f, 2.0f);
-        Assert.AreEqual(value5.e00, 1.0f);
-        Assert.AreEqual(value5.e01, 2.0f);
+        Assert.Equal(value5.e00, 1.0f);
+        Assert.Equal(value5.e01, 2.0f);
 
         GenericsNative.Point2<float> result = GenericsNative.AddPoint2F(value, value);
-        Assert.AreEqual(result.e00, 2.0f);
-        Assert.AreEqual(result.e01, 4.0f);
+        Assert.Equal(result.e00, 2.0f);
+        Assert.Equal(result.e01, 4.0f);
 
         GenericsNative.Point2<float>[] values = new GenericsNative.Point2<float>[] {
             value,
@@ -75,16 +75,16 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point2<float>* pValues = &values[0])
         {
             GenericsNative.Point2<float> result2 = GenericsNative.AddPoint2Fs(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5.0f);
-            Assert.AreEqual(result2.e01, 10.0f);
+            Assert.Equal(result2.e00, 5.0f);
+            Assert.Equal(result2.e01, 10.0f);
         }
 
         GenericsNative.Point2<float> result3 = GenericsNative.AddPoint2Fs(values, values.Length);
-        Assert.AreEqual(result3.e00, 5.0f);
-        Assert.AreEqual(result3.e01, 10.0f);
+        Assert.Equal(result3.e00, 5.0f);
+        Assert.Equal(result3.e01, 10.0f);
 
         GenericsNative.Point2<float> result4 = GenericsNative.AddPoint2Fs(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5.0f);
-        Assert.AreEqual(result4.e01, 10.0f);
+        Assert.Equal(result4.e00, 5.0f);
+        Assert.Equal(result4.e01, 10.0f);
     }
 }
index b62f65e..7220acb 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,29 +40,29 @@ unsafe partial class GenericsTest
     private static void TestPoint2L()
     {
         GenericsNative.Point2<long> value = GenericsNative.GetPoint2L(1L, 2L);
-        Assert.AreEqual(value.e00, 1L);
-        Assert.AreEqual(value.e01, 2L);
+        Assert.Equal(value.e00, 1L);
+        Assert.Equal(value.e01, 2L);
 
         GenericsNative.Point2<long> value2;
         GenericsNative.GetPoint2LOut(1L, 2L, &value2);
-        Assert.AreEqual(value2.e00, 1L);
-        Assert.AreEqual(value2.e01, 2L);
+        Assert.Equal(value2.e00, 1L);
+        Assert.Equal(value2.e01, 2L);
 
         GenericsNative.GetPoint2LOut(1L, 2L, out GenericsNative.Point2<long> value3);
-        Assert.AreEqual(value3.e00, 1L);
-        Assert.AreEqual(value3.e01, 2L);
+        Assert.Equal(value3.e00, 1L);
+        Assert.Equal(value3.e01, 2L);
 
         GenericsNative.Point2<long>* value4 = GenericsNative.GetPoint2LPtr(1L, 2L);
-        Assert.AreEqual(value4->e00, 1L);
-        Assert.AreEqual(value4->e01, 2L);
+        Assert.Equal(value4->e00, 1L);
+        Assert.Equal(value4->e01, 2L);
 
         ref readonly GenericsNative.Point2<long> value5 = ref GenericsNative.GetPoint2LRef(1L, 2L);
-        Assert.AreEqual(value5.e00, 1L);
-        Assert.AreEqual(value5.e01, 2L);
+        Assert.Equal(value5.e00, 1L);
+        Assert.Equal(value5.e01, 2L);
 
         GenericsNative.Point2<long> result = GenericsNative.AddPoint2L(value, value);
-        Assert.AreEqual(result.e00, 2L);
-        Assert.AreEqual(result.e01, 4L);
+        Assert.Equal(result.e00, 2L);
+        Assert.Equal(result.e01, 4L);
 
         GenericsNative.Point2<long>[] values = new GenericsNative.Point2<long>[] {
             value,
@@ -75,16 +75,16 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point2<long>* pValues = &values[0])
         {
             GenericsNative.Point2<long> result2 = GenericsNative.AddPoint2Ls(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5l);
-            Assert.AreEqual(result2.e01, 10l);
+            Assert.Equal(result2.e00, 5l);
+            Assert.Equal(result2.e01, 10l);
         }
 
         GenericsNative.Point2<long> result3 = GenericsNative.AddPoint2Ls(values, values.Length);
-        Assert.AreEqual(result3.e00, 5l);
-        Assert.AreEqual(result3.e01, 10l);
+        Assert.Equal(result3.e00, 5l);
+        Assert.Equal(result3.e01, 10l);
 
         GenericsNative.Point2<long> result4 = GenericsNative.AddPoint2Ls(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5l);
-        Assert.AreEqual(result4.e01, 10l);
+        Assert.Equal(result4.e00, 5l);
+        Assert.Equal(result4.e01, 10l);
     }
 }
index 06f3662..05d3e5f 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,29 +40,29 @@ unsafe partial class GenericsTest
     private static void TestPoint2U()
     {
         GenericsNative.Point2<uint> value = GenericsNative.GetPoint2U(1u, 2u);
-        Assert.AreEqual(value.e00, 1u);
-        Assert.AreEqual(value.e01, 2u);
+        Assert.Equal(value.e00, 1u);
+        Assert.Equal(value.e01, 2u);
 
         GenericsNative.Point2<uint> value2;
         GenericsNative.GetPoint2UOut(1u, 2u, &value2);
-        Assert.AreEqual(value2.e00, 1u);
-        Assert.AreEqual(value2.e01, 2u);
+        Assert.Equal(value2.e00, 1u);
+        Assert.Equal(value2.e01, 2u);
 
         GenericsNative.GetPoint2UOut(1u, 2u, out GenericsNative.Point2<uint> value3);
-        Assert.AreEqual(value3.e00, 1u);
-        Assert.AreEqual(value3.e01, 2u);
+        Assert.Equal(value3.e00, 1u);
+        Assert.Equal(value3.e01, 2u);
 
         GenericsNative.Point2<uint>* value4 = GenericsNative.GetPoint2UPtr(1u, 2u);
-        Assert.AreEqual(value4->e00, 1u);
-        Assert.AreEqual(value4->e01, 2u);
+        Assert.Equal(value4->e00, 1u);
+        Assert.Equal(value4->e01, 2u);
 
         ref readonly GenericsNative.Point2<uint> value5 = ref GenericsNative.GetPoint2URef(1u, 2u);
-        Assert.AreEqual(value5.e00, 1u);
-        Assert.AreEqual(value5.e01, 2u);
+        Assert.Equal(value5.e00, 1u);
+        Assert.Equal(value5.e01, 2u);
 
         GenericsNative.Point2<uint> result = GenericsNative.AddPoint2U(value, value);
-        Assert.AreEqual(result.e00, 2u);
-        Assert.AreEqual(result.e01, 4u);
+        Assert.Equal(result.e00, 2u);
+        Assert.Equal(result.e01, 4u);
 
         GenericsNative.Point2<uint>[] values = new GenericsNative.Point2<uint>[] {
             value,
@@ -75,16 +75,16 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point2<uint>* pValues = &values[0])
         {
             GenericsNative.Point2<uint> result2 = GenericsNative.AddPoint2Us(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5u);
-            Assert.AreEqual(result2.e01, 10u);
+            Assert.Equal(result2.e00, 5u);
+            Assert.Equal(result2.e01, 10u);
         }
 
         GenericsNative.Point2<uint> result3 = GenericsNative.AddPoint2Us(values, values.Length);
-        Assert.AreEqual(result3.e00, 5u);
-        Assert.AreEqual(result3.e01, 10u);
+        Assert.Equal(result3.e00, 5u);
+        Assert.Equal(result3.e01, 10u);
 
         GenericsNative.Point2<uint> result4 = GenericsNative.AddPoint2Us(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5u);
-        Assert.AreEqual(result4.e01, 10u);
+        Assert.Equal(result4.e00, 5u);
+        Assert.Equal(result4.e01, 10u);
     }
 }
index c826278..83fd891 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index c210836..662b7d2 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 342038e..0215ce5 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,35 +40,35 @@ unsafe partial class GenericsTest
     private static void TestPoint3D()
     {
         GenericsNative.Point3<double> value = GenericsNative.GetPoint3D(1.0, 2.0, 3.0);
-        Assert.AreEqual(value.e00, 1.0);
-        Assert.AreEqual(value.e01, 2.0);
-        Assert.AreEqual(value.e02, 3.0);
+        Assert.Equal(value.e00, 1.0);
+        Assert.Equal(value.e01, 2.0);
+        Assert.Equal(value.e02, 3.0);
 
         GenericsNative.Point3<double> value2;
         GenericsNative.GetPoint3DOut(1.0, 2.0, 3.0, &value2);
-        Assert.AreEqual(value2.e00, 1.0);
-        Assert.AreEqual(value2.e01, 2.0);
-        Assert.AreEqual(value2.e02, 3.0);
+        Assert.Equal(value2.e00, 1.0);
+        Assert.Equal(value2.e01, 2.0);
+        Assert.Equal(value2.e02, 3.0);
 
         GenericsNative.GetPoint3DOut(1.0, 2.0, 3.0, out GenericsNative.Point3<double> value3);
-        Assert.AreEqual(value3.e00, 1.0);
-        Assert.AreEqual(value3.e01, 2.0);
-        Assert.AreEqual(value3.e02, 3.0);
+        Assert.Equal(value3.e00, 1.0);
+        Assert.Equal(value3.e01, 2.0);
+        Assert.Equal(value3.e02, 3.0);
 
         GenericsNative.Point3<double>* value4 = GenericsNative.GetPoint3DPtr(1.0, 2.0, 3.0);
-        Assert.AreEqual(value4->e00, 1.0);
-        Assert.AreEqual(value4->e01, 2.0);
-        Assert.AreEqual(value4->e02, 3.0);
+        Assert.Equal(value4->e00, 1.0);
+        Assert.Equal(value4->e01, 2.0);
+        Assert.Equal(value4->e02, 3.0);
 
         ref readonly GenericsNative.Point3<double> value5 = ref GenericsNative.GetPoint3DRef(1.0, 2.0, 3.0);
-        Assert.AreEqual(value5.e00, 1.0);
-        Assert.AreEqual(value5.e01, 2.0);
-        Assert.AreEqual(value5.e02, 3.0);
+        Assert.Equal(value5.e00, 1.0);
+        Assert.Equal(value5.e01, 2.0);
+        Assert.Equal(value5.e02, 3.0);
 
         GenericsNative.Point3<double> result = GenericsNative.AddPoint3D(value, value);
-        Assert.AreEqual(result.e00, 2.0);
-        Assert.AreEqual(result.e01, 4.0);
-        Assert.AreEqual(result.e02, 6.0);
+        Assert.Equal(result.e00, 2.0);
+        Assert.Equal(result.e01, 4.0);
+        Assert.Equal(result.e02, 6.0);
 
         GenericsNative.Point3<double>[] values = new GenericsNative.Point3<double>[] {
             value,
@@ -81,19 +81,19 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point3<double>* pValues = &values[0])
         {
             GenericsNative.Point3<double> result2 = GenericsNative.AddPoint3Ds(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5.0);
-            Assert.AreEqual(result2.e01, 10.0);
-            Assert.AreEqual(result2.e02, 15.0);
+            Assert.Equal(result2.e00, 5.0);
+            Assert.Equal(result2.e01, 10.0);
+            Assert.Equal(result2.e02, 15.0);
         }
 
         GenericsNative.Point3<double> result3 = GenericsNative.AddPoint3Ds(values, values.Length);
-        Assert.AreEqual(result3.e00, 5.0);
-        Assert.AreEqual(result3.e01, 10.0);
-        Assert.AreEqual(result3.e02, 15.0);
+        Assert.Equal(result3.e00, 5.0);
+        Assert.Equal(result3.e01, 10.0);
+        Assert.Equal(result3.e02, 15.0);
 
         GenericsNative.Point3<double> result4 = GenericsNative.AddPoint3Ds(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5.0);
-        Assert.AreEqual(result4.e01, 10.0);
-        Assert.AreEqual(result4.e02, 15.0);
+        Assert.Equal(result4.e00, 5.0);
+        Assert.Equal(result4.e01, 10.0);
+        Assert.Equal(result4.e02, 15.0);
     }
 }
index bf66f0f..bb95658 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,35 +40,35 @@ unsafe partial class GenericsTest
     private static void TestPoint3F()
     {
         GenericsNative.Point3<float> value = GenericsNative.GetPoint3F(1.0f, 2.0f, 3.0f);
-        Assert.AreEqual(value.e00, 1.0f);
-        Assert.AreEqual(value.e01, 2.0f);
-        Assert.AreEqual(value.e02, 3.0f);
+        Assert.Equal(value.e00, 1.0f);
+        Assert.Equal(value.e01, 2.0f);
+        Assert.Equal(value.e02, 3.0f);
 
         GenericsNative.Point3<float> value2;
         GenericsNative.GetPoint3FOut(1.0f, 2.0f, 3.0f, &value2);
-        Assert.AreEqual(value2.e00, 1.0f);
-        Assert.AreEqual(value2.e01, 2.0f);
-        Assert.AreEqual(value2.e02, 3.0f);
+        Assert.Equal(value2.e00, 1.0f);
+        Assert.Equal(value2.e01, 2.0f);
+        Assert.Equal(value2.e02, 3.0f);
 
         GenericsNative.GetPoint3FOut(1.0f, 2.0f, 3.0f, out GenericsNative.Point3<float> value3);
-        Assert.AreEqual(value3.e00, 1.0f);
-        Assert.AreEqual(value3.e01, 2.0f);
-        Assert.AreEqual(value3.e02, 3.0f);
+        Assert.Equal(value3.e00, 1.0f);
+        Assert.Equal(value3.e01, 2.0f);
+        Assert.Equal(value3.e02, 3.0f);
 
         GenericsNative.Point3<float>* value4 = GenericsNative.GetPoint3FPtr(1.0f, 2.0f, 3.0f);
-        Assert.AreEqual(value4->e00, 1.0f);
-        Assert.AreEqual(value4->e01, 2.0f);
-        Assert.AreEqual(value4->e02, 3.0f);
+        Assert.Equal(value4->e00, 1.0f);
+        Assert.Equal(value4->e01, 2.0f);
+        Assert.Equal(value4->e02, 3.0f);
 
         ref readonly GenericsNative.Point3<float> value5 = ref GenericsNative.GetPoint3FRef(1.0f, 2.0f, 3.0f);
-        Assert.AreEqual(value5.e00, 1.0f);
-        Assert.AreEqual(value5.e01, 2.0f);
-        Assert.AreEqual(value5.e02, 3.0f);
+        Assert.Equal(value5.e00, 1.0f);
+        Assert.Equal(value5.e01, 2.0f);
+        Assert.Equal(value5.e02, 3.0f);
 
         GenericsNative.Point3<float> result = GenericsNative.AddPoint3F(value, value);
-        Assert.AreEqual(result.e00, 2.0f);
-        Assert.AreEqual(result.e01, 4.0f);
-        Assert.AreEqual(result.e02, 6.0f);
+        Assert.Equal(result.e00, 2.0f);
+        Assert.Equal(result.e01, 4.0f);
+        Assert.Equal(result.e02, 6.0f);
 
         GenericsNative.Point3<float>[] values = new GenericsNative.Point3<float>[] {
             value,
@@ -81,19 +81,19 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point3<float>* pValues = &values[0])
         {
             GenericsNative.Point3<float> result2 = GenericsNative.AddPoint3Fs(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5.0f);
-            Assert.AreEqual(result2.e01, 10.0f);
-            Assert.AreEqual(result2.e02, 15.0f);
+            Assert.Equal(result2.e00, 5.0f);
+            Assert.Equal(result2.e01, 10.0f);
+            Assert.Equal(result2.e02, 15.0f);
         }
 
         GenericsNative.Point3<float> result3 = GenericsNative.AddPoint3Fs(values, values.Length);
-        Assert.AreEqual(result3.e00, 5.0f);
-        Assert.AreEqual(result3.e01, 10.0f);
-        Assert.AreEqual(result3.e02, 15.0f);
+        Assert.Equal(result3.e00, 5.0f);
+        Assert.Equal(result3.e01, 10.0f);
+        Assert.Equal(result3.e02, 15.0f);
 
         GenericsNative.Point3<float> result4 = GenericsNative.AddPoint3Fs(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5.0f);
-        Assert.AreEqual(result4.e01, 10.0f);
-        Assert.AreEqual(result4.e02, 15.0f);
+        Assert.Equal(result4.e00, 5.0f);
+        Assert.Equal(result4.e01, 10.0f);
+        Assert.Equal(result4.e02, 15.0f);
     }
 }
index 2a28836..ede3b6c 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,35 +40,35 @@ unsafe partial class GenericsTest
     private static void TestPoint3L()
     {
         GenericsNative.Point3<long> value = GenericsNative.GetPoint3L(1L, 2L, 3L);
-        Assert.AreEqual(value.e00, 1L);
-        Assert.AreEqual(value.e01, 2L);
-        Assert.AreEqual(value.e02, 3L);
+        Assert.Equal(value.e00, 1L);
+        Assert.Equal(value.e01, 2L);
+        Assert.Equal(value.e02, 3L);
 
         GenericsNative.Point3<long> value2;
         GenericsNative.GetPoint3LOut(1L, 2L, 3L, &value2);
-        Assert.AreEqual(value2.e00, 1L);
-        Assert.AreEqual(value2.e01, 2L);
-        Assert.AreEqual(value2.e02, 3L);
+        Assert.Equal(value2.e00, 1L);
+        Assert.Equal(value2.e01, 2L);
+        Assert.Equal(value2.e02, 3L);
 
         GenericsNative.GetPoint3LOut(1L, 2L, 3L, out GenericsNative.Point3<long> value3);
-        Assert.AreEqual(value3.e00, 1L);
-        Assert.AreEqual(value3.e01, 2L);
-        Assert.AreEqual(value3.e02, 3L);
+        Assert.Equal(value3.e00, 1L);
+        Assert.Equal(value3.e01, 2L);
+        Assert.Equal(value3.e02, 3L);
 
         GenericsNative.Point3<long>* value4 = GenericsNative.GetPoint3LPtr(1L, 2L, 3L);
-        Assert.AreEqual(value4->e00, 1L);
-        Assert.AreEqual(value4->e01, 2L);
-        Assert.AreEqual(value4->e02, 3L);
+        Assert.Equal(value4->e00, 1L);
+        Assert.Equal(value4->e01, 2L);
+        Assert.Equal(value4->e02, 3L);
 
         ref readonly GenericsNative.Point3<long> value5 = ref GenericsNative.GetPoint3LRef(1L, 2L, 3L);
-        Assert.AreEqual(value5.e00, 1L);
-        Assert.AreEqual(value5.e01, 2L);
-        Assert.AreEqual(value5.e02, 3L);
+        Assert.Equal(value5.e00, 1L);
+        Assert.Equal(value5.e01, 2L);
+        Assert.Equal(value5.e02, 3L);
 
         GenericsNative.Point3<long> result = GenericsNative.AddPoint3L(value, value);
-        Assert.AreEqual(result.e00, 2L);
-        Assert.AreEqual(result.e01, 4L);
-        Assert.AreEqual(result.e02, 6l);
+        Assert.Equal(result.e00, 2L);
+        Assert.Equal(result.e01, 4L);
+        Assert.Equal(result.e02, 6l);
 
         GenericsNative.Point3<long>[] values = new GenericsNative.Point3<long>[] {
             value,
@@ -81,19 +81,19 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point3<long>* pValues = &values[0])
         {
             GenericsNative.Point3<long> result2 = GenericsNative.AddPoint3Ls(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5l);
-            Assert.AreEqual(result2.e01, 10l);
-            Assert.AreEqual(result2.e02, 15l);
+            Assert.Equal(result2.e00, 5l);
+            Assert.Equal(result2.e01, 10l);
+            Assert.Equal(result2.e02, 15l);
         }
 
         GenericsNative.Point3<long> result3 = GenericsNative.AddPoint3Ls(values, values.Length);
-        Assert.AreEqual(result3.e00, 5l);
-        Assert.AreEqual(result3.e01, 10l);
-        Assert.AreEqual(result3.e02, 15l);
+        Assert.Equal(result3.e00, 5l);
+        Assert.Equal(result3.e01, 10l);
+        Assert.Equal(result3.e02, 15l);
 
         GenericsNative.Point3<long> result4 = GenericsNative.AddPoint3Ls(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5l);
-        Assert.AreEqual(result4.e01, 10l);
-        Assert.AreEqual(result4.e02, 15l);
+        Assert.Equal(result4.e00, 5l);
+        Assert.Equal(result4.e01, 10l);
+        Assert.Equal(result4.e02, 15l);
     }
 }
index a6a8592..f7ec552 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,35 +40,35 @@ unsafe partial class GenericsTest
     private static void TestPoint3U()
     {
         GenericsNative.Point3<uint> value = GenericsNative.GetPoint3U(1u, 2u, 3u);
-        Assert.AreEqual(value.e00, 1u);
-        Assert.AreEqual(value.e01, 2u);
-        Assert.AreEqual(value.e02, 3u);
+        Assert.Equal(value.e00, 1u);
+        Assert.Equal(value.e01, 2u);
+        Assert.Equal(value.e02, 3u);
 
         GenericsNative.Point3<uint> value2;
         GenericsNative.GetPoint3UOut(1u, 2u, 3u, &value2);
-        Assert.AreEqual(value2.e00, 1u);
-        Assert.AreEqual(value2.e01, 2u);
-        Assert.AreEqual(value2.e02, 3u);
+        Assert.Equal(value2.e00, 1u);
+        Assert.Equal(value2.e01, 2u);
+        Assert.Equal(value2.e02, 3u);
 
         GenericsNative.GetPoint3UOut(1u, 2u, 3u, out GenericsNative.Point3<uint> value3);
-        Assert.AreEqual(value3.e00, 1u);
-        Assert.AreEqual(value3.e01, 2u);
-        Assert.AreEqual(value3.e02, 3u);
+        Assert.Equal(value3.e00, 1u);
+        Assert.Equal(value3.e01, 2u);
+        Assert.Equal(value3.e02, 3u);
 
         GenericsNative.Point3<uint>* value4 = GenericsNative.GetPoint3UPtr(1u, 2u, 3u);
-        Assert.AreEqual(value4->e00, 1u);
-        Assert.AreEqual(value4->e01, 2u);
-        Assert.AreEqual(value4->e02, 3u);
+        Assert.Equal(value4->e00, 1u);
+        Assert.Equal(value4->e01, 2u);
+        Assert.Equal(value4->e02, 3u);
 
         ref readonly GenericsNative.Point3<uint> value5 = ref GenericsNative.GetPoint3URef(1u, 2u, 3u);
-        Assert.AreEqual(value5.e00, 1u);
-        Assert.AreEqual(value5.e01, 2u);
-        Assert.AreEqual(value5.e02, 3u);
+        Assert.Equal(value5.e00, 1u);
+        Assert.Equal(value5.e01, 2u);
+        Assert.Equal(value5.e02, 3u);
 
         GenericsNative.Point3<uint> result = GenericsNative.AddPoint3U(value, value);
-        Assert.AreEqual(result.e00, 2u);
-        Assert.AreEqual(result.e01, 4u);
-        Assert.AreEqual(result.e02, 6u);
+        Assert.Equal(result.e00, 2u);
+        Assert.Equal(result.e01, 4u);
+        Assert.Equal(result.e02, 6u);
 
         GenericsNative.Point3<uint>[] values = new GenericsNative.Point3<uint>[] {
             value,
@@ -81,19 +81,19 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point3<uint>* pValues = &values[0])
         {
             GenericsNative.Point3<uint> result2 = GenericsNative.AddPoint3Us(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5u);
-            Assert.AreEqual(result2.e01, 10u);
-            Assert.AreEqual(result2.e02, 15u);
+            Assert.Equal(result2.e00, 5u);
+            Assert.Equal(result2.e01, 10u);
+            Assert.Equal(result2.e02, 15u);
         }
 
         GenericsNative.Point3<uint> result3 = GenericsNative.AddPoint3Us(values, values.Length);
-        Assert.AreEqual(result3.e00, 5u);
-        Assert.AreEqual(result3.e01, 10u);
-        Assert.AreEqual(result3.e02, 15u);
+        Assert.Equal(result3.e00, 5u);
+        Assert.Equal(result3.e01, 10u);
+        Assert.Equal(result3.e02, 15u);
 
         GenericsNative.Point3<uint> result4 = GenericsNative.AddPoint3Us(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5u);
-        Assert.AreEqual(result4.e01, 10u);
-        Assert.AreEqual(result4.e02, 15u);
+        Assert.Equal(result4.e00, 5u);
+        Assert.Equal(result4.e01, 10u);
+        Assert.Equal(result4.e02, 15u);
     }
 }
index edfbd7a..751a02c 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index e40dd64..ec39a71 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 81a47ab..1cee797 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,41 +40,41 @@ unsafe partial class GenericsTest
     private static void TestPoint4D()
     {
         GenericsNative.Point4<double> value = GenericsNative.GetPoint4D(1.0, 2.0, 3.0, 4.0);
-        Assert.AreEqual(value.e00, 1.0);
-        Assert.AreEqual(value.e01, 2.0);
-        Assert.AreEqual(value.e02, 3.0);
-        Assert.AreEqual(value.e03, 4.0);
+        Assert.Equal(value.e00, 1.0);
+        Assert.Equal(value.e01, 2.0);
+        Assert.Equal(value.e02, 3.0);
+        Assert.Equal(value.e03, 4.0);
 
         GenericsNative.Point4<double> value2;
         GenericsNative.GetPoint4DOut(1.0, 2.0, 3.0, 4.0, &value2);
-        Assert.AreEqual(value2.e00, 1.0);
-        Assert.AreEqual(value2.e01, 2.0);
-        Assert.AreEqual(value2.e02, 3.0);
-        Assert.AreEqual(value2.e03, 4.0);
+        Assert.Equal(value2.e00, 1.0);
+        Assert.Equal(value2.e01, 2.0);
+        Assert.Equal(value2.e02, 3.0);
+        Assert.Equal(value2.e03, 4.0);
 
         GenericsNative.GetPoint4DOut(1.0, 2.0, 3.0, 4.0, out GenericsNative.Point4<double> value3);
-        Assert.AreEqual(value3.e00, 1.0);
-        Assert.AreEqual(value3.e01, 2.0);
-        Assert.AreEqual(value3.e02, 3.0);
-        Assert.AreEqual(value3.e03, 4.0);
+        Assert.Equal(value3.e00, 1.0);
+        Assert.Equal(value3.e01, 2.0);
+        Assert.Equal(value3.e02, 3.0);
+        Assert.Equal(value3.e03, 4.0);
 
         GenericsNative.Point4<double>* value4 = GenericsNative.GetPoint4DPtr(1.0, 2.0, 3.0, 4.0);
-        Assert.AreEqual(value4->e00, 1.0);
-        Assert.AreEqual(value4->e01, 2.0);
-        Assert.AreEqual(value4->e02, 3.0);
-        Assert.AreEqual(value4->e03, 4.0);
+        Assert.Equal(value4->e00, 1.0);
+        Assert.Equal(value4->e01, 2.0);
+        Assert.Equal(value4->e02, 3.0);
+        Assert.Equal(value4->e03, 4.0);
 
         ref readonly GenericsNative.Point4<double> value5 = ref GenericsNative.GetPoint4DRef(1.0, 2.0, 3.0, 4.0);
-        Assert.AreEqual(value5.e00, 1.0);
-        Assert.AreEqual(value5.e01, 2.0);
-        Assert.AreEqual(value5.e02, 3.0);
-        Assert.AreEqual(value5.e03, 4.0);
+        Assert.Equal(value5.e00, 1.0);
+        Assert.Equal(value5.e01, 2.0);
+        Assert.Equal(value5.e02, 3.0);
+        Assert.Equal(value5.e03, 4.0);
 
         GenericsNative.Point4<double> result = GenericsNative.AddPoint4D(value, value);
-        Assert.AreEqual(result.e00, 2.0);
-        Assert.AreEqual(result.e01, 4.0);
-        Assert.AreEqual(result.e02, 6.0);
-        Assert.AreEqual(result.e03, 8.0);
+        Assert.Equal(result.e00, 2.0);
+        Assert.Equal(result.e01, 4.0);
+        Assert.Equal(result.e02, 6.0);
+        Assert.Equal(result.e03, 8.0);
 
         GenericsNative.Point4<double>[] values = new GenericsNative.Point4<double>[] {
             value,
@@ -87,22 +87,22 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point4<double>* pValues = &values[0])
         {
             GenericsNative.Point4<double> result2 = GenericsNative.AddPoint4Ds(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5.0);
-            Assert.AreEqual(result2.e01, 10.0);
-            Assert.AreEqual(result2.e02, 15.0);
-            Assert.AreEqual(result2.e03, 20.0);
+            Assert.Equal(result2.e00, 5.0);
+            Assert.Equal(result2.e01, 10.0);
+            Assert.Equal(result2.e02, 15.0);
+            Assert.Equal(result2.e03, 20.0);
         }
 
         GenericsNative.Point4<double> result3 = GenericsNative.AddPoint4Ds(values, values.Length);
-        Assert.AreEqual(result3.e00, 5.0);
-        Assert.AreEqual(result3.e01, 10.0);
-        Assert.AreEqual(result3.e02, 15.0);
-        Assert.AreEqual(result3.e03, 20.0);
+        Assert.Equal(result3.e00, 5.0);
+        Assert.Equal(result3.e01, 10.0);
+        Assert.Equal(result3.e02, 15.0);
+        Assert.Equal(result3.e03, 20.0);
 
         GenericsNative.Point4<double> result4 = GenericsNative.AddPoint4Ds(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5.0);
-        Assert.AreEqual(result4.e01, 10.0);
-        Assert.AreEqual(result4.e02, 15.0);
-        Assert.AreEqual(result4.e03, 20.0);
+        Assert.Equal(result4.e00, 5.0);
+        Assert.Equal(result4.e01, 10.0);
+        Assert.Equal(result4.e02, 15.0);
+        Assert.Equal(result4.e03, 20.0);
     }
 }
index 0786aea..9c12cbf 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,41 +40,41 @@ unsafe partial class GenericsTest
     private static void TestPoint4F()
     {
         GenericsNative.Point4<float> value = GenericsNative.GetPoint4F(1.0f, 2.0f, 3.0f, 4.0f);
-        Assert.AreEqual(value.e00, 1.0f);
-        Assert.AreEqual(value.e01, 2.0f);
-        Assert.AreEqual(value.e02, 3.0f);
-        Assert.AreEqual(value.e03, 4.0f);
+        Assert.Equal(value.e00, 1.0f);
+        Assert.Equal(value.e01, 2.0f);
+        Assert.Equal(value.e02, 3.0f);
+        Assert.Equal(value.e03, 4.0f);
 
         GenericsNative.Point4<float> value2;
         GenericsNative.GetPoint4FOut(1.0f, 2.0f, 3.0f, 4.0f, &value2);
-        Assert.AreEqual(value2.e00, 1.0f);
-        Assert.AreEqual(value2.e01, 2.0f);
-        Assert.AreEqual(value2.e02, 3.0f);
-        Assert.AreEqual(value2.e03, 4.0f);
+        Assert.Equal(value2.e00, 1.0f);
+        Assert.Equal(value2.e01, 2.0f);
+        Assert.Equal(value2.e02, 3.0f);
+        Assert.Equal(value2.e03, 4.0f);
 
         GenericsNative.GetPoint4FOut(1.0f, 2.0f, 3.0f, 4.0f, out GenericsNative.Point4<float> value3);
-        Assert.AreEqual(value3.e00, 1.0f);
-        Assert.AreEqual(value3.e01, 2.0f);
-        Assert.AreEqual(value3.e02, 3.0f);
-        Assert.AreEqual(value3.e03, 4.0f);
+        Assert.Equal(value3.e00, 1.0f);
+        Assert.Equal(value3.e01, 2.0f);
+        Assert.Equal(value3.e02, 3.0f);
+        Assert.Equal(value3.e03, 4.0f);
 
         GenericsNative.Point4<float>* value4 = GenericsNative.GetPoint4FPtr(1.0f, 2.0f, 3.0f, 4.0f);
-        Assert.AreEqual(value4->e00, 1.0f);
-        Assert.AreEqual(value4->e01, 2.0f);
-        Assert.AreEqual(value4->e02, 3.0f);
-        Assert.AreEqual(value4->e03, 4.0f);
+        Assert.Equal(value4->e00, 1.0f);
+        Assert.Equal(value4->e01, 2.0f);
+        Assert.Equal(value4->e02, 3.0f);
+        Assert.Equal(value4->e03, 4.0f);
 
         ref readonly GenericsNative.Point4<float> value5 = ref GenericsNative.GetPoint4FRef(1.0f, 2.0f, 3.0f, 4.0f);
-        Assert.AreEqual(value5.e00, 1.0f);
-        Assert.AreEqual(value5.e01, 2.0f);
-        Assert.AreEqual(value5.e02, 3.0f);
-        Assert.AreEqual(value5.e03, 4.0f);
+        Assert.Equal(value5.e00, 1.0f);
+        Assert.Equal(value5.e01, 2.0f);
+        Assert.Equal(value5.e02, 3.0f);
+        Assert.Equal(value5.e03, 4.0f);
 
         GenericsNative.Point4<float> result = GenericsNative.AddPoint4F(value, value);
-        Assert.AreEqual(result.e00, 2.0f);
-        Assert.AreEqual(result.e01, 4.0f);
-        Assert.AreEqual(result.e02, 6.0f);
-        Assert.AreEqual(result.e03, 8.0f);
+        Assert.Equal(result.e00, 2.0f);
+        Assert.Equal(result.e01, 4.0f);
+        Assert.Equal(result.e02, 6.0f);
+        Assert.Equal(result.e03, 8.0f);
 
         GenericsNative.Point4<float>[] values = new GenericsNative.Point4<float>[] {
             value,
@@ -87,22 +87,22 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point4<float>* pValues = &values[0])
         {
             GenericsNative.Point4<float> result2 = GenericsNative.AddPoint4Fs(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5.0f);
-            Assert.AreEqual(result2.e01, 10.0f);
-            Assert.AreEqual(result2.e02, 15.0f);
-            Assert.AreEqual(result2.e03, 20.0f);
+            Assert.Equal(result2.e00, 5.0f);
+            Assert.Equal(result2.e01, 10.0f);
+            Assert.Equal(result2.e02, 15.0f);
+            Assert.Equal(result2.e03, 20.0f);
         }
 
         GenericsNative.Point4<float> result3 = GenericsNative.AddPoint4Fs(values, values.Length);
-        Assert.AreEqual(result3.e00, 5.0f);
-        Assert.AreEqual(result3.e01, 10.0f);
-        Assert.AreEqual(result3.e02, 15.0f);
-        Assert.AreEqual(result3.e03, 20.0f);
+        Assert.Equal(result3.e00, 5.0f);
+        Assert.Equal(result3.e01, 10.0f);
+        Assert.Equal(result3.e02, 15.0f);
+        Assert.Equal(result3.e03, 20.0f);
 
         GenericsNative.Point4<float> result4 = GenericsNative.AddPoint4Fs(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5.0f);
-        Assert.AreEqual(result4.e01, 10.0f);
-        Assert.AreEqual(result4.e02, 15.0f);
-        Assert.AreEqual(result4.e03, 20.0f);
+        Assert.Equal(result4.e00, 5.0f);
+        Assert.Equal(result4.e01, 10.0f);
+        Assert.Equal(result4.e02, 15.0f);
+        Assert.Equal(result4.e03, 20.0f);
     }
 }
index a650c53..d7c2924 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,41 +40,41 @@ unsafe partial class GenericsTest
     private static void TestPoint4L()
     {
         GenericsNative.Point4<long> value = GenericsNative.GetPoint4L(1L, 2L, 3L, 4L);
-        Assert.AreEqual(value.e00, 1L);
-        Assert.AreEqual(value.e01, 2L);
-        Assert.AreEqual(value.e02, 3L);
-        Assert.AreEqual(value.e03, 4L);
+        Assert.Equal(value.e00, 1L);
+        Assert.Equal(value.e01, 2L);
+        Assert.Equal(value.e02, 3L);
+        Assert.Equal(value.e03, 4L);
 
         GenericsNative.Point4<long> value2;
         GenericsNative.GetPoint4LOut(1L, 2L, 3L, 4L, &value2);
-        Assert.AreEqual(value2.e00, 1L);
-        Assert.AreEqual(value2.e01, 2L);
-        Assert.AreEqual(value2.e02, 3L);
-        Assert.AreEqual(value2.e03, 4L);
+        Assert.Equal(value2.e00, 1L);
+        Assert.Equal(value2.e01, 2L);
+        Assert.Equal(value2.e02, 3L);
+        Assert.Equal(value2.e03, 4L);
 
         GenericsNative.GetPoint4LOut(1L, 2L, 3L, 4L, out GenericsNative.Point4<long> value3);
-        Assert.AreEqual(value3.e00, 1L);
-        Assert.AreEqual(value3.e01, 2L);
-        Assert.AreEqual(value3.e02, 3L);
-        Assert.AreEqual(value3.e03, 4L);
+        Assert.Equal(value3.e00, 1L);
+        Assert.Equal(value3.e01, 2L);
+        Assert.Equal(value3.e02, 3L);
+        Assert.Equal(value3.e03, 4L);
 
         GenericsNative.Point4<long>* value4 = GenericsNative.GetPoint4LPtr(1L, 2L, 3L, 4L);
-        Assert.AreEqual(value4->e00, 1L);
-        Assert.AreEqual(value4->e01, 2L);
-        Assert.AreEqual(value4->e02, 3L);
-        Assert.AreEqual(value4->e03, 4L);
+        Assert.Equal(value4->e00, 1L);
+        Assert.Equal(value4->e01, 2L);
+        Assert.Equal(value4->e02, 3L);
+        Assert.Equal(value4->e03, 4L);
 
         ref readonly GenericsNative.Point4<long> value5 = ref GenericsNative.GetPoint4LRef(1L, 2L, 3L, 4L);
-        Assert.AreEqual(value5.e00, 1L);
-        Assert.AreEqual(value5.e01, 2L);
-        Assert.AreEqual(value5.e02, 3L);
-        Assert.AreEqual(value5.e03, 4L);
+        Assert.Equal(value5.e00, 1L);
+        Assert.Equal(value5.e01, 2L);
+        Assert.Equal(value5.e02, 3L);
+        Assert.Equal(value5.e03, 4L);
 
         GenericsNative.Point4<long> result = GenericsNative.AddPoint4L(value, value);
-        Assert.AreEqual(result.e00, 2L);
-        Assert.AreEqual(result.e01, 4L);
-        Assert.AreEqual(result.e02, 6l);
-        Assert.AreEqual(result.e03, 8l);
+        Assert.Equal(result.e00, 2L);
+        Assert.Equal(result.e01, 4L);
+        Assert.Equal(result.e02, 6l);
+        Assert.Equal(result.e03, 8l);
 
         GenericsNative.Point4<long>[] values = new GenericsNative.Point4<long>[] {
             value,
@@ -87,22 +87,22 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point4<long>* pValues = &values[0])
         {
             GenericsNative.Point4<long> result2 = GenericsNative.AddPoint4Ls(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5l);
-            Assert.AreEqual(result2.e01, 10l);
-            Assert.AreEqual(result2.e02, 15l);
-            Assert.AreEqual(result2.e03, 20l);
+            Assert.Equal(result2.e00, 5l);
+            Assert.Equal(result2.e01, 10l);
+            Assert.Equal(result2.e02, 15l);
+            Assert.Equal(result2.e03, 20l);
         }
 
         GenericsNative.Point4<long> result3 = GenericsNative.AddPoint4Ls(values, values.Length);
-        Assert.AreEqual(result3.e00, 5l);
-        Assert.AreEqual(result3.e01, 10l);
-        Assert.AreEqual(result3.e02, 15l);
-        Assert.AreEqual(result3.e03, 20l);
+        Assert.Equal(result3.e00, 5l);
+        Assert.Equal(result3.e01, 10l);
+        Assert.Equal(result3.e02, 15l);
+        Assert.Equal(result3.e03, 20l);
 
         GenericsNative.Point4<long> result4 = GenericsNative.AddPoint4Ls(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5l);
-        Assert.AreEqual(result4.e01, 10l);
-        Assert.AreEqual(result4.e02, 15l);
-        Assert.AreEqual(result4.e03, 20l);
+        Assert.Equal(result4.e00, 5l);
+        Assert.Equal(result4.e01, 10l);
+        Assert.Equal(result4.e02, 15l);
+        Assert.Equal(result4.e03, 20l);
     }
 }
index 0c92e66..6f2b08e 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -40,41 +40,41 @@ unsafe partial class GenericsTest
     private static void TestPoint4U()
     {
         GenericsNative.Point4<uint> value = GenericsNative.GetPoint4U(1u, 2u, 3u, 4u);
-        Assert.AreEqual(value.e00, 1u);
-        Assert.AreEqual(value.e01, 2u);
-        Assert.AreEqual(value.e02, 3u);
-        Assert.AreEqual(value.e03, 4u);
+        Assert.Equal(value.e00, 1u);
+        Assert.Equal(value.e01, 2u);
+        Assert.Equal(value.e02, 3u);
+        Assert.Equal(value.e03, 4u);
 
         GenericsNative.Point4<uint> value2;
         GenericsNative.GetPoint4UOut(1u, 2u, 3u, 4u, &value2);
-        Assert.AreEqual(value2.e00, 1u);
-        Assert.AreEqual(value2.e01, 2u);
-        Assert.AreEqual(value2.e02, 3u);
-        Assert.AreEqual(value2.e03, 4u);
+        Assert.Equal(value2.e00, 1u);
+        Assert.Equal(value2.e01, 2u);
+        Assert.Equal(value2.e02, 3u);
+        Assert.Equal(value2.e03, 4u);
 
         GenericsNative.GetPoint4UOut(1u, 2u, 3u, 4u, out GenericsNative.Point4<uint> value3);
-        Assert.AreEqual(value3.e00, 1u);
-        Assert.AreEqual(value3.e01, 2u);
-        Assert.AreEqual(value3.e02, 3u);
-        Assert.AreEqual(value3.e03, 4u);
+        Assert.Equal(value3.e00, 1u);
+        Assert.Equal(value3.e01, 2u);
+        Assert.Equal(value3.e02, 3u);
+        Assert.Equal(value3.e03, 4u);
 
         GenericsNative.Point4<uint>* value4 = GenericsNative.GetPoint4UPtr(1u, 2u, 3u, 4u);
-        Assert.AreEqual(value4->e00, 1u);
-        Assert.AreEqual(value4->e01, 2u);
-        Assert.AreEqual(value4->e02, 3u);
-        Assert.AreEqual(value4->e03, 4u);
+        Assert.Equal(value4->e00, 1u);
+        Assert.Equal(value4->e01, 2u);
+        Assert.Equal(value4->e02, 3u);
+        Assert.Equal(value4->e03, 4u);
 
         ref readonly GenericsNative.Point4<uint> value5 = ref GenericsNative.GetPoint4URef(1u, 2u, 3u, 4u);
-        Assert.AreEqual(value5.e00, 1u);
-        Assert.AreEqual(value5.e01, 2u);
-        Assert.AreEqual(value5.e02, 3u);
-        Assert.AreEqual(value5.e03, 4u);
+        Assert.Equal(value5.e00, 1u);
+        Assert.Equal(value5.e01, 2u);
+        Assert.Equal(value5.e02, 3u);
+        Assert.Equal(value5.e03, 4u);
 
         GenericsNative.Point4<uint> result = GenericsNative.AddPoint4U(value, value);
-        Assert.AreEqual(result.e00, 2u);
-        Assert.AreEqual(result.e01, 4u);
-        Assert.AreEqual(result.e02, 6u);
-        Assert.AreEqual(result.e03, 8u);
+        Assert.Equal(result.e00, 2u);
+        Assert.Equal(result.e01, 4u);
+        Assert.Equal(result.e02, 6u);
+        Assert.Equal(result.e03, 8u);
 
         GenericsNative.Point4<uint>[] values = new GenericsNative.Point4<uint>[] {
             value,
@@ -87,22 +87,22 @@ unsafe partial class GenericsTest
         fixed (GenericsNative.Point4<uint>* pValues = &values[0])
         {
             GenericsNative.Point4<uint> result2 = GenericsNative.AddPoint4Us(pValues, values.Length);
-            Assert.AreEqual(result2.e00, 5u);
-            Assert.AreEqual(result2.e01, 10u);
-            Assert.AreEqual(result2.e02, 15u);
-            Assert.AreEqual(result2.e03, 20u);
+            Assert.Equal(result2.e00, 5u);
+            Assert.Equal(result2.e01, 10u);
+            Assert.Equal(result2.e02, 15u);
+            Assert.Equal(result2.e03, 20u);
         }
 
         GenericsNative.Point4<uint> result3 = GenericsNative.AddPoint4Us(values, values.Length);
-        Assert.AreEqual(result3.e00, 5u);
-        Assert.AreEqual(result3.e01, 10u);
-        Assert.AreEqual(result3.e02, 15u);
-        Assert.AreEqual(result3.e03, 20u);
+        Assert.Equal(result3.e00, 5u);
+        Assert.Equal(result3.e01, 10u);
+        Assert.Equal(result3.e02, 15u);
+        Assert.Equal(result3.e03, 20u);
 
         GenericsNative.Point4<uint> result4 = GenericsNative.AddPoint4Us(in values[0], values.Length);
-        Assert.AreEqual(result4.e00, 5u);
-        Assert.AreEqual(result4.e01, 10u);
-        Assert.AreEqual(result4.e02, 15u);
-        Assert.AreEqual(result4.e03, 20u);
+        Assert.Equal(result4.e00, 5u);
+        Assert.Equal(result4.e01, 10u);
+        Assert.Equal(result4.e02, 15u);
+        Assert.Equal(result4.e03, 20u);
     }
 }
index b59a178..884e758 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index e99656e..c7cc920 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 567f249..9998f2c 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index b2018c5..1804dc6 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 191b43b..083ae48 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 4bcb7d3..1fab339 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 2bd9d8b..acd49dd 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 9b22d0d..702f2c2 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index e9df533..3210f14 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 2792326..c89724b 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 32fc00b..5019035 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 3757f7e..cf33f58 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index e36ac3f..8964b3a 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 22a25cf..5b2a42f 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 922f5b0..ab887cb 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index e6c0988..d93cf90 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 71004f9..99e19b6 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 805ed4f..0d7ce78 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
index 93885ae..1542545 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -45,43 +45,43 @@ unsafe partial class GenericsTest
         Vector128<bool> value2;
         GenericsNative.GetVector128BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2);
         Vector128<byte> tValue2 = *(Vector128<byte>*)&value2;
-        Assert.AreEqual(tValue2.GetElement(0), 1);
-        Assert.AreEqual(tValue2.GetElement(1), 0);
-        Assert.AreEqual(tValue2.GetElement(2), 1);
-        Assert.AreEqual(tValue2.GetElement(3), 0);
-        Assert.AreEqual(tValue2.GetElement(4), 1);
-        Assert.AreEqual(tValue2.GetElement(5), 0);
-        Assert.AreEqual(tValue2.GetElement(6), 1);
-        Assert.AreEqual(tValue2.GetElement(7), 0);
-        Assert.AreEqual(tValue2.GetElement(8), 1);
-        Assert.AreEqual(tValue2.GetElement(9), 0);
-        Assert.AreEqual(tValue2.GetElement(10), 1);
-        Assert.AreEqual(tValue2.GetElement(11), 0);
-        Assert.AreEqual(tValue2.GetElement(12), 1);
-        Assert.AreEqual(tValue2.GetElement(13), 0);
-        Assert.AreEqual(tValue2.GetElement(14), 1);
-        Assert.AreEqual(tValue2.GetElement(15), 0);
+        Assert.Equal(tValue2.GetElement(0), 1);
+        Assert.Equal(tValue2.GetElement(1), 0);
+        Assert.Equal(tValue2.GetElement(2), 1);
+        Assert.Equal(tValue2.GetElement(3), 0);
+        Assert.Equal(tValue2.GetElement(4), 1);
+        Assert.Equal(tValue2.GetElement(5), 0);
+        Assert.Equal(tValue2.GetElement(6), 1);
+        Assert.Equal(tValue2.GetElement(7), 0);
+        Assert.Equal(tValue2.GetElement(8), 1);
+        Assert.Equal(tValue2.GetElement(9), 0);
+        Assert.Equal(tValue2.GetElement(10), 1);
+        Assert.Equal(tValue2.GetElement(11), 0);
+        Assert.Equal(tValue2.GetElement(12), 1);
+        Assert.Equal(tValue2.GetElement(13), 0);
+        Assert.Equal(tValue2.GetElement(14), 1);
+        Assert.Equal(tValue2.GetElement(15), 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector128<bool> value3));
 
         Vector128<bool>* value4 = GenericsNative.GetVector128BPtr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false);
         Vector128<byte>* tValue4 = (Vector128<byte>*)value4;
-        Assert.AreEqual(tValue4->GetElement(0), 1);
-        Assert.AreEqual(tValue4->GetElement(1), 0);
-        Assert.AreEqual(tValue4->GetElement(2), 1);
-        Assert.AreEqual(tValue4->GetElement(3), 0);
-        Assert.AreEqual(tValue4->GetElement(4), 1);
-        Assert.AreEqual(tValue4->GetElement(5), 0);
-        Assert.AreEqual(tValue4->GetElement(6), 1);
-        Assert.AreEqual(tValue4->GetElement(7), 0);
-        Assert.AreEqual(tValue4->GetElement(8), 1);
-        Assert.AreEqual(tValue4->GetElement(9), 0);
-        Assert.AreEqual(tValue4->GetElement(10), 1);
-        Assert.AreEqual(tValue4->GetElement(11), 0);
-        Assert.AreEqual(tValue4->GetElement(12), 1);
-        Assert.AreEqual(tValue4->GetElement(13), 0);
-        Assert.AreEqual(tValue4->GetElement(14), 1);
-        Assert.AreEqual(tValue4->GetElement(15), 0);
+        Assert.Equal(tValue4->GetElement(0), 1);
+        Assert.Equal(tValue4->GetElement(1), 0);
+        Assert.Equal(tValue4->GetElement(2), 1);
+        Assert.Equal(tValue4->GetElement(3), 0);
+        Assert.Equal(tValue4->GetElement(4), 1);
+        Assert.Equal(tValue4->GetElement(5), 0);
+        Assert.Equal(tValue4->GetElement(6), 1);
+        Assert.Equal(tValue4->GetElement(7), 0);
+        Assert.Equal(tValue4->GetElement(8), 1);
+        Assert.Equal(tValue4->GetElement(9), 0);
+        Assert.Equal(tValue4->GetElement(10), 1);
+        Assert.Equal(tValue4->GetElement(11), 0);
+        Assert.Equal(tValue4->GetElement(12), 1);
+        Assert.Equal(tValue4->GetElement(13), 0);
+        Assert.Equal(tValue4->GetElement(14), 1);
+        Assert.Equal(tValue4->GetElement(15), 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128BRef(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false));
 
index a03f1e0..eab8feb 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -45,27 +45,27 @@ unsafe partial class GenericsTest
         Vector128<char> value2;
         GenericsNative.GetVector128COut('0', '1', '2', '3', '4', '5', '6', '7', &value2);
         Vector128<short> tValue2 = *(Vector128<short>*)&value2;
-        Assert.AreEqual(tValue2.GetElement(0), (short)'0');
-        Assert.AreEqual(tValue2.GetElement(1), (short)'1');
-        Assert.AreEqual(tValue2.GetElement(2), (short)'2');
-        Assert.AreEqual(tValue2.GetElement(3), (short)'3');
-        Assert.AreEqual(tValue2.GetElement(4), (short)'4');
-        Assert.AreEqual(tValue2.GetElement(5), (short)'5');
-        Assert.AreEqual(tValue2.GetElement(6), (short)'6');
-        Assert.AreEqual(tValue2.GetElement(7), (short)'7');
+        Assert.Equal(tValue2.GetElement(0), (short)'0');
+        Assert.Equal(tValue2.GetElement(1), (short)'1');
+        Assert.Equal(tValue2.GetElement(2), (short)'2');
+        Assert.Equal(tValue2.GetElement(3), (short)'3');
+        Assert.Equal(tValue2.GetElement(4), (short)'4');
+        Assert.Equal(tValue2.GetElement(5), (short)'5');
+        Assert.Equal(tValue2.GetElement(6), (short)'6');
+        Assert.Equal(tValue2.GetElement(7), (short)'7');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128COut('0', '1', '2', '3', '4', '5', '6', '7', out Vector128<char> value3));
 
         Vector128<char>* value4 = GenericsNative.GetVector128CPtr('0', '1', '2', '3', '4', '5', '6', '7');
         Vector128<short>* tValue4 = (Vector128<short>*)value4;
-        Assert.AreEqual(tValue4->GetElement(0), (short)'0');
-        Assert.AreEqual(tValue4->GetElement(1), (short)'1');
-        Assert.AreEqual(tValue4->GetElement(2), (short)'2');
-        Assert.AreEqual(tValue4->GetElement(3), (short)'3');
-        Assert.AreEqual(tValue4->GetElement(4), (short)'4');
-        Assert.AreEqual(tValue4->GetElement(5), (short)'5');
-        Assert.AreEqual(tValue4->GetElement(6), (short)'6');
-        Assert.AreEqual(tValue4->GetElement(7), (short)'7');
+        Assert.Equal(tValue4->GetElement(0), (short)'0');
+        Assert.Equal(tValue4->GetElement(1), (short)'1');
+        Assert.Equal(tValue4->GetElement(2), (short)'2');
+        Assert.Equal(tValue4->GetElement(3), (short)'3');
+        Assert.Equal(tValue4->GetElement(4), (short)'4');
+        Assert.Equal(tValue4->GetElement(5), (short)'5');
+        Assert.Equal(tValue4->GetElement(6), (short)'6');
+        Assert.Equal(tValue4->GetElement(7), (short)'7');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128CRef('0', '1', '2', '3', '4', '5', '6', '7'));
 
index c117145..553f6ec 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,14 +44,14 @@ unsafe partial class GenericsTest
 
         Vector128<double> value2;
         GenericsNative.GetVector128DOut(1.0, 2.0, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1.0);
-        Assert.AreEqual(value2.GetElement(1), 2.0);
+        Assert.Equal(value2.GetElement(0), 1.0);
+        Assert.Equal(value2.GetElement(1), 2.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128DOut(1.0, 2.0, out Vector128<double> value3));
 
         Vector128<double>* value4 = GenericsNative.GetVector128DPtr(1.0, 2.0);
-        Assert.AreEqual(value4->GetElement(0), 1.0);
-        Assert.AreEqual(value4->GetElement(1), 2.0);
+        Assert.Equal(value4->GetElement(0), 1.0);
+        Assert.Equal(value4->GetElement(1), 2.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128DRef(1.0, 2.0));
 
index 5bcf9de..52585f3 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,18 +44,18 @@ unsafe partial class GenericsTest
 
         Vector128<float> value2;
         GenericsNative.GetVector128FOut(1.0f, 2.0f, 3.0f, 4.0f, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1.0f);
-        Assert.AreEqual(value2.GetElement(1), 2.0f);
-        Assert.AreEqual(value2.GetElement(2), 3.0f);
-        Assert.AreEqual(value2.GetElement(3), 4.0f);
+        Assert.Equal(value2.GetElement(0), 1.0f);
+        Assert.Equal(value2.GetElement(1), 2.0f);
+        Assert.Equal(value2.GetElement(2), 3.0f);
+        Assert.Equal(value2.GetElement(3), 4.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128FOut(1.0f, 2.0f, 3.0f, 4.0f, out Vector128<float> value3));
 
         Vector128<float>* value4 = GenericsNative.GetVector128FPtr(1.0f, 2.0f, 3.0f, 4.0f);
-        Assert.AreEqual(value4->GetElement(0), 1.0f);
-        Assert.AreEqual(value4->GetElement(1), 2.0f);
-        Assert.AreEqual(value4->GetElement(2), 3.0f);
-        Assert.AreEqual(value4->GetElement(3), 4.0f);
+        Assert.Equal(value4->GetElement(0), 1.0f);
+        Assert.Equal(value4->GetElement(1), 2.0f);
+        Assert.Equal(value4->GetElement(2), 3.0f);
+        Assert.Equal(value4->GetElement(3), 4.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128FRef(1.0f, 2.0f, 3.0f, 4.0f));
 
index 12ce1d2..4cda095 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,14 +44,14 @@ unsafe partial class GenericsTest
 
         Vector128<long> value2;
         GenericsNative.GetVector128LOut(1L, 2L, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1L);
-        Assert.AreEqual(value2.GetElement(1), 2L);
+        Assert.Equal(value2.GetElement(0), 1L);
+        Assert.Equal(value2.GetElement(1), 2L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128LOut(1L, 2L, out Vector128<long> value3));
 
         Vector128<long>* value4 = GenericsNative.GetVector128LPtr(1L, 2L);
-        Assert.AreEqual(value4->GetElement(0), 1L);
-        Assert.AreEqual(value4->GetElement(1), 2L);
+        Assert.Equal(value4->GetElement(0), 1L);
+        Assert.Equal(value4->GetElement(1), 2L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128LRef(1L, 2L));
 
index b30e3ff..f0b8893 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,18 +44,18 @@ unsafe partial class GenericsTest
 
         Vector128<uint> value2;
         GenericsNative.GetVector128UOut(1u, 2u, 3u, 4u, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1u);
-        Assert.AreEqual(value2.GetElement(1), 2u);
-        Assert.AreEqual(value2.GetElement(2), 3u);
-        Assert.AreEqual(value2.GetElement(3), 4u);
+        Assert.Equal(value2.GetElement(0), 1u);
+        Assert.Equal(value2.GetElement(1), 2u);
+        Assert.Equal(value2.GetElement(2), 3u);
+        Assert.Equal(value2.GetElement(3), 4u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128UOut(1u, 2u, 3u, 4u, out Vector128<uint> value3));
 
         Vector128<uint>* value4 = GenericsNative.GetVector128UPtr(1u, 2u, 3u, 4u);
-        Assert.AreEqual(value4->GetElement(0), 1u);
-        Assert.AreEqual(value4->GetElement(1), 2u);
-        Assert.AreEqual(value4->GetElement(2), 3u);
-        Assert.AreEqual(value4->GetElement(3), 4u);
+        Assert.Equal(value4->GetElement(0), 1u);
+        Assert.Equal(value4->GetElement(1), 2u);
+        Assert.Equal(value4->GetElement(2), 3u);
+        Assert.Equal(value4->GetElement(3), 4u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector128URef(1u, 2u, 3u, 4u));
 
index 9916b13..a4bfd58 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -45,75 +45,75 @@ unsafe partial class GenericsTest
         Vector256<bool> value2;
         GenericsNative.GetVector256BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2);
         Vector256<byte> tValue2 = *(Vector256<byte>*)&value2;
-        Assert.AreEqual(tValue2.GetElement(0), 1);
-        Assert.AreEqual(tValue2.GetElement(1), 0);
-        Assert.AreEqual(tValue2.GetElement(2), 1);
-        Assert.AreEqual(tValue2.GetElement(3), 0);
-        Assert.AreEqual(tValue2.GetElement(4), 1);
-        Assert.AreEqual(tValue2.GetElement(5), 0);
-        Assert.AreEqual(tValue2.GetElement(6), 1);
-        Assert.AreEqual(tValue2.GetElement(7), 0);
-        Assert.AreEqual(tValue2.GetElement(8), 1);
-        Assert.AreEqual(tValue2.GetElement(9), 0);
-        Assert.AreEqual(tValue2.GetElement(10), 1);
-        Assert.AreEqual(tValue2.GetElement(11), 0);
-        Assert.AreEqual(tValue2.GetElement(12), 1);
-        Assert.AreEqual(tValue2.GetElement(13), 0);
-        Assert.AreEqual(tValue2.GetElement(14), 1);
-        Assert.AreEqual(tValue2.GetElement(15), 0);
-        Assert.AreEqual(tValue2.GetElement(16), 1);
-        Assert.AreEqual(tValue2.GetElement(17), 0);
-        Assert.AreEqual(tValue2.GetElement(18), 1);
-        Assert.AreEqual(tValue2.GetElement(19), 0);
-        Assert.AreEqual(tValue2.GetElement(20), 1);
-        Assert.AreEqual(tValue2.GetElement(21), 0);
-        Assert.AreEqual(tValue2.GetElement(22), 1);
-        Assert.AreEqual(tValue2.GetElement(23), 0);
-        Assert.AreEqual(tValue2.GetElement(24), 1);
-        Assert.AreEqual(tValue2.GetElement(25), 0);
-        Assert.AreEqual(tValue2.GetElement(26), 1);
-        Assert.AreEqual(tValue2.GetElement(27), 0);
-        Assert.AreEqual(tValue2.GetElement(28), 1);
-        Assert.AreEqual(tValue2.GetElement(29), 0);
-        Assert.AreEqual(tValue2.GetElement(30), 1);
-        Assert.AreEqual(tValue2.GetElement(31), 0);
+        Assert.Equal(tValue2.GetElement(0), 1);
+        Assert.Equal(tValue2.GetElement(1), 0);
+        Assert.Equal(tValue2.GetElement(2), 1);
+        Assert.Equal(tValue2.GetElement(3), 0);
+        Assert.Equal(tValue2.GetElement(4), 1);
+        Assert.Equal(tValue2.GetElement(5), 0);
+        Assert.Equal(tValue2.GetElement(6), 1);
+        Assert.Equal(tValue2.GetElement(7), 0);
+        Assert.Equal(tValue2.GetElement(8), 1);
+        Assert.Equal(tValue2.GetElement(9), 0);
+        Assert.Equal(tValue2.GetElement(10), 1);
+        Assert.Equal(tValue2.GetElement(11), 0);
+        Assert.Equal(tValue2.GetElement(12), 1);
+        Assert.Equal(tValue2.GetElement(13), 0);
+        Assert.Equal(tValue2.GetElement(14), 1);
+        Assert.Equal(tValue2.GetElement(15), 0);
+        Assert.Equal(tValue2.GetElement(16), 1);
+        Assert.Equal(tValue2.GetElement(17), 0);
+        Assert.Equal(tValue2.GetElement(18), 1);
+        Assert.Equal(tValue2.GetElement(19), 0);
+        Assert.Equal(tValue2.GetElement(20), 1);
+        Assert.Equal(tValue2.GetElement(21), 0);
+        Assert.Equal(tValue2.GetElement(22), 1);
+        Assert.Equal(tValue2.GetElement(23), 0);
+        Assert.Equal(tValue2.GetElement(24), 1);
+        Assert.Equal(tValue2.GetElement(25), 0);
+        Assert.Equal(tValue2.GetElement(26), 1);
+        Assert.Equal(tValue2.GetElement(27), 0);
+        Assert.Equal(tValue2.GetElement(28), 1);
+        Assert.Equal(tValue2.GetElement(29), 0);
+        Assert.Equal(tValue2.GetElement(30), 1);
+        Assert.Equal(tValue2.GetElement(31), 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector256<bool> value3));
 
         Vector256<bool>* value4 = GenericsNative.GetVector256BPtr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false);
         Vector256<byte>* tValue4 = (Vector256<byte>*)value4;
-        Assert.AreEqual(tValue4->GetElement(0), 1);
-        Assert.AreEqual(tValue4->GetElement(1), 0);
-        Assert.AreEqual(tValue4->GetElement(2), 1);
-        Assert.AreEqual(tValue4->GetElement(3), 0);
-        Assert.AreEqual(tValue4->GetElement(4), 1);
-        Assert.AreEqual(tValue4->GetElement(5), 0);
-        Assert.AreEqual(tValue4->GetElement(6), 1);
-        Assert.AreEqual(tValue4->GetElement(7), 0);
-        Assert.AreEqual(tValue4->GetElement(8), 1);
-        Assert.AreEqual(tValue4->GetElement(9), 0);
-        Assert.AreEqual(tValue4->GetElement(10), 1);
-        Assert.AreEqual(tValue4->GetElement(11), 0);
-        Assert.AreEqual(tValue4->GetElement(12), 1);
-        Assert.AreEqual(tValue4->GetElement(13), 0);
-        Assert.AreEqual(tValue4->GetElement(14), 1);
-        Assert.AreEqual(tValue4->GetElement(15), 0);
-        Assert.AreEqual(tValue4->GetElement(16), 1);
-        Assert.AreEqual(tValue4->GetElement(17), 0);
-        Assert.AreEqual(tValue4->GetElement(18), 1);
-        Assert.AreEqual(tValue4->GetElement(19), 0);
-        Assert.AreEqual(tValue4->GetElement(20), 1);
-        Assert.AreEqual(tValue4->GetElement(21), 0);
-        Assert.AreEqual(tValue4->GetElement(22), 1);
-        Assert.AreEqual(tValue4->GetElement(23), 0);
-        Assert.AreEqual(tValue4->GetElement(24), 1);
-        Assert.AreEqual(tValue4->GetElement(25), 0);
-        Assert.AreEqual(tValue4->GetElement(26), 1);
-        Assert.AreEqual(tValue4->GetElement(27), 0);
-        Assert.AreEqual(tValue4->GetElement(28), 1);
-        Assert.AreEqual(tValue4->GetElement(29), 0);
-        Assert.AreEqual(tValue4->GetElement(30), 1);
-        Assert.AreEqual(tValue4->GetElement(31), 0);
+        Assert.Equal(tValue4->GetElement(0), 1);
+        Assert.Equal(tValue4->GetElement(1), 0);
+        Assert.Equal(tValue4->GetElement(2), 1);
+        Assert.Equal(tValue4->GetElement(3), 0);
+        Assert.Equal(tValue4->GetElement(4), 1);
+        Assert.Equal(tValue4->GetElement(5), 0);
+        Assert.Equal(tValue4->GetElement(6), 1);
+        Assert.Equal(tValue4->GetElement(7), 0);
+        Assert.Equal(tValue4->GetElement(8), 1);
+        Assert.Equal(tValue4->GetElement(9), 0);
+        Assert.Equal(tValue4->GetElement(10), 1);
+        Assert.Equal(tValue4->GetElement(11), 0);
+        Assert.Equal(tValue4->GetElement(12), 1);
+        Assert.Equal(tValue4->GetElement(13), 0);
+        Assert.Equal(tValue4->GetElement(14), 1);
+        Assert.Equal(tValue4->GetElement(15), 0);
+        Assert.Equal(tValue4->GetElement(16), 1);
+        Assert.Equal(tValue4->GetElement(17), 0);
+        Assert.Equal(tValue4->GetElement(18), 1);
+        Assert.Equal(tValue4->GetElement(19), 0);
+        Assert.Equal(tValue4->GetElement(20), 1);
+        Assert.Equal(tValue4->GetElement(21), 0);
+        Assert.Equal(tValue4->GetElement(22), 1);
+        Assert.Equal(tValue4->GetElement(23), 0);
+        Assert.Equal(tValue4->GetElement(24), 1);
+        Assert.Equal(tValue4->GetElement(25), 0);
+        Assert.Equal(tValue4->GetElement(26), 1);
+        Assert.Equal(tValue4->GetElement(27), 0);
+        Assert.Equal(tValue4->GetElement(28), 1);
+        Assert.Equal(tValue4->GetElement(29), 0);
+        Assert.Equal(tValue4->GetElement(30), 1);
+        Assert.Equal(tValue4->GetElement(31), 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256BRef(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false));
 
index 8478068..37a6119 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -45,43 +45,43 @@ unsafe partial class GenericsTest
         Vector256<char> value2;
         GenericsNative.GetVector256COut('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', &value2);
         Vector256<short> tValue2 = *(Vector256<short>*)&value2;
-        Assert.AreEqual(tValue2.GetElement(0), (short)'0');
-        Assert.AreEqual(tValue2.GetElement(1), (short)'1');
-        Assert.AreEqual(tValue2.GetElement(2), (short)'2');
-        Assert.AreEqual(tValue2.GetElement(3), (short)'3');
-        Assert.AreEqual(tValue2.GetElement(4), (short)'4');
-        Assert.AreEqual(tValue2.GetElement(5), (short)'5');
-        Assert.AreEqual(tValue2.GetElement(6), (short)'6');
-        Assert.AreEqual(tValue2.GetElement(7), (short)'7');
-        Assert.AreEqual(tValue2.GetElement(8), (short)'8');
-        Assert.AreEqual(tValue2.GetElement(9), (short)'9');
-        Assert.AreEqual(tValue2.GetElement(10), (short)'A');
-        Assert.AreEqual(tValue2.GetElement(11), (short)'B');
-        Assert.AreEqual(tValue2.GetElement(12), (short)'C');
-        Assert.AreEqual(tValue2.GetElement(13), (short)'D');
-        Assert.AreEqual(tValue2.GetElement(14), (short)'E');
-        Assert.AreEqual(tValue2.GetElement(15), (short)'F');
+        Assert.Equal(tValue2.GetElement(0), (short)'0');
+        Assert.Equal(tValue2.GetElement(1), (short)'1');
+        Assert.Equal(tValue2.GetElement(2), (short)'2');
+        Assert.Equal(tValue2.GetElement(3), (short)'3');
+        Assert.Equal(tValue2.GetElement(4), (short)'4');
+        Assert.Equal(tValue2.GetElement(5), (short)'5');
+        Assert.Equal(tValue2.GetElement(6), (short)'6');
+        Assert.Equal(tValue2.GetElement(7), (short)'7');
+        Assert.Equal(tValue2.GetElement(8), (short)'8');
+        Assert.Equal(tValue2.GetElement(9), (short)'9');
+        Assert.Equal(tValue2.GetElement(10), (short)'A');
+        Assert.Equal(tValue2.GetElement(11), (short)'B');
+        Assert.Equal(tValue2.GetElement(12), (short)'C');
+        Assert.Equal(tValue2.GetElement(13), (short)'D');
+        Assert.Equal(tValue2.GetElement(14), (short)'E');
+        Assert.Equal(tValue2.GetElement(15), (short)'F');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256COut('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', out Vector256<char> value3));
 
         Vector256<char>* value4 = GenericsNative.GetVector256CPtr('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
         Vector256<short>* tValue4 = (Vector256<short>*)value4;
-        Assert.AreEqual(tValue4->GetElement(0), (short)'0');
-        Assert.AreEqual(tValue4->GetElement(1), (short)'1');
-        Assert.AreEqual(tValue4->GetElement(2), (short)'2');
-        Assert.AreEqual(tValue4->GetElement(3), (short)'3');
-        Assert.AreEqual(tValue4->GetElement(4), (short)'4');
-        Assert.AreEqual(tValue4->GetElement(5), (short)'5');
-        Assert.AreEqual(tValue4->GetElement(6), (short)'6');
-        Assert.AreEqual(tValue4->GetElement(7), (short)'7');
-        Assert.AreEqual(tValue4->GetElement(8), (short)'8');
-        Assert.AreEqual(tValue4->GetElement(9), (short)'9');
-        Assert.AreEqual(tValue4->GetElement(10), (short)'A');
-        Assert.AreEqual(tValue4->GetElement(11), (short)'B');
-        Assert.AreEqual(tValue4->GetElement(12), (short)'C');
-        Assert.AreEqual(tValue4->GetElement(13), (short)'D');
-        Assert.AreEqual(tValue4->GetElement(14), (short)'E');
-        Assert.AreEqual(tValue4->GetElement(15), (short)'F');
+        Assert.Equal(tValue4->GetElement(0), (short)'0');
+        Assert.Equal(tValue4->GetElement(1), (short)'1');
+        Assert.Equal(tValue4->GetElement(2), (short)'2');
+        Assert.Equal(tValue4->GetElement(3), (short)'3');
+        Assert.Equal(tValue4->GetElement(4), (short)'4');
+        Assert.Equal(tValue4->GetElement(5), (short)'5');
+        Assert.Equal(tValue4->GetElement(6), (short)'6');
+        Assert.Equal(tValue4->GetElement(7), (short)'7');
+        Assert.Equal(tValue4->GetElement(8), (short)'8');
+        Assert.Equal(tValue4->GetElement(9), (short)'9');
+        Assert.Equal(tValue4->GetElement(10), (short)'A');
+        Assert.Equal(tValue4->GetElement(11), (short)'B');
+        Assert.Equal(tValue4->GetElement(12), (short)'C');
+        Assert.Equal(tValue4->GetElement(13), (short)'D');
+        Assert.Equal(tValue4->GetElement(14), (short)'E');
+        Assert.Equal(tValue4->GetElement(15), (short)'F');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256CRef('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'));
 
index 3a7bc81..527ce23 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,18 +44,18 @@ unsafe partial class GenericsTest
 
         Vector256<double> value2;
         GenericsNative.GetVector256DOut(1.0, 2.0, 3.0, 4.0, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1.0);
-        Assert.AreEqual(value2.GetElement(1), 2.0);
-        Assert.AreEqual(value2.GetElement(2), 3.0);
-        Assert.AreEqual(value2.GetElement(3), 4.0);
+        Assert.Equal(value2.GetElement(0), 1.0);
+        Assert.Equal(value2.GetElement(1), 2.0);
+        Assert.Equal(value2.GetElement(2), 3.0);
+        Assert.Equal(value2.GetElement(3), 4.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256DOut(1.0, 2.0, 3.0, 4.0, out Vector256<double> value3));
 
         Vector256<double>* value4 = GenericsNative.GetVector256DPtr(1.0, 2.0, 3.0, 4.0);
-        Assert.AreEqual(value4->GetElement(0), 1.0);
-        Assert.AreEqual(value4->GetElement(1), 2.0);
-        Assert.AreEqual(value4->GetElement(2), 3.0);
-        Assert.AreEqual(value4->GetElement(3), 4.0);
+        Assert.Equal(value4->GetElement(0), 1.0);
+        Assert.Equal(value4->GetElement(1), 2.0);
+        Assert.Equal(value4->GetElement(2), 3.0);
+        Assert.Equal(value4->GetElement(3), 4.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256DRef(1.0, 2.0, 3.0, 4.0));
 
index 9d7c439..601f400 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,26 +44,26 @@ unsafe partial class GenericsTest
 
         Vector256<float> value2;
         GenericsNative.GetVector256FOut(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1.0f);
-        Assert.AreEqual(value2.GetElement(1), 2.0f);
-        Assert.AreEqual(value2.GetElement(2), 3.0f);
-        Assert.AreEqual(value2.GetElement(3), 4.0f);
-        Assert.AreEqual(value2.GetElement(4), 5.0f);
-        Assert.AreEqual(value2.GetElement(5), 6.0f);
-        Assert.AreEqual(value2.GetElement(6), 7.0f);
-        Assert.AreEqual(value2.GetElement(7), 8.0f);
+        Assert.Equal(value2.GetElement(0), 1.0f);
+        Assert.Equal(value2.GetElement(1), 2.0f);
+        Assert.Equal(value2.GetElement(2), 3.0f);
+        Assert.Equal(value2.GetElement(3), 4.0f);
+        Assert.Equal(value2.GetElement(4), 5.0f);
+        Assert.Equal(value2.GetElement(5), 6.0f);
+        Assert.Equal(value2.GetElement(6), 7.0f);
+        Assert.Equal(value2.GetElement(7), 8.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256FOut(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, out Vector256<float> value3));
 
         Vector256<float>* value4 = GenericsNative.GetVector256FPtr(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f);
-        Assert.AreEqual(value4->GetElement(0), 1.0f);
-        Assert.AreEqual(value4->GetElement(1), 2.0f);
-        Assert.AreEqual(value4->GetElement(2), 3.0f);
-        Assert.AreEqual(value4->GetElement(3), 4.0f);
-        Assert.AreEqual(value4->GetElement(4), 5.0f);
-        Assert.AreEqual(value4->GetElement(5), 6.0f);
-        Assert.AreEqual(value4->GetElement(6), 7.0f);
-        Assert.AreEqual(value4->GetElement(7), 8.0f);
+        Assert.Equal(value4->GetElement(0), 1.0f);
+        Assert.Equal(value4->GetElement(1), 2.0f);
+        Assert.Equal(value4->GetElement(2), 3.0f);
+        Assert.Equal(value4->GetElement(3), 4.0f);
+        Assert.Equal(value4->GetElement(4), 5.0f);
+        Assert.Equal(value4->GetElement(5), 6.0f);
+        Assert.Equal(value4->GetElement(6), 7.0f);
+        Assert.Equal(value4->GetElement(7), 8.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256FRef(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f));
 
index 167e91f..a1ff322 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,18 +44,18 @@ unsafe partial class GenericsTest
 
         Vector256<long> value2;
         GenericsNative.GetVector256LOut(1L, 2L, 3L, 4L, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1L);
-        Assert.AreEqual(value2.GetElement(1), 2L);
-        Assert.AreEqual(value2.GetElement(2), 3L);
-        Assert.AreEqual(value2.GetElement(3), 4L);
+        Assert.Equal(value2.GetElement(0), 1L);
+        Assert.Equal(value2.GetElement(1), 2L);
+        Assert.Equal(value2.GetElement(2), 3L);
+        Assert.Equal(value2.GetElement(3), 4L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256LOut(1L, 2L, 3L, 4L, out Vector256<long> value3));
 
         Vector256<long>* value4 = GenericsNative.GetVector256LPtr(1L, 2L, 3L, 4L);
-        Assert.AreEqual(value4->GetElement(0), 1L);
-        Assert.AreEqual(value4->GetElement(1), 2L);
-        Assert.AreEqual(value4->GetElement(2), 3L);
-        Assert.AreEqual(value4->GetElement(3), 4L);
+        Assert.Equal(value4->GetElement(0), 1L);
+        Assert.Equal(value4->GetElement(1), 2L);
+        Assert.Equal(value4->GetElement(2), 3L);
+        Assert.Equal(value4->GetElement(3), 4L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256LRef(1L, 2L, 3L, 4L));
 
index 138c020..c4b468a 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,26 +44,26 @@ unsafe partial class GenericsTest
 
         Vector256<uint> value2;
         GenericsNative.GetVector256UOut(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1u);
-        Assert.AreEqual(value2.GetElement(1), 2u);
-        Assert.AreEqual(value2.GetElement(2), 3u);
-        Assert.AreEqual(value2.GetElement(3), 4u);
-        Assert.AreEqual(value2.GetElement(4), 5u);
-        Assert.AreEqual(value2.GetElement(5), 6u);
-        Assert.AreEqual(value2.GetElement(6), 7u);
-        Assert.AreEqual(value2.GetElement(7), 8u);
+        Assert.Equal(value2.GetElement(0), 1u);
+        Assert.Equal(value2.GetElement(1), 2u);
+        Assert.Equal(value2.GetElement(2), 3u);
+        Assert.Equal(value2.GetElement(3), 4u);
+        Assert.Equal(value2.GetElement(4), 5u);
+        Assert.Equal(value2.GetElement(5), 6u);
+        Assert.Equal(value2.GetElement(6), 7u);
+        Assert.Equal(value2.GetElement(7), 8u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256UOut(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, out Vector256<uint> value3));
 
         Vector256<uint>* value4 = GenericsNative.GetVector256UPtr(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u);
-        Assert.AreEqual(value4->GetElement(0), 1u);
-        Assert.AreEqual(value4->GetElement(1), 2u);
-        Assert.AreEqual(value4->GetElement(2), 3u);
-        Assert.AreEqual(value4->GetElement(3), 4u);
-        Assert.AreEqual(value4->GetElement(4), 5u);
-        Assert.AreEqual(value4->GetElement(5), 6u);
-        Assert.AreEqual(value4->GetElement(6), 7u);
-        Assert.AreEqual(value4->GetElement(7), 8u);
+        Assert.Equal(value4->GetElement(0), 1u);
+        Assert.Equal(value4->GetElement(1), 2u);
+        Assert.Equal(value4->GetElement(2), 3u);
+        Assert.Equal(value4->GetElement(3), 4u);
+        Assert.Equal(value4->GetElement(4), 5u);
+        Assert.Equal(value4->GetElement(5), 6u);
+        Assert.Equal(value4->GetElement(6), 7u);
+        Assert.Equal(value4->GetElement(7), 8u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector256URef(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u));
 
index 78befd9..d0961cb 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -45,27 +45,27 @@ unsafe partial class GenericsTest
         Vector64<bool> value2;
         GenericsNative.GetVector64BOut(true, false, true, false, true, false, true, false, &value2);
         Vector64<byte> tValue2 = *(Vector64<byte>*)&value2;
-        Assert.AreEqual(tValue2.GetElement(0), 1);
-        Assert.AreEqual(tValue2.GetElement(1), 0);
-        Assert.AreEqual(tValue2.GetElement(2), 1);
-        Assert.AreEqual(tValue2.GetElement(3), 0);
-        Assert.AreEqual(tValue2.GetElement(4), 1);
-        Assert.AreEqual(tValue2.GetElement(5), 0);
-        Assert.AreEqual(tValue2.GetElement(6), 1);
-        Assert.AreEqual(tValue2.GetElement(7), 0);
+        Assert.Equal(tValue2.GetElement(0), 1);
+        Assert.Equal(tValue2.GetElement(1), 0);
+        Assert.Equal(tValue2.GetElement(2), 1);
+        Assert.Equal(tValue2.GetElement(3), 0);
+        Assert.Equal(tValue2.GetElement(4), 1);
+        Assert.Equal(tValue2.GetElement(5), 0);
+        Assert.Equal(tValue2.GetElement(6), 1);
+        Assert.Equal(tValue2.GetElement(7), 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64BOut(true, false, true, false, true, false, true, false, out Vector64<bool> value3));
 
         Vector64<bool>* value4 = GenericsNative.GetVector64BPtr(true, false, true, false, true, false, true, false);
         Vector64<byte>* tValue4 = (Vector64<byte>*)value4;
-        Assert.AreEqual(tValue4->GetElement(0), 1);
-        Assert.AreEqual(tValue4->GetElement(1), 0);
-        Assert.AreEqual(tValue4->GetElement(2), 1);
-        Assert.AreEqual(tValue4->GetElement(3), 0);
-        Assert.AreEqual(tValue4->GetElement(4), 1);
-        Assert.AreEqual(tValue4->GetElement(5), 0);
-        Assert.AreEqual(tValue4->GetElement(6), 1);
-        Assert.AreEqual(tValue4->GetElement(7), 0);
+        Assert.Equal(tValue4->GetElement(0), 1);
+        Assert.Equal(tValue4->GetElement(1), 0);
+        Assert.Equal(tValue4->GetElement(2), 1);
+        Assert.Equal(tValue4->GetElement(3), 0);
+        Assert.Equal(tValue4->GetElement(4), 1);
+        Assert.Equal(tValue4->GetElement(5), 0);
+        Assert.Equal(tValue4->GetElement(6), 1);
+        Assert.Equal(tValue4->GetElement(7), 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64BRef(true, false, true, false, true, false, true, false));
 
index f0214f7..265e5a9 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -45,19 +45,19 @@ unsafe partial class GenericsTest
         Vector64<char> value2;
         GenericsNative.GetVector64COut('0', '1', '2', '3', &value2);
         Vector64<short> tValue2 = *(Vector64<short>*)&value2;
-        Assert.AreEqual(tValue2.GetElement(0), (short)'0');
-        Assert.AreEqual(tValue2.GetElement(1), (short)'1');
-        Assert.AreEqual(tValue2.GetElement(2), (short)'2');
-        Assert.AreEqual(tValue2.GetElement(3), (short)'3');
+        Assert.Equal(tValue2.GetElement(0), (short)'0');
+        Assert.Equal(tValue2.GetElement(1), (short)'1');
+        Assert.Equal(tValue2.GetElement(2), (short)'2');
+        Assert.Equal(tValue2.GetElement(3), (short)'3');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64COut('0', '1', '2', '3', out Vector64<char> value3));
 
         Vector64<char>* value4 = GenericsNative.GetVector64CPtr('0', '1', '2', '3');
         Vector64<short>* tValue4 = (Vector64<short>*)value4;
-        Assert.AreEqual(tValue4->GetElement(0), (short)'0');
-        Assert.AreEqual(tValue4->GetElement(1), (short)'1');
-        Assert.AreEqual(tValue4->GetElement(2), (short)'2');
-        Assert.AreEqual(tValue4->GetElement(3), (short)'3');
+        Assert.Equal(tValue4->GetElement(0), (short)'0');
+        Assert.Equal(tValue4->GetElement(1), (short)'1');
+        Assert.Equal(tValue4->GetElement(2), (short)'2');
+        Assert.Equal(tValue4->GetElement(3), (short)'3');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64CRef('0', '1', '2', '3'));
 
index 04e0ff6..2be39f9 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,12 +44,12 @@ unsafe partial class GenericsTest
 
         Vector64<double> value2;
         GenericsNative.GetVector64DOut(1.0, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1.0);
+        Assert.Equal(value2.GetElement(0), 1.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64DOut(1.0, out Vector64<double> value3));
 
         Vector64<double>* value4 = GenericsNative.GetVector64DPtr(1.0);
-        Assert.AreEqual(value4->GetElement(0), 1.0);
+        Assert.Equal(value4->GetElement(0), 1.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64DRef(1.0));
 
index 9397a83..54a3cad 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,14 +44,14 @@ unsafe partial class GenericsTest
 
         Vector64<float> value2;
         GenericsNative.GetVector64FOut(1.0f, 2.0f, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1.0f);
-        Assert.AreEqual(value2.GetElement(1), 2.0f);
+        Assert.Equal(value2.GetElement(0), 1.0f);
+        Assert.Equal(value2.GetElement(1), 2.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64FOut(1.0f, 2.0f, out Vector64<float> value3));
 
         Vector64<float>* value4 = GenericsNative.GetVector64FPtr(1.0f, 2.0f);
-        Assert.AreEqual(value4->GetElement(0), 1.0f);
-        Assert.AreEqual(value4->GetElement(1), 2.0f);
+        Assert.Equal(value4->GetElement(0), 1.0f);
+        Assert.Equal(value4->GetElement(1), 2.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64FRef(1.0f, 2.0f));
 
index 1e24a89..cb215a0 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,12 +44,12 @@ unsafe partial class GenericsTest
 
         Vector64<long> value2;
         GenericsNative.GetVector64LOut(1L, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1L);
+        Assert.Equal(value2.GetElement(0), 1L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64LOut(1L, out Vector64<long> value3));
 
         Vector64<long>* value4 = GenericsNative.GetVector64LPtr(1L);
-        Assert.AreEqual(value4->GetElement(0), 1L);
+        Assert.Equal(value4->GetElement(0), 1L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64LRef(1L));
 
index 6d305a6..20be15f 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -44,14 +44,14 @@ unsafe partial class GenericsTest
 
         Vector64<uint> value2;
         GenericsNative.GetVector64UOut(1u, 2u, &value2);
-        Assert.AreEqual(value2.GetElement(0), 1u);
-        Assert.AreEqual(value2.GetElement(1), 2u);
+        Assert.Equal(value2.GetElement(0), 1u);
+        Assert.Equal(value2.GetElement(1), 2u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64UOut(1u, 2u, out Vector64<uint> value3));
 
         Vector64<uint>* value4 = GenericsNative.GetVector64UPtr(1u, 2u);
-        Assert.AreEqual(value4->GetElement(0), 1u);
-        Assert.AreEqual(value4->GetElement(1), 2u);
+        Assert.Equal(value4->GetElement(0), 1u);
+        Assert.Equal(value4->GetElement(1), 2u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVector64URef(1u, 2u));
 
index 4ba03f2..16d6d42 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Numerics;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -73,7 +73,7 @@ unsafe partial class GenericsTest
         }
         else
         {
-            Assert.AreEqual(Vector<byte>.Count, 16);
+            Assert.Equal(Vector<byte>.Count, 16);
             TestVectorB128();
         }
     }
@@ -85,43 +85,43 @@ unsafe partial class GenericsTest
         Vector<bool> value2;
         GenericsNative.GetVectorB128Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2);
         Vector<byte> tValue2 = *(Vector<byte>*)&value2;
-        Assert.AreEqual(tValue2[0], 1);
-        Assert.AreEqual(tValue2[1], 0);
-        Assert.AreEqual(tValue2[2], 1);
-        Assert.AreEqual(tValue2[3], 0);
-        Assert.AreEqual(tValue2[4], 1);
-        Assert.AreEqual(tValue2[5], 0);
-        Assert.AreEqual(tValue2[6], 1);
-        Assert.AreEqual(tValue2[7], 0);
-        Assert.AreEqual(tValue2[8], 1);
-        Assert.AreEqual(tValue2[9], 0);
-        Assert.AreEqual(tValue2[10], 1);
-        Assert.AreEqual(tValue2[11], 0);
-        Assert.AreEqual(tValue2[12], 1);
-        Assert.AreEqual(tValue2[13], 0);
-        Assert.AreEqual(tValue2[14], 1);
-        Assert.AreEqual(tValue2[15], 0);
+        Assert.Equal(tValue2[0], 1);
+        Assert.Equal(tValue2[1], 0);
+        Assert.Equal(tValue2[2], 1);
+        Assert.Equal(tValue2[3], 0);
+        Assert.Equal(tValue2[4], 1);
+        Assert.Equal(tValue2[5], 0);
+        Assert.Equal(tValue2[6], 1);
+        Assert.Equal(tValue2[7], 0);
+        Assert.Equal(tValue2[8], 1);
+        Assert.Equal(tValue2[9], 0);
+        Assert.Equal(tValue2[10], 1);
+        Assert.Equal(tValue2[11], 0);
+        Assert.Equal(tValue2[12], 1);
+        Assert.Equal(tValue2[13], 0);
+        Assert.Equal(tValue2[14], 1);
+        Assert.Equal(tValue2[15], 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorB128Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector<bool> value3));
 
         Vector<bool>* value4 = GenericsNative.GetVectorB128Ptr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false);
         Vector<byte>* tValue4 = (Vector<byte>*)value4;
-        Assert.AreEqual((*tValue4)[0], 1);
-        Assert.AreEqual((*tValue4)[1], 0);
-        Assert.AreEqual((*tValue4)[2], 1);
-        Assert.AreEqual((*tValue4)[3], 0);
-        Assert.AreEqual((*tValue4)[4], 1);
-        Assert.AreEqual((*tValue4)[5], 0);
-        Assert.AreEqual((*tValue4)[6], 1);
-        Assert.AreEqual((*tValue4)[7], 0);
-        Assert.AreEqual((*tValue4)[8], 1);
-        Assert.AreEqual((*tValue4)[9], 0);
-        Assert.AreEqual((*tValue4)[10], 1);
-        Assert.AreEqual((*tValue4)[11], 0);
-        Assert.AreEqual((*tValue4)[12], 1);
-        Assert.AreEqual((*tValue4)[13], 0);
-        Assert.AreEqual((*tValue4)[14], 1);
-        Assert.AreEqual((*tValue4)[15], 0);
+        Assert.Equal((*tValue4)[0], 1);
+        Assert.Equal((*tValue4)[1], 0);
+        Assert.Equal((*tValue4)[2], 1);
+        Assert.Equal((*tValue4)[3], 0);
+        Assert.Equal((*tValue4)[4], 1);
+        Assert.Equal((*tValue4)[5], 0);
+        Assert.Equal((*tValue4)[6], 1);
+        Assert.Equal((*tValue4)[7], 0);
+        Assert.Equal((*tValue4)[8], 1);
+        Assert.Equal((*tValue4)[9], 0);
+        Assert.Equal((*tValue4)[10], 1);
+        Assert.Equal((*tValue4)[11], 0);
+        Assert.Equal((*tValue4)[12], 1);
+        Assert.Equal((*tValue4)[13], 0);
+        Assert.Equal((*tValue4)[14], 1);
+        Assert.Equal((*tValue4)[15], 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorB128Ref(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false));
 
@@ -154,75 +154,75 @@ unsafe partial class GenericsTest
         Vector<bool> value2;
         GenericsNative.GetVectorB256Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2);
         Vector<byte> tValue2 = *(Vector<byte>*)&value2;
-        Assert.AreEqual(tValue2[0], 1);
-        Assert.AreEqual(tValue2[1], 0);
-        Assert.AreEqual(tValue2[2], 1);
-        Assert.AreEqual(tValue2[3], 0);
-        Assert.AreEqual(tValue2[4], 1);
-        Assert.AreEqual(tValue2[5], 0);
-        Assert.AreEqual(tValue2[6], 1);
-        Assert.AreEqual(tValue2[7], 0);
-        Assert.AreEqual(tValue2[8], 1);
-        Assert.AreEqual(tValue2[9], 0);
-        Assert.AreEqual(tValue2[10], 1);
-        Assert.AreEqual(tValue2[11], 0);
-        Assert.AreEqual(tValue2[12], 1);
-        Assert.AreEqual(tValue2[13], 0);
-        Assert.AreEqual(tValue2[14], 1);
-        Assert.AreEqual(tValue2[15], 0);
-        Assert.AreEqual(tValue2[16], 1);
-        Assert.AreEqual(tValue2[17], 0);
-        Assert.AreEqual(tValue2[18], 1);
-        Assert.AreEqual(tValue2[19], 0);
-        Assert.AreEqual(tValue2[20], 1);
-        Assert.AreEqual(tValue2[21], 0);
-        Assert.AreEqual(tValue2[22], 1);
-        Assert.AreEqual(tValue2[23], 0);
-        Assert.AreEqual(tValue2[24], 1);
-        Assert.AreEqual(tValue2[25], 0);
-        Assert.AreEqual(tValue2[26], 1);
-        Assert.AreEqual(tValue2[27], 0);
-        Assert.AreEqual(tValue2[28], 1);
-        Assert.AreEqual(tValue2[29], 0);
-        Assert.AreEqual(tValue2[30], 1);
-        Assert.AreEqual(tValue2[31], 0);
+        Assert.Equal(tValue2[0], 1);
+        Assert.Equal(tValue2[1], 0);
+        Assert.Equal(tValue2[2], 1);
+        Assert.Equal(tValue2[3], 0);
+        Assert.Equal(tValue2[4], 1);
+        Assert.Equal(tValue2[5], 0);
+        Assert.Equal(tValue2[6], 1);
+        Assert.Equal(tValue2[7], 0);
+        Assert.Equal(tValue2[8], 1);
+        Assert.Equal(tValue2[9], 0);
+        Assert.Equal(tValue2[10], 1);
+        Assert.Equal(tValue2[11], 0);
+        Assert.Equal(tValue2[12], 1);
+        Assert.Equal(tValue2[13], 0);
+        Assert.Equal(tValue2[14], 1);
+        Assert.Equal(tValue2[15], 0);
+        Assert.Equal(tValue2[16], 1);
+        Assert.Equal(tValue2[17], 0);
+        Assert.Equal(tValue2[18], 1);
+        Assert.Equal(tValue2[19], 0);
+        Assert.Equal(tValue2[20], 1);
+        Assert.Equal(tValue2[21], 0);
+        Assert.Equal(tValue2[22], 1);
+        Assert.Equal(tValue2[23], 0);
+        Assert.Equal(tValue2[24], 1);
+        Assert.Equal(tValue2[25], 0);
+        Assert.Equal(tValue2[26], 1);
+        Assert.Equal(tValue2[27], 0);
+        Assert.Equal(tValue2[28], 1);
+        Assert.Equal(tValue2[29], 0);
+        Assert.Equal(tValue2[30], 1);
+        Assert.Equal(tValue2[31], 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorB256Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector<bool> value3));
 
         Vector<bool>* value4 = GenericsNative.GetVectorB256Ptr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false);
         Vector<byte>* tValue4 = (Vector<byte>*)value4;
-        Assert.AreEqual((*tValue4)[0], 1);
-        Assert.AreEqual((*tValue4)[1], 0);
-        Assert.AreEqual((*tValue4)[2], 1);
-        Assert.AreEqual((*tValue4)[3], 0);
-        Assert.AreEqual((*tValue4)[4], 1);
-        Assert.AreEqual((*tValue4)[5], 0);
-        Assert.AreEqual((*tValue4)[6], 1);
-        Assert.AreEqual((*tValue4)[7], 0);
-        Assert.AreEqual((*tValue4)[8], 1);
-        Assert.AreEqual((*tValue4)[9], 0);
-        Assert.AreEqual((*tValue4)[10], 1);
-        Assert.AreEqual((*tValue4)[11], 0);
-        Assert.AreEqual((*tValue4)[12], 1);
-        Assert.AreEqual((*tValue4)[13], 0);
-        Assert.AreEqual((*tValue4)[14], 1);
-        Assert.AreEqual((*tValue4)[15], 0);
-        Assert.AreEqual((*tValue4)[16], 1);
-        Assert.AreEqual((*tValue4)[17], 0);
-        Assert.AreEqual((*tValue4)[18], 1);
-        Assert.AreEqual((*tValue4)[19], 0);
-        Assert.AreEqual((*tValue4)[20], 1);
-        Assert.AreEqual((*tValue4)[21], 0);
-        Assert.AreEqual((*tValue4)[22], 1);
-        Assert.AreEqual((*tValue4)[23], 0);
-        Assert.AreEqual((*tValue4)[24], 1);
-        Assert.AreEqual((*tValue4)[25], 0);
-        Assert.AreEqual((*tValue4)[26], 1);
-        Assert.AreEqual((*tValue4)[27], 0);
-        Assert.AreEqual((*tValue4)[28], 1);
-        Assert.AreEqual((*tValue4)[29], 0);
-        Assert.AreEqual((*tValue4)[30], 1);
-        Assert.AreEqual((*tValue4)[31], 0);
+        Assert.Equal((*tValue4)[0], 1);
+        Assert.Equal((*tValue4)[1], 0);
+        Assert.Equal((*tValue4)[2], 1);
+        Assert.Equal((*tValue4)[3], 0);
+        Assert.Equal((*tValue4)[4], 1);
+        Assert.Equal((*tValue4)[5], 0);
+        Assert.Equal((*tValue4)[6], 1);
+        Assert.Equal((*tValue4)[7], 0);
+        Assert.Equal((*tValue4)[8], 1);
+        Assert.Equal((*tValue4)[9], 0);
+        Assert.Equal((*tValue4)[10], 1);
+        Assert.Equal((*tValue4)[11], 0);
+        Assert.Equal((*tValue4)[12], 1);
+        Assert.Equal((*tValue4)[13], 0);
+        Assert.Equal((*tValue4)[14], 1);
+        Assert.Equal((*tValue4)[15], 0);
+        Assert.Equal((*tValue4)[16], 1);
+        Assert.Equal((*tValue4)[17], 0);
+        Assert.Equal((*tValue4)[18], 1);
+        Assert.Equal((*tValue4)[19], 0);
+        Assert.Equal((*tValue4)[20], 1);
+        Assert.Equal((*tValue4)[21], 0);
+        Assert.Equal((*tValue4)[22], 1);
+        Assert.Equal((*tValue4)[23], 0);
+        Assert.Equal((*tValue4)[24], 1);
+        Assert.Equal((*tValue4)[25], 0);
+        Assert.Equal((*tValue4)[26], 1);
+        Assert.Equal((*tValue4)[27], 0);
+        Assert.Equal((*tValue4)[28], 1);
+        Assert.Equal((*tValue4)[29], 0);
+        Assert.Equal((*tValue4)[30], 1);
+        Assert.Equal((*tValue4)[31], 0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorB256Ref(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false));
 
index 96341de..44ca102 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Numerics;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -73,7 +73,7 @@ unsafe partial class GenericsTest
         }
         else
         {
-            Assert.AreEqual(Vector<short>.Count, 8);
+            Assert.Equal(Vector<short>.Count, 8);
             TestVectorC128();
         }
     }
@@ -85,27 +85,27 @@ unsafe partial class GenericsTest
         Vector<char> value2;
         GenericsNative.GetVectorC128Out('0', '1', '2', '3', '4', '5', '6', '7', &value2);
         Vector<short> tValue2 = *(Vector<short>*)&value2;
-        Assert.AreEqual(tValue2[0], (short)'0');
-        Assert.AreEqual(tValue2[1], (short)'1');
-        Assert.AreEqual(tValue2[2], (short)'2');
-        Assert.AreEqual(tValue2[3], (short)'3');
-        Assert.AreEqual(tValue2[4], (short)'4');
-        Assert.AreEqual(tValue2[5], (short)'5');
-        Assert.AreEqual(tValue2[6], (short)'6');
-        Assert.AreEqual(tValue2[7], (short)'7');
+        Assert.Equal(tValue2[0], (short)'0');
+        Assert.Equal(tValue2[1], (short)'1');
+        Assert.Equal(tValue2[2], (short)'2');
+        Assert.Equal(tValue2[3], (short)'3');
+        Assert.Equal(tValue2[4], (short)'4');
+        Assert.Equal(tValue2[5], (short)'5');
+        Assert.Equal(tValue2[6], (short)'6');
+        Assert.Equal(tValue2[7], (short)'7');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorC128Out('0', '1', '2', '3', '4', '5', '6', '7', out Vector<char> value3));
 
         Vector<char>* value4 = GenericsNative.GetVectorC128Ptr('0', '1', '2', '3', '4', '5', '6', '7');
         Vector<short>* tValue4 = (Vector<short>*)value4;
-        Assert.AreEqual((*tValue4)[0], (short)'0');
-        Assert.AreEqual((*tValue4)[1], (short)'1');
-        Assert.AreEqual((*tValue4)[2], (short)'2');
-        Assert.AreEqual((*tValue4)[3], (short)'3');
-        Assert.AreEqual((*tValue4)[4], (short)'4');
-        Assert.AreEqual((*tValue4)[5], (short)'5');
-        Assert.AreEqual((*tValue4)[6], (short)'6');
-        Assert.AreEqual((*tValue4)[7], (short)'7');
+        Assert.Equal((*tValue4)[0], (short)'0');
+        Assert.Equal((*tValue4)[1], (short)'1');
+        Assert.Equal((*tValue4)[2], (short)'2');
+        Assert.Equal((*tValue4)[3], (short)'3');
+        Assert.Equal((*tValue4)[4], (short)'4');
+        Assert.Equal((*tValue4)[5], (short)'5');
+        Assert.Equal((*tValue4)[6], (short)'6');
+        Assert.Equal((*tValue4)[7], (short)'7');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorC128Ref('0', '1', '2', '3', '4', '5', '6', '7'));
 
@@ -138,43 +138,43 @@ unsafe partial class GenericsTest
         Vector<char> value2;
         GenericsNative.GetVectorC256Out('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', &value2);
         Vector<short> tValue2 = *(Vector<short>*)&value2;
-        Assert.AreEqual(tValue2[0], (short)'0');
-        Assert.AreEqual(tValue2[1], (short)'1');
-        Assert.AreEqual(tValue2[2], (short)'2');
-        Assert.AreEqual(tValue2[3], (short)'3');
-        Assert.AreEqual(tValue2[4], (short)'4');
-        Assert.AreEqual(tValue2[5], (short)'5');
-        Assert.AreEqual(tValue2[6], (short)'6');
-        Assert.AreEqual(tValue2[7], (short)'7');
-        Assert.AreEqual(tValue2[8], (short)'8');
-        Assert.AreEqual(tValue2[9], (short)'9');
-        Assert.AreEqual(tValue2[10], (short)'A');
-        Assert.AreEqual(tValue2[11], (short)'B');
-        Assert.AreEqual(tValue2[12], (short)'C');
-        Assert.AreEqual(tValue2[13], (short)'D');
-        Assert.AreEqual(tValue2[14], (short)'E');
-        Assert.AreEqual(tValue2[15], (short)'F');
+        Assert.Equal(tValue2[0], (short)'0');
+        Assert.Equal(tValue2[1], (short)'1');
+        Assert.Equal(tValue2[2], (short)'2');
+        Assert.Equal(tValue2[3], (short)'3');
+        Assert.Equal(tValue2[4], (short)'4');
+        Assert.Equal(tValue2[5], (short)'5');
+        Assert.Equal(tValue2[6], (short)'6');
+        Assert.Equal(tValue2[7], (short)'7');
+        Assert.Equal(tValue2[8], (short)'8');
+        Assert.Equal(tValue2[9], (short)'9');
+        Assert.Equal(tValue2[10], (short)'A');
+        Assert.Equal(tValue2[11], (short)'B');
+        Assert.Equal(tValue2[12], (short)'C');
+        Assert.Equal(tValue2[13], (short)'D');
+        Assert.Equal(tValue2[14], (short)'E');
+        Assert.Equal(tValue2[15], (short)'F');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorC256Out('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', out Vector<char> value3));
 
         Vector<char>* value4 = GenericsNative.GetVectorC256Ptr('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
         Vector<short>* tValue4 = (Vector<short>*)value4;
-        Assert.AreEqual((*tValue4)[0], (short)'0');
-        Assert.AreEqual((*tValue4)[1], (short)'1');
-        Assert.AreEqual((*tValue4)[2], (short)'2');
-        Assert.AreEqual((*tValue4)[3], (short)'3');
-        Assert.AreEqual((*tValue4)[4], (short)'4');
-        Assert.AreEqual((*tValue4)[5], (short)'5');
-        Assert.AreEqual((*tValue4)[6], (short)'6');
-        Assert.AreEqual((*tValue4)[7], (short)'7');
-        Assert.AreEqual((*tValue4)[8], (short)'8');
-        Assert.AreEqual((*tValue4)[9], (short)'9');
-        Assert.AreEqual((*tValue4)[10], (short)'A');
-        Assert.AreEqual((*tValue4)[11], (short)'B');
-        Assert.AreEqual((*tValue4)[12], (short)'C');
-        Assert.AreEqual((*tValue4)[13], (short)'D');
-        Assert.AreEqual((*tValue4)[14], (short)'E');
-        Assert.AreEqual((*tValue4)[15], (short)'F');
+        Assert.Equal((*tValue4)[0], (short)'0');
+        Assert.Equal((*tValue4)[1], (short)'1');
+        Assert.Equal((*tValue4)[2], (short)'2');
+        Assert.Equal((*tValue4)[3], (short)'3');
+        Assert.Equal((*tValue4)[4], (short)'4');
+        Assert.Equal((*tValue4)[5], (short)'5');
+        Assert.Equal((*tValue4)[6], (short)'6');
+        Assert.Equal((*tValue4)[7], (short)'7');
+        Assert.Equal((*tValue4)[8], (short)'8');
+        Assert.Equal((*tValue4)[9], (short)'9');
+        Assert.Equal((*tValue4)[10], (short)'A');
+        Assert.Equal((*tValue4)[11], (short)'B');
+        Assert.Equal((*tValue4)[12], (short)'C');
+        Assert.Equal((*tValue4)[13], (short)'D');
+        Assert.Equal((*tValue4)[14], (short)'E');
+        Assert.Equal((*tValue4)[15], (short)'F');
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorC256Ref('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'));
 
index 0697abb..40f7228 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Numerics;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -73,7 +73,7 @@ unsafe partial class GenericsTest
         }
         else
         {
-            Assert.AreEqual(Vector<double>.Count, 2);
+            Assert.Equal(Vector<double>.Count, 2);
             TestVectorD128();
         }
     }
@@ -84,14 +84,14 @@ unsafe partial class GenericsTest
 
         Vector<double> value2;
         GenericsNative.GetVectorD128Out(1.0, 2.0, &value2);
-        Assert.AreEqual(value2[0], 1.0);
-        Assert.AreEqual(value2[1], 2.0);
+        Assert.Equal(value2[0], 1.0);
+        Assert.Equal(value2[1], 2.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorD128Out(1.0, 2.0, out Vector<double> value3));
 
         Vector<double>* value4 = GenericsNative.GetVectorD128Ptr(1.0, 2.0);
-        Assert.AreEqual((*value4)[0], 1.0);
-        Assert.AreEqual((*value4)[1], 2.0);
+        Assert.Equal((*value4)[0], 1.0);
+        Assert.Equal((*value4)[1], 2.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorD128Ref(1.0, 2.0));
 
@@ -123,18 +123,18 @@ unsafe partial class GenericsTest
 
         Vector<double> value2;
         GenericsNative.GetVectorD256Out(1.0, 2.0, 3.0, 4.0, &value2);
-        Assert.AreEqual(value2[0], 1.0);
-        Assert.AreEqual(value2[1], 2.0);
-        Assert.AreEqual(value2[2], 3.0);
-        Assert.AreEqual(value2[3], 4.0);
+        Assert.Equal(value2[0], 1.0);
+        Assert.Equal(value2[1], 2.0);
+        Assert.Equal(value2[2], 3.0);
+        Assert.Equal(value2[3], 4.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorD256Out(1.0, 2.0, 3.0, 4.0, out Vector<double> value3));
 
         Vector<double>* value4 = GenericsNative.GetVectorD256Ptr(1.0, 2.0, 3.0, 4.0);
-        Assert.AreEqual((*value4)[0], 1.0);
-        Assert.AreEqual((*value4)[1], 2.0);
-        Assert.AreEqual((*value4)[2], 3.0);
-        Assert.AreEqual((*value4)[3], 4.0);
+        Assert.Equal((*value4)[0], 1.0);
+        Assert.Equal((*value4)[1], 2.0);
+        Assert.Equal((*value4)[2], 3.0);
+        Assert.Equal((*value4)[3], 4.0);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorD256Ref(1.0, 2.0, 3.0, 4.0));
 
index 6b9d1cf..2919f3c 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Numerics;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -73,7 +73,7 @@ unsafe partial class GenericsTest
         }
         else
         {
-            Assert.AreEqual(Vector<float>.Count, 4);
+            Assert.Equal(Vector<float>.Count, 4);
             TestVectorF128();
         }
     }
@@ -84,18 +84,18 @@ unsafe partial class GenericsTest
 
         Vector<float> value2;
         GenericsNative.GetVectorF128Out(1.0f, 2.0f, 3.0f, 4.0f, &value2);
-        Assert.AreEqual(value2[0], 1.0f);
-        Assert.AreEqual(value2[1], 2.0f);
-        Assert.AreEqual(value2[2], 3.0f);
-        Assert.AreEqual(value2[3], 4.0f);
+        Assert.Equal(value2[0], 1.0f);
+        Assert.Equal(value2[1], 2.0f);
+        Assert.Equal(value2[2], 3.0f);
+        Assert.Equal(value2[3], 4.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorF128Out(1.0f, 2.0f, 3.0f, 4.0f, out Vector<float> value3));
 
         Vector<float>* value4 = GenericsNative.GetVectorF128Ptr(1.0f, 2.0f, 3.0f, 4.0f);
-        Assert.AreEqual((*value4)[0], 1.0f);
-        Assert.AreEqual((*value4)[1], 2.0f);
-        Assert.AreEqual((*value4)[2], 3.0f);
-        Assert.AreEqual((*value4)[3], 4.0f);
+        Assert.Equal((*value4)[0], 1.0f);
+        Assert.Equal((*value4)[1], 2.0f);
+        Assert.Equal((*value4)[2], 3.0f);
+        Assert.Equal((*value4)[3], 4.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorF128Ref(1.0f, 2.0f, 3.0f, 4.0f));
 
@@ -127,26 +127,26 @@ unsafe partial class GenericsTest
 
         Vector<float> value2;
         GenericsNative.GetVectorF256Out(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, &value2);
-        Assert.AreEqual(value2[0], 1.0f);
-        Assert.AreEqual(value2[1], 2.0f);
-        Assert.AreEqual(value2[2], 3.0f);
-        Assert.AreEqual(value2[3], 4.0f);
-        Assert.AreEqual(value2[4], 5.0f);
-        Assert.AreEqual(value2[5], 6.0f);
-        Assert.AreEqual(value2[6], 7.0f);
-        Assert.AreEqual(value2[7], 8.0f);
+        Assert.Equal(value2[0], 1.0f);
+        Assert.Equal(value2[1], 2.0f);
+        Assert.Equal(value2[2], 3.0f);
+        Assert.Equal(value2[3], 4.0f);
+        Assert.Equal(value2[4], 5.0f);
+        Assert.Equal(value2[5], 6.0f);
+        Assert.Equal(value2[6], 7.0f);
+        Assert.Equal(value2[7], 8.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorF256Out(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, out Vector<float> value3));
 
         Vector<float>* value4 = GenericsNative.GetVectorF256Ptr(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f);
-        Assert.AreEqual((*value4)[0], 1.0f);
-        Assert.AreEqual((*value4)[1], 2.0f);
-        Assert.AreEqual((*value4)[2], 3.0f);
-        Assert.AreEqual((*value4)[3], 4.0f);
-        Assert.AreEqual((*value4)[4], 5.0f);
-        Assert.AreEqual((*value4)[5], 6.0f);
-        Assert.AreEqual((*value4)[6], 7.0f);
-        Assert.AreEqual((*value4)[7], 8.0f);
+        Assert.Equal((*value4)[0], 1.0f);
+        Assert.Equal((*value4)[1], 2.0f);
+        Assert.Equal((*value4)[2], 3.0f);
+        Assert.Equal((*value4)[3], 4.0f);
+        Assert.Equal((*value4)[4], 5.0f);
+        Assert.Equal((*value4)[5], 6.0f);
+        Assert.Equal((*value4)[6], 7.0f);
+        Assert.Equal((*value4)[7], 8.0f);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorF256Ref(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f));
 
index 31c83f2..6907023 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Numerics;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -73,7 +73,7 @@ unsafe partial class GenericsTest
         }
         else
         {
-            Assert.AreEqual(Vector<long>.Count, 2);
+            Assert.Equal(Vector<long>.Count, 2);
             TestVectorL128();
         }
     }
@@ -84,14 +84,14 @@ unsafe partial class GenericsTest
 
         Vector<long> value2;
         GenericsNative.GetVectorL128Out(1L, 2L, &value2);
-        Assert.AreEqual(value2[0], 1L);
-        Assert.AreEqual(value2[1], 2L);
+        Assert.Equal(value2[0], 1L);
+        Assert.Equal(value2[1], 2L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorL128Out(1L, 2L, out Vector<long> value3));
 
         Vector<long>* value4 = GenericsNative.GetVectorL128Ptr(1L, 2L);
-        Assert.AreEqual((*value4)[0], 1L);
-        Assert.AreEqual((*value4)[1], 2L);
+        Assert.Equal((*value4)[0], 1L);
+        Assert.Equal((*value4)[1], 2L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorL128Ref(1L, 2L));
 
@@ -123,18 +123,18 @@ unsafe partial class GenericsTest
 
         Vector<long> value2;
         GenericsNative.GetVectorL256Out(1L, 2L, 3L, 4L, &value2);
-        Assert.AreEqual(value2[0], 1L);
-        Assert.AreEqual(value2[1], 2L);
-        Assert.AreEqual(value2[2], 3L);
-        Assert.AreEqual(value2[3], 4L);
+        Assert.Equal(value2[0], 1L);
+        Assert.Equal(value2[1], 2L);
+        Assert.Equal(value2[2], 3L);
+        Assert.Equal(value2[3], 4L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorL256Out(1L, 2L, 3L, 4L, out Vector<long> value3));
 
         Vector<long>* value4 = GenericsNative.GetVectorL256Ptr(1L, 2L, 3L, 4L);
-        Assert.AreEqual((*value4)[0], 1L);
-        Assert.AreEqual((*value4)[1], 2L);
-        Assert.AreEqual((*value4)[2], 3L);
-        Assert.AreEqual((*value4)[3], 4L);
+        Assert.Equal((*value4)[0], 1L);
+        Assert.Equal((*value4)[1], 2L);
+        Assert.Equal((*value4)[2], 3L);
+        Assert.Equal((*value4)[3], 4L);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorL256Ref(1L, 2L, 3L, 4L));
 
index 306e240..2bfc5d8 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Numerics;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe partial class GenericsNative
 {
@@ -73,7 +73,7 @@ unsafe partial class GenericsTest
         }
         else
         {
-            Assert.AreEqual(Vector<uint>.Count, 4);
+            Assert.Equal(Vector<uint>.Count, 4);
             TestVectorU128();
         }
     }
@@ -84,18 +84,18 @@ unsafe partial class GenericsTest
 
         Vector<uint> value2;
         GenericsNative.GetVectorU128Out(1u, 2u, 3u, 4u, &value2);
-        Assert.AreEqual(value2[0], 1u);
-        Assert.AreEqual(value2[1], 2u);
-        Assert.AreEqual(value2[2], 3u);
-        Assert.AreEqual(value2[3], 4u);
+        Assert.Equal(value2[0], 1u);
+        Assert.Equal(value2[1], 2u);
+        Assert.Equal(value2[2], 3u);
+        Assert.Equal(value2[3], 4u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorU128Out(1u, 2u, 3u, 4u, out Vector<uint> value3));
 
         Vector<uint>* value4 = GenericsNative.GetVectorU128Ptr(1u, 2u, 3u, 4u);
-        Assert.AreEqual((*value4)[0], 1u);
-        Assert.AreEqual((*value4)[1], 2u);
-        Assert.AreEqual((*value4)[2], 3u);
-        Assert.AreEqual((*value4)[3], 4u);
+        Assert.Equal((*value4)[0], 1u);
+        Assert.Equal((*value4)[1], 2u);
+        Assert.Equal((*value4)[2], 3u);
+        Assert.Equal((*value4)[3], 4u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorU128Ref(1u, 2u, 3u, 4u));
 
@@ -127,26 +127,26 @@ unsafe partial class GenericsTest
 
         Vector<uint> value2;
         GenericsNative.GetVectorU256Out(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, &value2);
-        Assert.AreEqual(value2[0], 1u);
-        Assert.AreEqual(value2[1], 2u);
-        Assert.AreEqual(value2[2], 3u);
-        Assert.AreEqual(value2[3], 4u);
-        Assert.AreEqual(value2[4], 5u);
-        Assert.AreEqual(value2[5], 6u);
-        Assert.AreEqual(value2[6], 7u);
-        Assert.AreEqual(value2[7], 8u);
+        Assert.Equal(value2[0], 1u);
+        Assert.Equal(value2[1], 2u);
+        Assert.Equal(value2[2], 3u);
+        Assert.Equal(value2[3], 4u);
+        Assert.Equal(value2[4], 5u);
+        Assert.Equal(value2[5], 6u);
+        Assert.Equal(value2[6], 7u);
+        Assert.Equal(value2[7], 8u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorU256Out(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, out Vector<uint> value3));
 
         Vector<uint>* value4 = GenericsNative.GetVectorU256Ptr(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u);
-        Assert.AreEqual((*value4)[0], 1u);
-        Assert.AreEqual((*value4)[1], 2u);
-        Assert.AreEqual((*value4)[2], 3u);
-        Assert.AreEqual((*value4)[3], 4u);
-        Assert.AreEqual((*value4)[4], 5u);
-        Assert.AreEqual((*value4)[5], 6u);
-        Assert.AreEqual((*value4)[6], 7u);
-        Assert.AreEqual((*value4)[7], 8u);
+        Assert.Equal((*value4)[0], 1u);
+        Assert.Equal((*value4)[1], 2u);
+        Assert.Equal((*value4)[2], 3u);
+        Assert.Equal((*value4)[3], 4u);
+        Assert.Equal((*value4)[4], 5u);
+        Assert.Equal((*value4)[5], 6u);
+        Assert.Equal((*value4)[6], 7u);
+        Assert.Equal((*value4)[7], 8u);
 
         Assert.Throws<MarshalDirectiveException>(() => GenericsNative.GetVectorU256Ref(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u));
 
index f89d38e..11400d9 100644 (file)
@@ -6,7 +6,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace PInvokeTests
 {
@@ -42,8 +42,8 @@ namespace PInvokeTests
     {
         private static void TestNativeToManaged()
         {
-            Assert.AreAllEqual(Enumerable.Range(1, 10), EnumeratorAsEnumerable(IEnumeratorNative.GetIntegerEnumerator(1, 10)));
-            Assert.AreAllEqual(Enumerable.Range(1, 10), IEnumeratorNative.GetIntegerEnumeration(1, 10).OfType<int>());
+            AssertExtensions.CollectionEqual(Enumerable.Range(1, 10), EnumeratorAsEnumerable(IEnumeratorNative.GetIntegerEnumerator(1, 10)));
+            AssertExtensions.CollectionEqual(Enumerable.Range(1, 10), IEnumeratorNative.GetIntegerEnumeration(1, 10).OfType<int>());
         }
 
         private static void TestManagedToNative()
@@ -55,13 +55,13 @@ namespace PInvokeTests
         private static void TestNativeRoundTrip()
         {
             IEnumerator nativeEnumerator = IEnumeratorNative.GetIntegerEnumerator(1, 10);
-            Assert.AreEqual(nativeEnumerator, IEnumeratorNative.PassThroughEnumerator(nativeEnumerator));
+            Assert.Equal(nativeEnumerator, IEnumeratorNative.PassThroughEnumerator(nativeEnumerator));
         }
 
         private static void TestManagedRoundTrip()
         {
             IEnumerator managedEnumerator = Enumerable.Range(1, 10).GetEnumerator();
-            Assert.AreEqual(managedEnumerator, IEnumeratorNative.PassThroughEnumerator(managedEnumerator));
+            Assert.Equal(managedEnumerator, IEnumeratorNative.PassThroughEnumerator(managedEnumerator));
         }
 
         public static int Main()
index 31f64bb..37e8e3c 100644 (file)
@@ -6,7 +6,7 @@ using System.IO;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 static unsafe class CopyCtor
 {
index 27c92dd..8b6d1b3 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 
 class HandleRefTest
 {
@@ -36,25 +36,25 @@ class HandleRefTest
             int int1 = intManaged;
             int* int1Ptr = &int1;
             HandleRef hr1 = new HandleRef(new Object(), (IntPtr)int1Ptr);
-            Assert.AreEqual(intReturn, MarshalPointer_In(hr1, stackGuard), "The return value is wrong");
-            Assert.AreEqual(intManaged, int1, "The parameter value is changed");
-            
+            Assert.Equal(intReturn, MarshalPointer_In(hr1, stackGuard));
+            Assert.Equal(intManaged, int1);
+
             Console.WriteLine("MarshalPointer_InOut");
             int int2 = intManaged;
             int* int2Ptr = &int2;
             HandleRef hr2 = new HandleRef(new Object(), (IntPtr)int2Ptr);
-            Assert.AreEqual(intReturn, MarshalPointer_InOut(hr2, stackGuard), "The return value is wrong");
-            Assert.AreEqual(intNative, int2, "The passed value is wrong");
-            
+            Assert.Equal(intReturn, MarshalPointer_InOut(hr2, stackGuard));
+            Assert.Equal(intNative, int2);
+
             Console.WriteLine("MarshalPointer_Out");
             int int3 = intManaged;
             int* int3Ptr = &int3;
             HandleRef hr3 = new HandleRef(new Object(), (IntPtr)int3Ptr);
-            Assert.AreEqual(intReturn, MarshalPointer_Out(hr3, stackGuard), "The return value is wrong");
-            Assert.AreEqual(intNative, int3, "The passed value is wrong");
+            Assert.Equal(intReturn, MarshalPointer_Out(hr3, stackGuard));
+            Assert.Equal(intNative, int3);
 
-            // Note that this scenario will always pass in a debug build because all values 
-            // stay rooted until the end of the method. 
+            // Note that this scenario will always pass in a debug build because all values
+            // stay rooted until the end of the method.
             Console.WriteLine("TestNoGC");
 
             int* int4Ptr = (int*)Marshal.AllocHGlobal(sizeof(int)); // We don't free this memory so we don't have to worry about a GC run between freeing and return (possible in a GCStress mode).
@@ -63,7 +63,7 @@ class HandleRefTest
             CollectableClass collectableClass = new CollectableClass(int4Ptr);
             HandleRef hr4 = new HandleRef(collectableClass, (IntPtr)int4Ptr);
             Action gcCallback = () => { Console.WriteLine("GC callback now"); GC.Collect(2, GCCollectionMode.Forced); GC.WaitForPendingFinalizers(); GC.Collect(2, GCCollectionMode.Forced); };
-            Assert.AreEqual(intReturn, TestNoGC(hr4, gcCallback), "The return value is wrong");
+            Assert.Equal(intReturn, TestNoGC(hr4, gcCallback));
             Console.WriteLine("Native code finished");
 
             Console.WriteLine("InvalidMarshalPointer_Return");
@@ -71,8 +71,8 @@ class HandleRefTest
 
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
         }
     }
 
index 3cbfee0..770bb97 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 class MultipleAssembliesWithSamePInvokeTest
 {
@@ -13,14 +13,14 @@ class MultipleAssembliesWithSamePInvokeTest
     public static int Main(string[] args)
     {
         try{
-            Assert.AreEqual(24, GetInt(), "MultipleAssembliesWithSamePInvoke.GetInt() failed.");
-            Assert.AreEqual(24, ManagedDll1.Class1.GetInt(), "ManagedDll.Class1.GetInt() failed.");
-            Assert.AreEqual(24, ManagedDll2.Class2.GetInt(), "ManagedDll.Class2.GetInt() failed.");
-            
+            Assert.Equal(24, GetInt());
+            Assert.Equal(24, ManagedDll1.Class1.GetInt());
+            Assert.Equal(24, ManagedDll2.Class2.GetInt());
+
             return 100;
         } catch (Exception e){
-            Console.WriteLine($"Test Failure: {e}"); 
-            return 101; 
-        }      
+            Console.WriteLine($"Test Failure: {e}");
+            return 101;
+        }
     }
 }
index 53d0791..6495fda 100644 (file)
@@ -5,10 +5,10 @@ using System;
 using System.Runtime.InteropServices;
 using System.Collections.Generic;
 using NativeCallManagedComVisible;
-using TestLibrary;
+using Xunit;
 
-// Setting ComVisible to true makes the types in this assembly visible 
-// to COM components by default.  If you don't need to access a type in 
+// Setting ComVisible to true makes the types in this assembly visible
+// to COM components by default.  If you don't need to access a type in
 // this assembly from COM, set the ComVisible attribute to false on that type.
 [assembly: ComVisible(true)]
 
@@ -120,7 +120,7 @@ public interface IDerivedInterfaceWithoutVisibleNoGuid
 
 /// <summary>
 /// Interface visible with ComVisible(true) and without Custom Attribute Guid.
-/// Note that in this test, change the method sequence in the interface will 
+/// Note that in this test, change the method sequence in the interface will
 ///  change the GUID and could reduce the test efficiency.
 /// </summary>
 [ComVisible(true)]
@@ -261,7 +261,7 @@ public sealed class ClassVisibleTrueServer :
     int IDerivedInterfaceVisibleTrueNoGuid.Foo1(UInt16 int16Val, bool boolVal) { return 13; }
     int IDerivedInterfaceVisibleTrueNoGuid.Foo5(Int32 int32Val) { return 14; }
     int IDerivedInterfaceWithoutVisibleNoGuid.Foo7(Int32 int32Val) { return 15; }
-    int IInterfaceNotVisibleNoGuid.Foo() { return 16; } 
+    int IInterfaceNotVisibleNoGuid.Foo() { return 16; }
 
     int IInterfaceComImport_ComImport.Foo() { return 101; }
     int IInterfaceVisibleTrue_ComImport.Foo() { return 102; }
@@ -482,7 +482,7 @@ public class ComVisibleServer
     /// </summary>
     [ComVisible(true)]
     [Guid("CF681980-CE6D-421E-8B21-AEAE3F1B7DAC")]
-    public sealed class NestedClassVisibleTrueServer : 
+    public sealed class NestedClassVisibleTrueServer :
         INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic,
         NestedClass.INestedInterfaceNestedInClass, INestedInterfaceComImport_ComImport, INestedInterfaceVisibleTrue_ComImport, INestedInterfaceVisibleFalse_ComImport,
         INestedInterfaceVisibleTrue_VisibleTrue, INestedInterfaceVisibleFalse_VisibleTrue, INestedInterfaceVisibleTrue_VisibleFalse, INestedInterfaceNotPublic_VisibleTrue
@@ -510,7 +510,7 @@ public class ComVisibleServer
     /// </summary>
     [ComVisible(false)]
     [Guid("6DF17EC1-A8F4-4693-B195-EDB27DF00170")]
-    public sealed class NestedClassVisibleFalseServer : 
+    public sealed class NestedClassVisibleFalseServer :
         INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic
     {
         int INestedInterfaceComImport.Foo() { return 20; }
@@ -525,7 +525,7 @@ public class ComVisibleServer
     /// Nested class not visible without ComVisible().
     /// </summary>
     [Guid("A57430B8-E0C1-486E-AE57-A15D6A729F99")]
-    public sealed class NestedClassWithoutVisibleServer : 
+    public sealed class NestedClassWithoutVisibleServer :
         INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic
     {
         int INestedInterfaceComImport.Foo() { return 30; }
@@ -554,10 +554,10 @@ public class ComVisibleServer
 
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_InterfaceVisibleTrue([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
-    
+
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_InterfaceVisibleFalse([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
-    
+
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_InterfaceWithoutVisible([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
 
@@ -608,7 +608,7 @@ public class ComVisibleServer
 
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_NestedInterfaceNotPublic([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
-    
+
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_NestedInterfaceNestedInClass([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
 
@@ -650,60 +650,60 @@ public class ComVisibleServer
         ClassVisibleTrueServer visibleBaseClass = new ClassVisibleTrueServer();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(1, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(1, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(2, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(2, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(4, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(4, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrueNoGuid");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(6, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(6, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceNotVisibleNoGuid");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(16, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(16, fooSuccessVal);
 
         //
         // Tests for nested Interface in a class with ComVisible(true)
         //
         Console.WriteLine("Nested Interface in a class with ComVisible(true)");
-        
+
         Console.WriteLine("CCWTest_InterfaceComImport_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(101, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(101, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(102, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(102, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse_ComImport");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(104, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(104, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleFalse");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(106, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(106, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceNotPublic_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal));
 
         //
         // Tests for class with ComVisible(false)
@@ -712,22 +712,22 @@ public class ComVisibleServer
         ClassVisibleFalseServer visibleFalseBaseClass = new ClassVisibleFalseServer();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(120, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal));
+        Assert.Equal(120, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(121, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal));
+        Assert.Equal(121, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(123, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal));
+        Assert.Equal(123, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal));
 
         //
         // Tests for class without ComVisible()
@@ -736,22 +736,22 @@ public class ComVisibleServer
         ClassWithoutVisibleServer withoutVisibleBaseClass = new ClassWithoutVisibleServer();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(130, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal));
+        Assert.Equal(130, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(131, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal));
+        Assert.Equal(131, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(133, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal));
+        Assert.Equal(133, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal));
 
 
         //
@@ -761,39 +761,39 @@ public class ComVisibleServer
         ClassGenericServer<int> genericServer = new ClassGenericServer<int>();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(140, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal));
+        Assert.Equal(140, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(141, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal));
+        Assert.Equal(141, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceGenericVisibleTrue");
-        Assert.AreEqual(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal), "Returned diferent exception than the expected COR_E_INVALIDOPERATION.");
+        Assert.Equal(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal));
 
         //
         // Tests for nested class with ComVisible(true)
         //
         Console.WriteLine("Nested class with ComVisible(true)");
         NestedClassVisibleTrueServer visibleNestedBaseClass = new NestedClassVisibleTrueServer();
-        
+
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(10, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(10, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(11, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(11, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(13, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(13, fooSuccessVal);
+
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested Interface in a nested class with ComVisible(true)
@@ -801,100 +801,100 @@ public class ComVisibleServer
         Console.WriteLine("Nested Interface in a nested class with ComVisible(true)");
 
         Console.WriteLine("CCWTest_NestedInterfaceNestedInClass");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(110, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(110, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceComImport_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(111, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(111, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(112, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(112, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_ComImport");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(114, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(114, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleFalse");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(116, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(116, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested class with ComVisible(false)
         //
         Console.WriteLine("Nested class with ComVisible(false)");
         NestedClassVisibleFalseServer visibleFalseNestedBaseClass = new NestedClassVisibleFalseServer();
-        
+
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(20, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(20, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(21, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(21, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(23, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(23, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested class without ComVisible()
         //
         Console.WriteLine("Nested class without ComVisible()");
         NestedClassWithoutVisibleServer withoutVisibleNestedBaseClass = new NestedClassWithoutVisibleServer();
-        
+
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(30, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(30, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(31, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(31, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(33, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(33, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for generic nested class with ComVisible(true)
         //
         Console.WriteLine("Nested generic class with ComVisible(true)");
         NestedClassGenericServer<int> nestedGenericServer = new NestedClassGenericServer<int>();
-        
+
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(40, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal));
+        Assert.Equal(40, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(41, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal));
+        Assert.Equal(41, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal));
     }
-    
+
     public static int Main()
     {
         try
index 0833adf..3b8e668 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Runtime.InteropServices;
 using System.Collections.Generic;
 using NativeCallManagedComVisible;
-using TestLibrary;
+using Xunit;
 
 // Don't set ComVisible.
 // [assembly: ComVisible(true)]
@@ -118,7 +118,7 @@ public interface IDerivedInterfaceWithoutVisibleNoGuid
 
 /// <summary>
 /// Interface visible with ComVisible(true) and without Custom Attribute Guid.
-/// Note that in this test, change the method sequence in the interface will 
+/// Note that in this test, change the method sequence in the interface will
 ///  change the GUID and could reduce the test efficiency.
 /// </summary>
 [ComVisible(true)]
@@ -649,30 +649,30 @@ public class ComVisibleServer
         ClassVisibleTrueServer visibleBaseClass = new ClassVisibleTrueServer();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(1, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(1, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(2, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(2, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_InterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(4, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(4, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrueNoGuid");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(6, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(6, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceNotVisibleNoGuid");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(16, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(16, fooSuccessVal);
 
         //
         // Tests for nested Interface in a class with ComVisible(true)
@@ -680,29 +680,29 @@ public class ComVisibleServer
         Console.WriteLine("Nested Interface in a class with ComVisible(true)");
 
         Console.WriteLine("CCWTest_InterfaceComImport_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(101, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(101, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrue_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(102, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(102, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleFalse_ComImport");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(104, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(104, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleFalse_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleFalse");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(106, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(106, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceNotPublic_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal));
 
         //
         // Tests for class with ComVisible(false)
@@ -711,22 +711,22 @@ public class ComVisibleServer
         ClassVisibleFalseServer visibleFalseBaseClass = new ClassVisibleFalseServer();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(120, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal));
+        Assert.Equal(120, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(121, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal));
+        Assert.Equal(121, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_InterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(123, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal));
+        Assert.Equal(123, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal));
 
         //
         // Tests for class without ComVisible()
@@ -735,22 +735,22 @@ public class ComVisibleServer
         ClassWithoutVisibleServer withoutVisibleBaseClass = new ClassWithoutVisibleServer();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(130, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal));
+        Assert.Equal(130, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(131, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal));
+        Assert.Equal(131, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_InterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(133, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal));
+        Assert.Equal(133, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal));
 
 
         //
@@ -760,15 +760,15 @@ public class ComVisibleServer
         ClassGenericServer<int> genericServer = new ClassGenericServer<int>();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(140, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal));
+        Assert.Equal(140, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(141, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal));
+        Assert.Equal(141, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceGenericVisibleTrue");
-        Assert.AreEqual(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal), "Returned diferent exception than the expected COR_E_INVALIDOPERATION.");
+        Assert.Equal(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal));
 
         //
         // Tests for nested class with ComVisible(true)
@@ -777,22 +777,22 @@ public class ComVisibleServer
         NestedClassVisibleTrueServer visibleNestedBaseClass = new NestedClassVisibleTrueServer();
 
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(10, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(10, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(11, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(11, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(13, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(13, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested Interface in a nested class with ComVisible(true)
@@ -800,33 +800,33 @@ public class ComVisibleServer
         Console.WriteLine("Nested Interface in a nested class with ComVisible(true)");
 
         Console.WriteLine("CCWTest_NestedInterfaceNestedInClass");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(110, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(110, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceComImport_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(111, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(111, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(112, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(112, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_ComImport");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(114, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(114, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleFalse");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(116, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(116, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested class with ComVisible(false)
@@ -835,22 +835,22 @@ public class ComVisibleServer
         NestedClassVisibleFalseServer visibleFalseNestedBaseClass = new NestedClassVisibleFalseServer();
 
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(20, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(20, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(21, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(21, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(23, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(23, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested class without ComVisible()
@@ -859,22 +859,22 @@ public class ComVisibleServer
         NestedClassWithoutVisibleServer withoutVisibleNestedBaseClass = new NestedClassWithoutVisibleServer();
 
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(30, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(30, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(31, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(31, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(33, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(33, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for generic nested class with ComVisible(true)
@@ -883,17 +883,17 @@ public class ComVisibleServer
         NestedClassGenericServer<int> nestedGenericServer = new NestedClassGenericServer<int>();
 
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(40, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal));
+        Assert.Equal(40, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(41, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal));
+        Assert.Equal(41, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal));
     }
-    
+
     public static int Main()
     {
         try
index 0584433..d18cd70 100644 (file)
@@ -6,10 +6,10 @@ using System.Runtime.InteropServices;
 using System.Reflection;
 using System.Collections.Generic;
 using NativeCallManagedComVisible;
-using TestLibrary;
+using Xunit;
 
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components by default.  If you need to access a type in this assembly from 
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components by default.  If you need to access a type in this assembly from
 // COM, set the ComVisible attribute to true on that type.
 [assembly: ComVisible(false)]
 
@@ -121,7 +121,7 @@ public interface IDerivedInterfaceWithoutVisibleNoGuid
 
 /// <summary>
 /// Interface visible with ComVisible(true) and without Custom Attribute Guid.
-/// Note that in this test, change the method sequence in the interface will 
+/// Note that in this test, change the method sequence in the interface will
 ///  change the GUID and could reduce the test efficiency.
 /// </summary>
 [ComVisible(true)]
@@ -250,7 +250,7 @@ interface IInterfaceNotPublic_VisibleTrue : IInterfaceVisibleTrue
 [ComVisible(true)]
 [Guid("48FC2EFC-C7ED-4E02-8D02-F05B6A439FC9")]
 public sealed class ClassVisibleTrueServer :
-    IInterfaceComImport, IInterfaceVisibleTrue, IInterfaceVisibleFalse, IInterfaceWithoutVisible, IInterfaceNotPublic, 
+    IInterfaceComImport, IInterfaceVisibleTrue, IInterfaceVisibleFalse, IInterfaceWithoutVisible, IInterfaceNotPublic,
     IInterfaceVisibleTrueNoGuid, IInterfaceNotVisibleNoGuid, IInterfaceVisibleTrueNoGuidGenericInterface,
     IInterfaceComImport_ComImport, IInterfaceVisibleTrue_ComImport, IInterfaceVisibleFalse_ComImport,
     IInterfaceVisibleTrue_VisibleTrue, IInterfaceVisibleFalse_VisibleTrue, IInterfaceVisibleTrue_VisibleFalse, IInterfaceNotPublic_VisibleTrue
@@ -263,10 +263,10 @@ public sealed class ClassVisibleTrueServer :
 
     int IInterfaceVisibleTrueNoGuid.Foo() { return 6; }
     int IInterfaceVisibleTrueNoGuid.Foo1(UInt16 int16Val, bool boolVal) { return 7; }
-    int IInterfaceVisibleTrueNoGuid.Foo2(string str, out int outIntVal, IntPtr intPtrVal, int[] arrayVal, byte inByteVal, int inIntVal) 
+    int IInterfaceVisibleTrueNoGuid.Foo2(string str, out int outIntVal, IntPtr intPtrVal, int[] arrayVal, byte inByteVal, int inIntVal)
     {
-        outIntVal = 10; 
-        return 8; 
+        outIntVal = 10;
+        return 8;
     }
     int IInterfaceVisibleTrueNoGuid.Foo3(ref short refShortVal, params byte[] paramsList) { return 9; }
     int IInterfaceVisibleTrueNoGuid.Foo4(ref List<short> refShortVal, GenericClassW2Pars<int, short> genericClass, params object[] paramsList) { return 10; }
@@ -278,7 +278,7 @@ public sealed class ClassVisibleTrueServer :
     int IInterfaceVisibleTrueNoGuidGenericInterface.Foo() { return 17; }
     int IInterfaceVisibleTrueNoGuidGenericInterface.Foo9(List<int> listInt) { return 18; }
     int IInterfaceVisibleTrueNoGuidGenericInterface.Foo10(ICollection<int> intCollection, ICollection<string> stringCollection) { return 19; }
-    
+
     int IInterfaceComImport_ComImport.Foo() { return 101; }
     int IInterfaceVisibleTrue_ComImport.Foo() { return 102; }
     int IInterfaceVisibleFalse_ComImport.Foo() { return 103; }
@@ -336,7 +336,7 @@ public sealed class ClassGenericServer<T> : IInterfaceVisibleTrue, IInterfaceGen
 
 /// <summary>
 /// Class visible with ComVisible(true) and without Custom Attribute Guid.
-/// Note that in this test, change the method sequence in the interface will 
+/// Note that in this test, change the method sequence in the interface will
 ///  change the GUID and could broke the test or reduce the test efficiency.
 /// </summary>
 [ComVisible(true)]
@@ -529,7 +529,7 @@ public class ComVisibleServer
     /// </summary>
     [ComVisible(true)]
     [Guid("CF681980-CE6D-421E-8B21-AEAE3F1B7DAC")]
-    public sealed class NestedClassVisibleTrueServer : 
+    public sealed class NestedClassVisibleTrueServer :
         INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic,
         INestedInterfaceVisibleTrueNoGuid, NestedClass.INestedInterfaceNestedInClassNoGuid,
         NestedClass.INestedInterfaceNestedInClass, INestedInterfaceComImport_ComImport, INestedInterfaceVisibleTrue_ComImport, INestedInterfaceVisibleFalse_ComImport,
@@ -561,7 +561,7 @@ public class ComVisibleServer
     /// </summary>
     [ComVisible(false)]
     [Guid("6DF17EC1-A8F4-4693-B195-EDB27DF00170")]
-    public sealed class NestedClassVisibleFalseServer : 
+    public sealed class NestedClassVisibleFalseServer :
         INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic
     {
         int INestedInterfaceComImport.Foo() { return 20; }
@@ -576,7 +576,7 @@ public class ComVisibleServer
     /// Nested class not visible without ComVisible().
     /// </summary>
     [Guid("A57430B8-E0C1-486E-AE57-A15D6A729F99")]
-    public sealed class NestedClassWithoutVisibleServer : 
+    public sealed class NestedClassWithoutVisibleServer :
         INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic
     {
         int INestedInterfaceComImport.Foo() { return 30; }
@@ -606,10 +606,10 @@ public class ComVisibleServer
 
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_InterfaceVisibleTrue([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
-    
+
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_InterfaceVisibleFalse([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
-    
+
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_InterfaceWithoutVisible([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
 
@@ -663,7 +663,7 @@ public class ComVisibleServer
 
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_NestedInterfaceNotPublic([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
-    
+
     [DllImport("ComVisibleNative")]
     public static extern int CCWTest_NestedInterfaceNestedInClass([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal);
 
@@ -711,61 +711,61 @@ public class ComVisibleServer
         ClassVisibleTrueServer visibleBaseClass = new ClassVisibleTrueServer();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(1, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(1, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(2, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(2, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrueNoGuid");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(6, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(6, fooSuccessVal);
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrueNoGuidGenericInterface");
-        Assert.AreEqual(Helpers.COR_E_GENERICMETHOD, CCWTest_InterfaceVisibleTrueNoGuidGenericInterface((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.COR_E_GENERICMETHOD, CCWTest_InterfaceVisibleTrueNoGuidGenericInterface((object)visibleBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_InterfaceNotVisibleNoGuid");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested Interface in a class with ComVisible(true)
         //
         Console.WriteLine("Nested Interface in a class with ComVisible(true)");
-        
+
         Console.WriteLine("CCWTest_InterfaceComImport_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(101, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(101, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(102, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(102, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse_ComImport");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(104, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(104, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleFalse");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(106, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal));
+        Assert.Equal(106, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceNotPublic_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal));
 
         //
         // Tests for class with ComVisible(false)
@@ -774,21 +774,21 @@ public class ComVisibleServer
         ClassVisibleFalseServer visibleFalseBaseClass = new ClassVisibleFalseServer();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(120, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal));
+        Assert.Equal(120, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(121, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal));
+        Assert.Equal(121, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal));
 
         //
         // Tests for class without ComVisible()
@@ -797,21 +797,21 @@ public class ComVisibleServer
         ClassWithoutVisibleServer withoutVisibleBaseClass = new ClassWithoutVisibleServer();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(130, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal));
+        Assert.Equal(130, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(131, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal));
+        Assert.Equal(131, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_InterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal));
 
         //
         // Tests for generic class with ComVisible(true)
@@ -820,38 +820,38 @@ public class ComVisibleServer
         ClassGenericServer<int> genericServer = new ClassGenericServer<int>();
 
         Console.WriteLine("CCWTest_InterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(140, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal));
+        Assert.Equal(140, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(141, fooSuccessVal, "COM method didn't return the expected value.");
-        
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal));
+        Assert.Equal(141, fooSuccessVal);
+
         Console.WriteLine("CCWTest_InterfaceGenericVisibleTrue");
-        Assert.AreEqual(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal), "Returned diferent exception than the expected COR_E_INVALIDOPERATION.");
+        Assert.Equal(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal));
 
         //
         // Tests for nested class with ComVisible(true)
         //
         Console.WriteLine("Nested class with ComVisible(true)");
         NestedClassVisibleTrueServer visibleNestedBaseClass = new NestedClassVisibleTrueServer();
-        
+
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(10, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(10, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(11, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(11, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested Interface in a nested class with ComVisible(true)
@@ -859,104 +859,104 @@ public class ComVisibleServer
         Console.WriteLine("Nested Interface in a nested class with ComVisible(true)");
 
         Console.WriteLine("CCWTest_NestedInterfaceNestedInClass");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(110, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(110, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrueNoGuid");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrueNoGuid((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(50, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrueNoGuid((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(50, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceNestedInClassNoGuid");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClassNoGuid((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(51, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClassNoGuid((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(51, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceComImport_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(111, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(111, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_ComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(112, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(112, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_ComImport");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(114, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(114, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
-        
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
+
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleFalse");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(116, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(116, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic_VisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested class with ComVisible(false)
         //
         Console.WriteLine("Nested class with ComVisible(false)");
         NestedClassVisibleFalseServer visibleFalseNestedBaseClass = new NestedClassVisibleFalseServer();
-        
+
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(20, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(20, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(21, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(21, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for nested class without ComVisible()
         //
         Console.WriteLine("Nested class without ComVisible()");
         NestedClassWithoutVisibleServer withoutVisibleNestedBaseClass = new NestedClassWithoutVisibleServer();
-        
+
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(30, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(30, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(31, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
+        Assert.Equal(31, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
 
         Console.WriteLine("CCWTest_NestedInterfaceNotPublic");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal));
 
         //
         // Tests for generic nested class with ComVisible(true)
         //
         Console.WriteLine("Nested generic class with ComVisible(true)");
         NestedClassGenericServer<int> nestedGenericServer = new NestedClassGenericServer<int>();
-        
+
         Console.WriteLine("CCWTest_NestedInterfaceComImport");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(40, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal));
+        Assert.Equal(40, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(41, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal));
+        Assert.Equal(41, fooSuccessVal);
 
         Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue");
-        Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE.");
+        Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal));
 
         //
         // Tests for class with ComVisible(true) without Custom Attribute Guid.
@@ -965,8 +965,8 @@ public class ComVisibleServer
         ClassVisibleTrueServerNoGuid visibleBaseClassNoGuid = new ClassVisibleTrueServerNoGuid();
 
         Console.WriteLine("CCWTest_InterfaceVisibleTrue");
-        Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClassNoGuid, out fooSuccessVal), "COM method thrown an unexpected exception.");
-        Assert.AreEqual(150, fooSuccessVal, "COM method didn't return the expected value.");
+        Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClassNoGuid, out fooSuccessVal));
+        Assert.Equal(150, fooSuccessVal);
 
         //
         // Tests for get the GetTypeInfo().GUID for Interface and class without Custom Attribute Guid.
@@ -974,38 +974,30 @@ public class ComVisibleServer
         Console.WriteLine("GetTypeInfo().GUID for Interface and Class without GUID");
 
         Console.WriteLine("IInterfaceVisibleTrueNoGuid.GUID");
-        Assert.AreEqual<Guid>(new Guid("ad50a327-d23a-38a4-9d6e-b32b32acf572"), typeof(IInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID,
-            typeof(IInterfaceVisibleTrueNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(IInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID + "}");
+        Assert.Equal<Guid>(new Guid("ad50a327-d23a-38a4-9d6e-b32b32acf572"), typeof(IInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID);
 
         Console.WriteLine("IInterfaceNotVisibleNoGuid.GUID");
-        Assert.AreEqual<Guid>(new Guid("b45587ec-9671-35bc-8b8e-f6bfb18a4d3a"), typeof(IInterfaceNotVisibleNoGuid).GetTypeInfo().GUID,
-            typeof(IInterfaceNotVisibleNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(IInterfaceNotVisibleNoGuid).GetTypeInfo().GUID + "}");
+        Assert.Equal<Guid>(new Guid("b45587ec-9671-35bc-8b8e-f6bfb18a4d3a"), typeof(IInterfaceNotVisibleNoGuid).GetTypeInfo().GUID);
 
         Console.WriteLine("IDerivedInterfaceVisibleTrueNoGuid.GUID");
-        Assert.AreEqual<Guid>(new Guid("c3f73319-f6b3-3ef6-a095-8cb04fb8cf8b"), typeof(IDerivedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID,
-            typeof(IDerivedInterfaceVisibleTrueNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(IDerivedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID + "}");
+        Assert.Equal<Guid>(new Guid("c3f73319-f6b3-3ef6-a095-8cb04fb8cf8b"), typeof(IDerivedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID);
 
         Console.WriteLine("IInterfaceVisibleTrueNoGuidGeneric.GUID");
-        Assert.AreEqual<Guid>(new Guid("50c0a59c-b6e1-36dd-b488-a905b54910d4"), typeof(IInterfaceVisibleTrueNoGuidGeneric).GetTypeInfo().GUID,
-            typeof(IInterfaceVisibleTrueNoGuidGeneric).GetTypeInfo() + " returns a wrong GUID {" + typeof(IInterfaceVisibleTrueNoGuidGeneric).GetTypeInfo().GUID + "}");
+        Assert.Equal<Guid>(new Guid("50c0a59c-b6e1-36dd-b488-a905b54910d4"), typeof(IInterfaceVisibleTrueNoGuidGeneric).GetTypeInfo().GUID);
 
         Console.WriteLine("IInterfaceVisibleTrueNoGuidGenericInterface.GUID");
-        Assert.AreEqual<Guid>(new Guid("384f0b5c-28d0-368c-8c7e-5e31a84a5c84"), typeof(IInterfaceVisibleTrueNoGuidGenericInterface).GetTypeInfo().GUID,
-            typeof(IInterfaceVisibleTrueNoGuidGenericInterface).GetTypeInfo() + " returns a wrong GUID {" + typeof(IInterfaceVisibleTrueNoGuidGenericInterface).GetTypeInfo().GUID + "}");
+        Assert.Equal<Guid>(new Guid("384f0b5c-28d0-368c-8c7e-5e31a84a5c84"), typeof(IInterfaceVisibleTrueNoGuidGenericInterface).GetTypeInfo().GUID);
 
         Console.WriteLine("ClassVisibleTrueServerNoGuid.GUID");
-        Assert.AreEqual<Guid>(new Guid("afb3aafc-75bc-35d3-be41-a399c2701929"), typeof(ClassVisibleTrueServerNoGuid).GetTypeInfo().GUID,
-            typeof(ClassVisibleTrueServerNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(ClassVisibleTrueServerNoGuid).GetTypeInfo().GUID + "}");
+        Assert.Equal<Guid>(new Guid("afb3aafc-75bc-35d3-be41-a399c2701929"), typeof(ClassVisibleTrueServerNoGuid).GetTypeInfo().GUID);
 
         Console.WriteLine("INestedInterfaceNestedInClassNoGuid.GUID");
-        Assert.AreEqual<Guid>(new Guid("486bcec9-904d-3445-871c-e7084a52eb1a"), typeof(NestedClass.INestedInterfaceNestedInClassNoGuid).GetTypeInfo().GUID,
-            typeof(NestedClass.INestedInterfaceNestedInClassNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(NestedClass.INestedInterfaceNestedInClassNoGuid).GetTypeInfo().GUID + "}");
+        Assert.Equal<Guid>(new Guid("486bcec9-904d-3445-871c-e7084a52eb1a"), typeof(NestedClass.INestedInterfaceNestedInClassNoGuid).GetTypeInfo().GUID);
 
         Console.WriteLine("INestedInterfaceVisibleTrueNoGuid.GUID");
-        Assert.AreEqual<Guid>(new Guid("0ea2cb33-db9f-3655-9240-47ef1dea0f1e"), typeof(INestedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID,
-            typeof(INestedInterfaceVisibleTrueNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(INestedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID + "}");
+        Assert.Equal<Guid>(new Guid("0ea2cb33-db9f-3655-9240-47ef1dea0f1e"), typeof(INestedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID);
     }
-    
+
     public static int Main()
     {
         try
index 5dc0410..052dcbc 100644 (file)
@@ -4,7 +4,7 @@
 using System.Runtime.InteropServices;
 using System;
 using System.Reflection;
-using TestLibrary;
+using Xunit;
 
 class TestClass
 {
@@ -27,19 +27,19 @@ class RuntimeHandlesTest
     private static void TestRuntimeMethodHandle()
     {
         RuntimeMethodHandle handle = typeof(TestClass).GetMethod(nameof(TestClass.Method)).MethodHandle;
-        Assert.IsTrue(Marshal_In(handle, handle.Value));
+        Assert.True(Marshal_In(handle, handle.Value));
     }
 
     private static void TestRuntimeFieldHandle()
     {
         RuntimeFieldHandle handle = typeof(TestClass).GetField(nameof(TestClass.field)).FieldHandle;
-        Assert.IsTrue(Marshal_In(handle, handle.Value));
+        Assert.True(Marshal_In(handle, handle.Value));
     }
 
     private static void TestRuntimeTypeHandle()
     {
         RuntimeTypeHandle handle = typeof(TestClass).TypeHandle;
-        Assert.IsTrue(Marshal_In(handle, handle.Value));
+        Assert.True(Marshal_In(handle, handle.Value));
     }
 
     public static int Main()
index a1cda16..d2ee3a3 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace SafeHandleTests
 {
@@ -19,7 +19,7 @@ namespace SafeHandleTests
 
             Assert.Throws<InvalidOperationException>(() => SafeHandleNative.GetHandleAndCookie(out _, value, out h));
 
-            Assert.AreEqual(value, h.DangerousGetHandle());
+            Assert.Equal(value, h.DangerousGetHandle());
 
             // Try again, this time triggering unmarshal failure with an array.
             value = (IntPtr)456;
@@ -27,7 +27,7 @@ namespace SafeHandleTests
 
             Assert.Throws<OverflowException>(() => SafeHandleNative.GetHandleAndArray(out _, out _, value, out h));
 
-            Assert.AreEqual(value, h.DangerousGetHandle());
+            Assert.Equal(value, h.DangerousGetHandle());
         }
     }
 }
index 03980e3..0295671 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace SafeHandleTests
 {
@@ -15,21 +15,21 @@ namespace SafeHandleTests
         public static void RunTest()
         {
             var testHandle = new TestSafeHandle(initialValue);
-            Assert.IsTrue(SafeHandleNative.SafeHandleByValue(testHandle, initialValue));
-            Assert.IsFalse(testHandle.IsClosed);
+            Assert.True(SafeHandleNative.SafeHandleByValue(testHandle, initialValue));
+            Assert.False(testHandle.IsClosed);
 
-            Assert.IsTrue(SafeHandleNative.SafeHandleByRef(ref testHandle, initialValue, newValue));
-            Assert.IsFalse(testHandle.IsClosed);
+            Assert.True(SafeHandleNative.SafeHandleByRef(ref testHandle, initialValue, newValue));
+            Assert.False(testHandle.IsClosed);
 
             testHandle = null;
             SafeHandleNative.SafeHandleOut(out testHandle, initialValue);
-            Assert.IsFalse(testHandle.IsClosed);
+            Assert.False(testHandle.IsClosed);
 
             testHandle = SafeHandleNative.SafeHandleReturn(newValue);
-            Assert.IsFalse(testHandle.IsClosed);
+            Assert.False(testHandle.IsClosed);
 
             testHandle = SafeHandleNative.SafeHandleReturn_Swapped(newValue);
-            Assert.IsFalse(testHandle.IsClosed);
+            Assert.False(testHandle.IsClosed);
 
             var str = new SafeHandleNative.StructWithHandle
             {
@@ -37,10 +37,10 @@ namespace SafeHandleTests
             };
 
             SafeHandleNative.StructWithSafeHandleByValue(str, initialValue);
-            Assert.IsFalse(str.handle.IsClosed);
-            
+            Assert.False(str.handle.IsClosed);
+
             SafeHandleNative.StructWithSafeHandleByRef(ref str, initialValue, initialValue);
-            Assert.IsFalse(str.handle.IsClosed);
+            Assert.False(str.handle.IsClosed);
         }
     }
 }
index b1179aa..b0b3aaa 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace SafeHandleTests
 {
@@ -15,13 +15,13 @@ namespace SafeHandleTests
         public static void RunTest()
         {
             var testHandle = new TestSafeHandle(initialValue);
-            Assert.IsTrue(SafeHandleNative.SafeHandleByValue(testHandle, initialValue));
+            Assert.True(SafeHandleNative.SafeHandleByValue(testHandle, initialValue));
 
-            Assert.IsTrue(SafeHandleNative.SafeHandleByRef(ref testHandle, initialValue, newValue));
-            Assert.AreEqual(newValue, testHandle.DangerousGetHandle());
+            Assert.True(SafeHandleNative.SafeHandleByRef(ref testHandle, initialValue, newValue));
+            Assert.Equal(newValue, testHandle.DangerousGetHandle());
 
             AbstractDerivedSafeHandle abstrHandle = new AbstractDerivedSafeHandleImplementation(initialValue);
-            Assert.IsTrue(SafeHandleNative.SafeHandleInByRef(abstrHandle, initialValue));
+            Assert.True(SafeHandleNative.SafeHandleInByRef(abstrHandle, initialValue));
             Assert.Throws<MarshalDirectiveException>(() => SafeHandleNative.SafeHandleByRef(ref abstrHandle, initialValue, newValue));
 
             NoDefaultConstructorSafeHandle noDefaultCtorHandle = new NoDefaultConstructorSafeHandle(initialValue);
@@ -29,20 +29,20 @@ namespace SafeHandleTests
 
             testHandle = null;
             SafeHandleNative.SafeHandleOut(out testHandle, initialValue);
-            Assert.AreEqual(initialValue, testHandle.DangerousGetHandle());
+            Assert.Equal(initialValue, testHandle.DangerousGetHandle());
 
             testHandle = SafeHandleNative.SafeHandleReturn(newValue);
-            Assert.AreEqual(newValue, testHandle.DangerousGetHandle());
-            
+            Assert.Equal(newValue, testHandle.DangerousGetHandle());
+
             Assert.Throws<MarshalDirectiveException>(() => SafeHandleNative.SafeHandleReturn_AbstractDerived(initialValue));
             Assert.Throws<MissingMethodException>(() => SafeHandleNative.SafeHandleReturn_NoDefaultConstructor(initialValue));
 
             var abstractDerivedImplementationHandle = SafeHandleNative.SafeHandleReturn_AbstractDerivedImplementation(initialValue);
-            Assert.AreEqual(initialValue, abstractDerivedImplementationHandle.DangerousGetHandle());
-        
+            Assert.Equal(initialValue, abstractDerivedImplementationHandle.DangerousGetHandle());
+
             testHandle = SafeHandleNative.SafeHandleReturn_Swapped(newValue);
-            Assert.AreEqual(newValue, testHandle.DangerousGetHandle());
-            
+            Assert.Equal(newValue, testHandle.DangerousGetHandle());
+
             Assert.Throws<MarshalDirectiveException>(() => SafeHandleNative.SafeHandleReturn_Swapped_AbstractDerived(initialValue));
             Assert.Throws<MissingMethodException>(() => SafeHandleNative.SafeHandleReturn_Swapped_NoDefaultConstructor(initialValue));
 
@@ -51,9 +51,9 @@ namespace SafeHandleTests
                 handle = new TestSafeHandle(initialValue)
             };
 
-            Assert.IsTrue(SafeHandleNative.StructWithSafeHandleByValue(str, initialValue));
-            
-            Assert.IsTrue(SafeHandleNative.StructWithSafeHandleByRef(ref str, initialValue, initialValue));
+            Assert.True(SafeHandleNative.StructWithSafeHandleByValue(str, initialValue));
+
+            Assert.True(SafeHandleNative.StructWithSafeHandleByRef(ref str, initialValue, initialValue));
 
             // Cannot change the value of a SafeHandle-derived field in a struct when marshalling byref.
             Assert.Throws<NotSupportedException>(() => SafeHandleNative.StructWithSafeHandleByRef(ref str, initialValue, newValue));
index d607ebd..5335c6b 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 class SetLastErrorTest
 {
@@ -28,7 +28,7 @@ class SetLastErrorTest
             int expected = Marshal.GetLastPInvokeError();
             SetLastErrorNative.SetError_Default(expected + 1, shouldSetError: true);
             int actual = Marshal.GetLastPInvokeError();
-            Assert.AreEqual(expected, actual);
+            Assert.Equal(expected, actual);
         }
 
         // SetLastError=false
@@ -36,7 +36,7 @@ class SetLastErrorTest
             int expected = Marshal.GetLastPInvokeError();
             SetLastErrorNative.SetError_False(expected + 1, shouldSetError: true);
             int actual = Marshal.GetLastPInvokeError();
-            Assert.AreEqual(expected, actual);
+            Assert.Equal(expected, actual);
         }
 
         // SetLastError=true
@@ -45,7 +45,7 @@ class SetLastErrorTest
             expected++;
             SetLastErrorNative.SetError_True(expected, shouldSetError: true);
             int actual = Marshal.GetLastPInvokeError();
-            Assert.AreEqual(expected, actual);
+            Assert.Equal(expected, actual);
         }
     }
 
@@ -59,7 +59,7 @@ class SetLastErrorTest
         // Calling a P/Invoke with SetLastError=true should clear any existing error.
         SetLastErrorNative.SetError_True(error, shouldSetError: false);
         int actual = Marshal.GetLastPInvokeError();
-        Assert.AreEqual(0, actual);
+        Assert.Equal(0, actual);
     }
 
     static int Main(string[] args)
index f56c273..c92fce5 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 /// <summary>
 ///  Pass Array Size by out keyword using SizeParamIndex Attributes
@@ -63,12 +63,12 @@ public class ClientMarshalArrayAsSizeParamIndexByOutTest
 
         byte byte_Array_Size;
         byte[] arrByte;
-        Assert.IsTrue(MarshalCStyleArrayByte_AsByOut_AsSizeParamIndex(out byte_Array_Size, out arrByte));
+        Assert.True(MarshalCStyleArrayByte_AsByOut_AsSizeParamIndex(out byte_Array_Size, out arrByte));
 
         //Construct Expected array
         int expected_ByteArray_Size = 1;
         byte[] expectedArrByte = Helper.GetExpChangeArray<byte>(expected_ByteArray_Size);
-        Assert.IsTrue(Helper.EqualArray<byte>(arrByte, (int)byte_Array_Size, expectedArrByte, (int)expectedArrByte.Length));
+        Assert.True(Helper.EqualArray<byte>(arrByte, (int)byte_Array_Size, expectedArrByte, (int)expectedArrByte.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -81,10 +81,10 @@ public class ClientMarshalArrayAsSizeParamIndexByOutTest
 
         sbyte sbyte_Array_Size;
         sbyte[] arrSbyte;
-        Assert.IsTrue(MarshalCStyleArraySbyte_AsByOut_AsSizeParamIndex(out sbyte_Array_Size, out arrSbyte));
+        Assert.True(MarshalCStyleArraySbyte_AsByOut_AsSizeParamIndex(out sbyte_Array_Size, out arrSbyte));
 
         sbyte[] expectedArrSbyte = Helper.GetExpChangeArray<sbyte>(sbyte.MaxValue);
-        Assert.IsTrue(Helper.EqualArray<sbyte>(arrSbyte, (int)sbyte_Array_Size, expectedArrSbyte, (int)expectedArrSbyte.Length));
+        Assert.True(Helper.EqualArray<sbyte>(arrSbyte, (int)sbyte_Array_Size, expectedArrSbyte, (int)expectedArrSbyte.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -97,12 +97,12 @@ public class ClientMarshalArrayAsSizeParamIndexByOutTest
 
         short shortArray_Size = (short)-1;
         short[] arrShort = Helper.InitArray<short>(10);
-        Assert.IsTrue(MarshalCStyleArrayShort_AsByOut_AsSizeParamIndex(out shortArray_Size, out arrShort));
+        Assert.True(MarshalCStyleArrayShort_AsByOut_AsSizeParamIndex(out shortArray_Size, out arrShort));
 
         //Construct Expected Array
         int expected_ShortArray_Size = 16384;//(SHRT_MAX+1)/2
         short[] expectedArrShort = Helper.GetExpChangeArray<short>(expected_ShortArray_Size);
-        Assert.IsTrue(Helper.EqualArray<short>(arrShort, (int)shortArray_Size, expectedArrShort, (int)expectedArrShort.Length));
+        Assert.True(Helper.EqualArray<short>(arrShort, (int)shortArray_Size, expectedArrShort, (int)expectedArrShort.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -127,11 +127,11 @@ public class ClientMarshalArrayAsSizeParamIndexByOutTest
 
         ushort ushort_Array_Size;
         ushort[] arrUshort;
-        Assert.IsTrue(MarshalCStyleArrayUshort_AsByOut_AsSizeParamIndex(out arrUshort, out ushort_Array_Size));
+        Assert.True(MarshalCStyleArrayUshort_AsByOut_AsSizeParamIndex(out arrUshort, out ushort_Array_Size));
 
         //Expected Array
         ushort[] expectedArrUshort = Helper.GetExpChangeArray<ushort>(ushort.MaxValue);
-        Assert.IsTrue(Helper.EqualArray<ushort>(arrUshort, (int)ushort_Array_Size, expectedArrUshort, (ushort)expectedArrUshort.Length));
+        Assert.True(Helper.EqualArray<ushort>(arrUshort, (int)ushort_Array_Size, expectedArrUshort, (ushort)expectedArrUshort.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -145,11 +145,11 @@ public class ClientMarshalArrayAsSizeParamIndexByOutTest
 
         Int32 Int32_Array_Size;
         Int32[] arrInt32;
-        Assert.IsTrue(MarshalCStyleArrayInt_AsByOut_AsSizeParamIndex(out Int32_Array_Size, out arrInt32));
+        Assert.True(MarshalCStyleArrayInt_AsByOut_AsSizeParamIndex(out Int32_Array_Size, out arrInt32));
 
         //Expected Array
         Int32[] expectedArrInt32 = Helper.GetExpChangeArray<Int32>(0);
-        Assert.IsTrue(Helper.EqualArray<Int32>(arrInt32, Int32_Array_Size, expectedArrInt32, expectedArrInt32.Length));
+        Assert.True(Helper.EqualArray<Int32>(arrInt32, Int32_Array_Size, expectedArrInt32, expectedArrInt32.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -165,11 +165,11 @@ public class ClientMarshalArrayAsSizeParamIndexByOutTest
 
         UInt32 UInt32_Array_Size = (UInt32)10;
         UInt32[] arrUInt32 = Helper.InitArray<UInt32>((Int32)UInt32_Array_Size);
-        Assert.IsTrue(MarshalCStyleArrayUInt_AsByOut_AsSizeParamIndex(out UInt32_Array_Size, out arrUInt32));
+        Assert.True(MarshalCStyleArrayUInt_AsByOut_AsSizeParamIndex(out UInt32_Array_Size, out arrUInt32));
 
         //Construct expected
         UInt32[] expectedArrUInt32 = Helper.GetExpChangeArray<UInt32>(expected_UInt32ArraySize);
-        Assert.IsTrue(Helper.EqualArray<UInt32>(arrUInt32, (Int32)UInt32_Array_Size, expectedArrUInt32, (Int32)expectedArrUInt32.Length));
+        Assert.True(Helper.EqualArray<UInt32>(arrUInt32, (Int32)UInt32_Array_Size, expectedArrUInt32, (Int32)expectedArrUInt32.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -185,10 +185,10 @@ public class ClientMarshalArrayAsSizeParamIndexByOutTest
 
         long long_Array_Size = (long)10;
         long[] arrLong = Helper.InitArray<long>((Int32)long_Array_Size);
-        Assert.IsTrue(MarshalCStyleArrayLong_AsByOut_AsSizeParamIndex(out long_Array_Size, out arrLong));
+        Assert.True(MarshalCStyleArrayLong_AsByOut_AsSizeParamIndex(out long_Array_Size, out arrLong));
 
         long[] expectedArrLong = Helper.GetExpChangeArray<long>(expected_LongArraySize);
-        Assert.IsTrue(Helper.EqualArray<long>(arrLong, (Int32)long_Array_Size, expectedArrLong, (Int32)expectedArrLong.Length));
+        Assert.True(Helper.EqualArray<long>(arrLong, (Int32)long_Array_Size, expectedArrLong, (Int32)expectedArrLong.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -204,10 +204,10 @@ public class ClientMarshalArrayAsSizeParamIndexByOutTest
 
         ulong ulong_Array_Size = (ulong)10;
         ulong[] arrUlong = Helper.InitArray<ulong>((Int32)ulong_Array_Size);
-        Assert.IsTrue(MarshalCStyleArrayUlong_AsByOut_AsSizeParamIndex(out arrUlong, out ulong_Array_Size, ulong_Array_Size));
+        Assert.True(MarshalCStyleArrayUlong_AsByOut_AsSizeParamIndex(out arrUlong, out ulong_Array_Size, ulong_Array_Size));
 
         ulong[] expectedArrUlong = Helper.GetExpChangeArray<ulong>(expected_ULongArraySize);
-        Assert.IsTrue(Helper.EqualArray<ulong>(arrUlong, (Int32)ulong_Array_Size, expectedArrUlong, (Int32)expectedArrUlong.Length));
+        Assert.True(Helper.EqualArray<ulong>(arrUlong, (Int32)ulong_Array_Size, expectedArrUlong, (Int32)expectedArrUlong.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -222,10 +222,10 @@ public class ClientMarshalArrayAsSizeParamIndexByOutTest
         int expected_StringArraySize = 20;
         int string_Array_Size = 10;
         String[] arrString = Helper.InitArray<String>(string_Array_Size);
-        Assert.IsTrue(MarshalCStyleArrayString_AsByOut_AsSizeParamIndex(out arrString, out string_Array_Size));
+        Assert.True(MarshalCStyleArrayString_AsByOut_AsSizeParamIndex(out arrString, out string_Array_Size));
 
         String[] expArrString = Helper.GetExpChangeArray<String>(expected_StringArraySize);
-        Assert.IsTrue(Helper.EqualArray<String>(arrString, string_Array_Size, expArrString, expArrString.Length));
+        Assert.True(Helper.EqualArray<String>(arrString, string_Array_Size, expArrString, expArrString.Length));
         Console.WriteLine(strDescription + " Ends!");
     }
 
index 20e0a20..5ce6f7b 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 /// <summary>
 ///  Pass LPArray Size by ref keyword using SizeParamIndex Attributes
@@ -65,12 +65,12 @@ public class ClientMarshalArrayAsSizeParamIndexByRefTest
 
         byte byte_Array_Size = 1;
         byte[] arrByte = Helper.InitArray<byte>(byte_Array_Size);
-        Assert.IsTrue(MarshalCStyleArrayByte_AsByRef_AsSizeParamIndex(ref byte_Array_Size, ref arrByte));
+        Assert.True(MarshalCStyleArrayByte_AsByRef_AsSizeParamIndex(ref byte_Array_Size, ref arrByte));
 
         //Construct Expected array
         int expected_ByteArray_Size = Byte.MinValue;
         byte[] expectedArrByte = Helper.GetExpChangeArray<byte>(expected_ByteArray_Size);
-        Assert.IsTrue(Helper.EqualArray<byte>(arrByte, (int)byte_Array_Size, expectedArrByte, (int)expectedArrByte.Length));
+        Assert.True(Helper.EqualArray<byte>(arrByte, (int)byte_Array_Size, expectedArrByte, (int)expectedArrByte.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -84,11 +84,11 @@ public class ClientMarshalArrayAsSizeParamIndexByRefTest
         sbyte sbyte_Array_Size = (sbyte)10;
         sbyte[] arrSbyte = Helper.InitArray<sbyte>(sbyte_Array_Size);
 
-        Assert.IsTrue(MarshalCStyleArraySbyte_AsByRef_AsSizeParamIndex(ref sbyte_Array_Size, ref arrSbyte));
+        Assert.True(MarshalCStyleArraySbyte_AsByRef_AsSizeParamIndex(ref sbyte_Array_Size, ref arrSbyte));
 
         //Construct Expected
         sbyte[] expectedArrSbyte = Helper.GetExpChangeArray<sbyte>(sbyte.MaxValue);
-        Assert.IsTrue(Helper.EqualArray<sbyte>(arrSbyte, (int)sbyte_Array_Size, expectedArrSbyte, (int)sbyte.MaxValue));
+        Assert.True(Helper.EqualArray<sbyte>(arrSbyte, (int)sbyte_Array_Size, expectedArrSbyte, (int)sbyte.MaxValue));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -103,11 +103,11 @@ public class ClientMarshalArrayAsSizeParamIndexByRefTest
         short[] arrShort = Helper.InitArray<short>(10);
         int expected_ByteArraySize = 20;
 
-        Assert.IsTrue(MarshalCStyleArrayShort_AsByRef_AsSizeParamIndex(ref short_Array_Size, ref arrShort));
+        Assert.True(MarshalCStyleArrayShort_AsByRef_AsSizeParamIndex(ref short_Array_Size, ref arrShort));
 
         //Construct Expected
         short[] expectedArrShort = Helper.GetExpChangeArray<short>(expected_ByteArraySize);
-        Assert.IsTrue(Helper.EqualArray<short>(arrShort, (int)short_Array_Size, expectedArrShort, expectedArrShort.Length));
+        Assert.True(Helper.EqualArray<short>(arrShort, (int)short_Array_Size, expectedArrShort, expectedArrShort.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -134,11 +134,11 @@ public class ClientMarshalArrayAsSizeParamIndexByRefTest
         ushort[] arrUshort = Helper.InitArray<ushort>(ushort_Array_Size);
 
         int expected_UshortArraySize = ushort.MaxValue;
-        Assert.IsTrue(MarshalCStyleArrayUshort_AsByRef_AsSizeParamIndex(ref arrUshort, ref ushort_Array_Size));
+        Assert.True(MarshalCStyleArrayUshort_AsByRef_AsSizeParamIndex(ref arrUshort, ref ushort_Array_Size));
 
         //Construct Expected
         ushort[] expectedArrShort = Helper.GetExpChangeArray<ushort>(expected_UshortArraySize);
-        Assert.IsTrue(Helper.EqualArray<ushort>(arrUshort, (int)ushort_Array_Size, expectedArrShort, expectedArrShort.Length));
+        Assert.True(Helper.EqualArray<ushort>(arrUshort, (int)ushort_Array_Size, expectedArrShort, expectedArrShort.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -152,12 +152,12 @@ public class ClientMarshalArrayAsSizeParamIndexByRefTest
         Int32 Int32_Array_Size = (Int32)10;
         Int32[] arrInt32 = Helper.InitArray<Int32>(Int32_Array_Size);
 
-        Assert.IsTrue(MarshalCStyleArrayInt_AsByRef_AsSizeParamIndex(ref Int32_Array_Size, Int32.MaxValue, ref arrInt32));
+        Assert.True(MarshalCStyleArrayInt_AsByRef_AsSizeParamIndex(ref Int32_Array_Size, Int32.MaxValue, ref arrInt32));
 
         //Construct Expected
         int expected_UshortArraySize = 1;
         Int32[] expectedArrInt32 = Helper.GetExpChangeArray<Int32>(expected_UshortArraySize);
-        Assert.IsTrue(Helper.EqualArray<Int32>(arrInt32, Int32_Array_Size, expectedArrInt32, expectedArrInt32.Length));
+        Assert.True(Helper.EqualArray<Int32>(arrInt32, Int32_Array_Size, expectedArrInt32, expectedArrInt32.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -170,12 +170,12 @@ public class ClientMarshalArrayAsSizeParamIndexByRefTest
 
         UInt32 UInt32_Array_Size = (UInt32)1234;
         UInt32[] arrUInt32 = Helper.InitArray<UInt32>((Int32)UInt32_Array_Size);
-        Assert.IsTrue(MarshalCStyleArrayUInt_AsByRef_AsSizeParamIndex(ref arrUInt32, 1234, ref UInt32_Array_Size));
+        Assert.True(MarshalCStyleArrayUInt_AsByRef_AsSizeParamIndex(ref arrUInt32, 1234, ref UInt32_Array_Size));
 
         //Construct Expected
         int expected_UInt32ArraySize = 4321;
         UInt32[] expectedArrUInt32 = Helper.GetExpChangeArray<UInt32>(expected_UInt32ArraySize);
-        Assert.IsTrue(Helper.EqualArray<UInt32>(arrUInt32, (Int32)UInt32_Array_Size, expectedArrUInt32, (Int32)expectedArrUInt32.Length));
+        Assert.True(Helper.EqualArray<UInt32>(arrUInt32, (Int32)UInt32_Array_Size, expectedArrUInt32, (Int32)expectedArrUInt32.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -188,12 +188,12 @@ public class ClientMarshalArrayAsSizeParamIndexByRefTest
 
         long long_Array_Size = (long)10;
         long[] arrLong = Helper.InitArray<long>((Int32)long_Array_Size);
-        Assert.IsTrue(MarshalCStyleArrayLong_AsByRef_AsSizeParamIndex(ref long_Array_Size, ref arrLong));
+        Assert.True(MarshalCStyleArrayLong_AsByRef_AsSizeParamIndex(ref long_Array_Size, ref arrLong));
 
         //Construct Expected Array
         int expected_LongArraySize = 20;
         long[] expectedArrLong = Helper.GetExpChangeArray<long>(expected_LongArraySize);
-        Assert.IsTrue(Helper.EqualArray<long>(arrLong, (Int32)long_Array_Size, expectedArrLong, (Int32)expectedArrLong.Length));
+        Assert.True(Helper.EqualArray<long>(arrLong, (Int32)long_Array_Size, expectedArrLong, (Int32)expectedArrLong.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -207,12 +207,12 @@ public class ClientMarshalArrayAsSizeParamIndexByRefTest
         ulong ulong_Array_Size = (ulong)0;
         ulong[] arrUlong = Helper.InitArray<ulong>((Int32)ulong_Array_Size);
 
-        Assert.IsTrue(MarshalCStyleArrayUlong_AsByRef_AsSizeParamIndex(ref ulong_Array_Size, ref arrUlong));
+        Assert.True(MarshalCStyleArrayUlong_AsByRef_AsSizeParamIndex(ref ulong_Array_Size, ref arrUlong));
 
         //Construct Expected
         int expected_ULongArraySize = 0;
         ulong[] expectedArrUlong = Helper.GetExpChangeArray<ulong>(expected_ULongArraySize);
-        Assert.IsTrue(Helper.EqualArray<ulong>(arrUlong, (Int32)ulong_Array_Size, expectedArrUlong, (Int32)expectedArrUlong.Length));
+        Assert.True(Helper.EqualArray<ulong>(arrUlong, (Int32)ulong_Array_Size, expectedArrUlong, (Int32)expectedArrUlong.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
@@ -227,12 +227,12 @@ public class ClientMarshalArrayAsSizeParamIndexByRefTest
         String[] arrString = Helper.InitArray<String>(array_Size);
         String[] arrString2 = Helper.InitArray<String>(array_Size);
 
-        Assert.IsTrue(MarshalCStyleArrayString_AsByRef_AsSizeParamIndex(ref array_Size, ref arrString, ref arrString2));
+        Assert.True(MarshalCStyleArrayString_AsByRef_AsSizeParamIndex(ref array_Size, ref arrString, ref arrString2));
 
         //Construct Expected
         int expected_StringArraySize = 10;
         String[] expArrString = Helper.GetExpChangeArray<String>(expected_StringArraySize);
-        Assert.IsTrue(Helper.EqualArray<String>(arrString, array_Size, expArrString, expArrString.Length));
+        Assert.True(Helper.EqualArray<String>(arrString, array_Size, expArrString, expArrString.Length));
 
         Console.WriteLine(strDescription + " Ends!");
     }
index bf0c46c..bacac28 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class ReversePInvoke_MashalArrayByOut_AsManagedTest
 {
@@ -56,7 +56,7 @@ public class ReversePInvoke_MashalArrayByOut_AsManagedTest
     public delegate bool DelUlongArrByOutAsCdeclCaller([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] out ulong[] arrArg, out ulong arraySize);
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelStringArrByOutAsCdeclCaller([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, ArraySubType = UnmanagedType.BStr)] out string[] arrArg, out Int32 arraySize);
-    
+
     #endregion
 
     #region Test Method
@@ -149,45 +149,45 @@ public class ReversePInvoke_MashalArrayByOut_AsManagedTest
 
         //Common value type
         Console.WriteLine("\tScenario 1 : byte ==> BYTE, Array_Size = byte.MinValue, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalByteArray_AsParam_AsByOut(new DelByteArrByOutAsCdeclCaller(TestMethodForByteArray_AsReversePInvokeByOut_AsCdecl)));
+        Assert.True(DoCallBack_MarshalByteArray_AsParam_AsByOut(new DelByteArrByOutAsCdeclCaller(TestMethodForByteArray_AsReversePInvokeByOut_AsCdecl)));
         Console.WriteLine("\t\tMarshalByteArray_AsReversePInvokeByOut_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 2 : sbyte ==> CHAR, Array_Size = 1, Return_Array_Size = sbyte.Max");
-        Assert.IsTrue(DoCallBack_MarshalSbyteArray_AsParam_AsByOut(new DelSbyteArrByOutAsCdeclCaller(TestMethodForSbyteArray_AsReversePInvokeByOut_AsCdecl)));
+        Assert.True(DoCallBack_MarshalSbyteArray_AsParam_AsByOut(new DelSbyteArrByOutAsCdeclCaller(TestMethodForSbyteArray_AsReversePInvokeByOut_AsCdecl)));
         Console.WriteLine("\t\tMarshalSbyteArray_AsReversePInvokeByOut_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 3 : short ==> SHORT, Array_Size = -1, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalShortArray_AsParam_AsByOut(new DelShortArrByOutAsCdeclCaller(TestMethodForShortArray_AsReversePInvokeByOut_AsCdecl)));
+        Assert.True(DoCallBack_MarshalShortArray_AsParam_AsByOut(new DelShortArrByOutAsCdeclCaller(TestMethodForShortArray_AsReversePInvokeByOut_AsCdecl)));
         Console.WriteLine("\t\tMarshalShortArray_AsReversePInvokeByOut_AsCdecl Failed!");
 
         Console.WriteLine("\tScenario 4 : short ==> SHORT, Array_Size = 10, Return_Array_Size = -1");
-        Assert.IsTrue(DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByOut(new DelShortArrByOutAsCdeclCaller(TestMethodForShortArrayReturnNegativeSize_AsReversePInvokeByOut_AsCdecl)));
+        Assert.True(DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByOut(new DelShortArrByOutAsCdeclCaller(TestMethodForShortArrayReturnNegativeSize_AsReversePInvokeByOut_AsCdecl)));
         Console.WriteLine("\t\tMarshalShortArray_AsReversePInvokeByOut_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 5 : ushort ==> USHORT, Array_Size = ushort.MaxValue, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalUshortArray_AsParam_AsByOut(new DelUshortArrByOutAsCdeclCaller(TestMethodForUshortArray_AsReversePInvokeByOut_AsCdecl)));
+        Assert.True(DoCallBack_MarshalUshortArray_AsParam_AsByOut(new DelUshortArrByOutAsCdeclCaller(TestMethodForUshortArray_AsReversePInvokeByOut_AsCdecl)));
         Console.WriteLine("\t\tMarshalUshortArray_AsReversePInvokeByOut_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 6 : Int32 ==> LONG, Array_Size = 10, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalInt32Array_AsParam_AsByOut(new DelInt32ArrByOutAsCdeclCaller(TestMethodForInt32Array_AsReversePInvokeByOut_AsCdecl)));
+        Assert.True(DoCallBack_MarshalInt32Array_AsParam_AsByOut(new DelInt32ArrByOutAsCdeclCaller(TestMethodForInt32Array_AsReversePInvokeByOut_AsCdecl)));
         Console.WriteLine("\t\tMarshalInt32Array_AsReversePInvokeByOut_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 7 : UInt32 ==> ULONG, Array_Size = 10, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalUint32Array_AsParam_AsByOut(new DelUint32ArrByOutAsCdeclCaller(TestMethodForUint32Array_AsReversePInvokeByOut_AsCdecl)));
+        Assert.True(DoCallBack_MarshalUint32Array_AsParam_AsByOut(new DelUint32ArrByOutAsCdeclCaller(TestMethodForUint32Array_AsReversePInvokeByOut_AsCdecl)));
         Console.WriteLine("\t\tMarshalUint32Array_AsReversePInvokeByOut_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 8 : long ==> LONGLONG, Array_Size = 10, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalLongArray_AsParam_AsByOut(new DelLongArrByOutAsCdeclCaller(TestMethodForLongArray_AsReversePInvokeByOut_AsCdecl)));
+        Assert.True(DoCallBack_MarshalLongArray_AsParam_AsByOut(new DelLongArrByOutAsCdeclCaller(TestMethodForLongArray_AsReversePInvokeByOut_AsCdecl)));
         Console.WriteLine("\t\tMarshalLongArray_AsReversePInvokeByOut_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 9 : ulong ==> ULONGLONG, Array_Size = 10, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalUlongArray_AsParam_AsByOut(new DelUlongArrByOutAsCdeclCaller(TestMethodForUlongArray_AsReversePInvokeByOut_AsCdecl)));
+        Assert.True(DoCallBack_MarshalUlongArray_AsParam_AsByOut(new DelUlongArrByOutAsCdeclCaller(TestMethodForUlongArray_AsReversePInvokeByOut_AsCdecl)));
         Console.WriteLine("\t\tMarshalUlongArray_AsReversePInvokeByOut_AsCdecl Passed!");
 
         if (OperatingSystem.IsWindows())
         {
             Console.WriteLine("\tScenario 10 : string ==> BSTR, Array_Size = 10, Return_Array_Size = 20");
-            Assert.IsTrue(DoCallBack_MarshalStringArray_AsParam_AsByOut(new DelStringArrByOutAsCdeclCaller(TestMethodForStringArray_AsReversePInvokeByOut_AsCdecl)));
+            Assert.True(DoCallBack_MarshalStringArray_AsParam_AsByOut(new DelStringArrByOutAsCdeclCaller(TestMethodForStringArray_AsReversePInvokeByOut_AsCdecl)));
             Console.WriteLine("\t\tMarshalStringArray_AsReversePInvokeByOut_AsCdecl Passed!");
         }
     }
index 13b53e6..afe1b11 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class ReversePInvoke_MashalArrayByRef_AsManagedTest
 {
@@ -56,7 +56,7 @@ public class ReversePInvoke_MashalArrayByRef_AsManagedTest
     public delegate bool DelUlongArrByRefAsCdeclCaller([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ref ulong[] arrArg, ref ulong arraySize);
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelStringArrByRefAsCdeclCaller([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, ArraySubType = UnmanagedType.BStr)] ref string[] arrArg, ref Int32 arraySize);
-    
+
     #endregion
 
     #region Test Method
@@ -159,11 +159,11 @@ public class ReversePInvoke_MashalArrayByRef_AsManagedTest
 
         //Common value type
         Console.WriteLine("\tScenario 1 : byte ==> BYTE, Array_Size = byte.MinValue, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalByteArray_AsParam_AsByRef(new DelByteArrByRefAsCdeclCaller(TestMethodForByteArray_AsReversePInvokeByRef_AsCdecl)));
+        Assert.True(DoCallBack_MarshalByteArray_AsParam_AsByRef(new DelByteArrByRefAsCdeclCaller(TestMethodForByteArray_AsReversePInvokeByRef_AsCdecl)));
         Console.WriteLine("\t\tMarshalByteArray_AsReversePInvokeByRef_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 2 : sbyte ==> CHAR, Array_Size = 1, Return_Array_Size = sbyte.Max");
-        Assert.IsTrue(DoCallBack_MarshalSbyteArray_AsParam_AsByRef(new DelSbyteArrByRefAsCdeclCaller(TestMethodForSbyteArray_AsReversePInvokeByRef_AsCdecl)));
+        Assert.True(DoCallBack_MarshalSbyteArray_AsParam_AsByRef(new DelSbyteArrByRefAsCdeclCaller(TestMethodForSbyteArray_AsReversePInvokeByRef_AsCdecl)));
         Console.WriteLine("\t\tMarshalSbyteArray_AsReversePInvokeByRef_AsCdecl Passed!");
 
         // We don't support exception interop in .NET off-Windows.
@@ -176,33 +176,33 @@ public class ReversePInvoke_MashalArrayByRef_AsManagedTest
 
 
         Console.WriteLine("\tScenario 4 : short ==> SHORT, Array_Size = 10, Return_Array_Size = -1");
-        Assert.IsTrue(DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByRef(new DelShortArrByRefAsCdeclCaller(TestMethodForShortArrayReturnNegativeSize_AsReversePInvokeByRef_AsCdecl)));
+        Assert.True(DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByRef(new DelShortArrByRefAsCdeclCaller(TestMethodForShortArrayReturnNegativeSize_AsReversePInvokeByRef_AsCdecl)));
         Console.WriteLine("\t\tMarshalShortArray_AsReversePInvokeByRef_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 5 : ushort ==> USHORT, Array_Size = ushort.MaxValue, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalUshortArray_AsParam_AsByRef(new DelUshortArrByRefAsCdeclCaller(TestMethodForUshortArray_AsReversePInvokeByRef_AsCdecl)));
+        Assert.True(DoCallBack_MarshalUshortArray_AsParam_AsByRef(new DelUshortArrByRefAsCdeclCaller(TestMethodForUshortArray_AsReversePInvokeByRef_AsCdecl)));
         Console.WriteLine("\t\tMarshalUshortArray_AsReversePInvokeByRef_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 6 : Int32 ==> LONG, Array_Size = 10, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalInt32Array_AsParam_AsByRef(new DelInt32ArrByRefAsCdeclCaller(TestMethodForInt32Array_AsReversePInvokeByRef_AsCdecl)));
+        Assert.True(DoCallBack_MarshalInt32Array_AsParam_AsByRef(new DelInt32ArrByRefAsCdeclCaller(TestMethodForInt32Array_AsReversePInvokeByRef_AsCdecl)));
         Console.WriteLine("\t\tMarshalInt32Array_AsReversePInvokeByRef_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 7 : UInt32 ==> ULONG, Array_Size = 10, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalUint32Array_AsParam_AsByRef(new DelUint32ArrByRefAsCdeclCaller(TestMethodForUint32Array_AsReversePInvokeByRef_AsCdecl)));
+        Assert.True(DoCallBack_MarshalUint32Array_AsParam_AsByRef(new DelUint32ArrByRefAsCdeclCaller(TestMethodForUint32Array_AsReversePInvokeByRef_AsCdecl)));
         Console.WriteLine("\t\tMarshalUint32Array_AsReversePInvokeByRef_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 8 : long ==> LONGLONG, Array_Size = 10, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalLongArray_AsParam_AsByRef(new DelLongArrByRefAsCdeclCaller(TestMethodForLongArray_AsReversePInvokeByRef_AsCdecl)));
+        Assert.True(DoCallBack_MarshalLongArray_AsParam_AsByRef(new DelLongArrByRefAsCdeclCaller(TestMethodForLongArray_AsReversePInvokeByRef_AsCdecl)));
         Console.WriteLine("\t\tMarshalLongArray_AsReversePInvokeByRef_AsCdecl Passed!");
 
         Console.WriteLine("\tScenario 9 : ulong ==> ULONGLONG, Array_Size = 10, Return_Array_Size = 20");
-        Assert.IsTrue(DoCallBack_MarshalUlongArray_AsParam_AsByRef(new DelUlongArrByRefAsCdeclCaller(TestMethodForUlongArray_AsReversePInvokeByRef_AsCdecl)));
+        Assert.True(DoCallBack_MarshalUlongArray_AsParam_AsByRef(new DelUlongArrByRefAsCdeclCaller(TestMethodForUlongArray_AsReversePInvokeByRef_AsCdecl)));
         Console.WriteLine("\t\tMarshalUlongArray_AsReversePInvokeByRef_AsCdecl Passed!");
 
         if (OperatingSystem.IsWindows())
         {
             Console.WriteLine("\tScenario 10 : string ==> BSTR, Array_Size = 10, Return_Array_Size = 20");
-            Assert.IsTrue(DoCallBack_MarshalStringArray_AsParam_AsByRef(new DelStringArrByRefAsCdeclCaller(TestMethodForStringArray_AsReversePInvokeByRef_AsCdecl)));
+            Assert.True(DoCallBack_MarshalStringArray_AsParam_AsByRef(new DelStringArrByRefAsCdeclCaller(TestMethodForStringArray_AsReversePInvokeByRef_AsCdecl)));
             Console.WriteLine("\t\tMarshalStringArray_AsReversePInvokeByRef_AsCdecl Passed!");
         }
     }
index 1268ee8..cd96936 100644 (file)
@@ -6,7 +6,7 @@ using System.Security;
 using System.Collections.Generic;
 using System.Text;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 namespace PInvokeTests
 {
index e7ab505..76e980f 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 using static VariantNative;
 
 #pragma warning disable CS0612, CS0618
index a6f4531..bfbeace 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Collections;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 using static VariantNative;
 using ComTypes = System.Runtime.InteropServices.ComTypes;
 
index d56ab2d..26829d8 100644 (file)
@@ -3,7 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 using static VariantNative;
 
 // Class used to validate the IClassX generation path doesn't fail.
@@ -34,33 +34,33 @@ partial class Test_VariantTest
 
     private unsafe static void TestByValue(bool hasComSupport)
     {
-        Assert.IsTrue(Marshal_ByValue_Byte((byte)NumericValue, NumericValue));
-        Assert.IsTrue(Marshal_ByValue_SByte((sbyte)NumericValue, (sbyte)NumericValue));
-        Assert.IsTrue(Marshal_ByValue_Int16((short)NumericValue, NumericValue));
-        Assert.IsTrue(Marshal_ByValue_UInt16((ushort)NumericValue, NumericValue));
-        Assert.IsTrue(Marshal_ByValue_Int32((int)NumericValue, NumericValue));
-        Assert.IsTrue(Marshal_ByValue_UInt32((uint)NumericValue, NumericValue));
-        Assert.IsTrue(Marshal_ByValue_Int64((long)NumericValue, NumericValue));
-        Assert.IsTrue(Marshal_ByValue_UInt64((ulong)NumericValue, NumericValue));
-        Assert.IsTrue(Marshal_ByValue_Single((float)NumericValue, NumericValue));
-        Assert.IsTrue(Marshal_ByValue_Double((double)NumericValue, NumericValue));
-        Assert.IsTrue(Marshal_ByValue_String(StringValue, StringValue));
-        Assert.IsTrue(Marshal_ByValue_String(new BStrWrapper(null), null));
-        Assert.IsTrue(Marshal_ByValue_Char(CharValue, CharValue));
-        Assert.IsTrue(Marshal_ByValue_Boolean(true, true));
-        Assert.IsTrue(Marshal_ByValue_DateTime(DateValue, DateValue));
-        Assert.IsTrue(Marshal_ByValue_Decimal(DecimalValue, DecimalValue));
-        Assert.IsTrue(Marshal_ByValue_Currency(new CurrencyWrapper(DecimalValue), DecimalValue));
-        Assert.IsTrue(Marshal_ByValue_Null(DBNull.Value));
-        Assert.IsTrue(Marshal_ByValue_Missing(System.Reflection.Missing.Value));
-        Assert.IsTrue(Marshal_ByValue_Empty(null));
+        Assert.True(Marshal_ByValue_Byte((byte)NumericValue, NumericValue));
+        Assert.True(Marshal_ByValue_SByte((sbyte)NumericValue, (sbyte)NumericValue));
+        Assert.True(Marshal_ByValue_Int16((short)NumericValue, NumericValue));
+        Assert.True(Marshal_ByValue_UInt16((ushort)NumericValue, NumericValue));
+        Assert.True(Marshal_ByValue_Int32((int)NumericValue, NumericValue));
+        Assert.True(Marshal_ByValue_UInt32((uint)NumericValue, NumericValue));
+        Assert.True(Marshal_ByValue_Int64((long)NumericValue, NumericValue));
+        Assert.True(Marshal_ByValue_UInt64((ulong)NumericValue, NumericValue));
+        Assert.True(Marshal_ByValue_Single((float)NumericValue, NumericValue));
+        Assert.True(Marshal_ByValue_Double((double)NumericValue, NumericValue));
+        Assert.True(Marshal_ByValue_String(StringValue, StringValue));
+        Assert.True(Marshal_ByValue_String(new BStrWrapper(null), null));
+        Assert.True(Marshal_ByValue_Char(CharValue, CharValue));
+        Assert.True(Marshal_ByValue_Boolean(true, true));
+        Assert.True(Marshal_ByValue_DateTime(DateValue, DateValue));
+        Assert.True(Marshal_ByValue_Decimal(DecimalValue, DecimalValue));
+        Assert.True(Marshal_ByValue_Currency(new CurrencyWrapper(DecimalValue), DecimalValue));
+        Assert.True(Marshal_ByValue_Null(DBNull.Value));
+        Assert.True(Marshal_ByValue_Missing(System.Reflection.Missing.Value));
+        Assert.True(Marshal_ByValue_Empty(null));
 
         if (hasComSupport)
         {
-            Assert.IsTrue(Marshal_ByValue_Object(new object()));
-            Assert.IsTrue(Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new object())));
-            Assert.IsTrue(Marshal_ByValue_Object(new GenerateIClassX()));
-            Assert.IsTrue(Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new GenerateIClassX())));
+            Assert.True(Marshal_ByValue_Object(new object()));
+            Assert.True(Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new object())));
+            Assert.True(Marshal_ByValue_Object(new GenerateIClassX()));
+            Assert.True(Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new GenerateIClassX())));
         }
         else
         {
@@ -68,14 +68,12 @@ partial class Test_VariantTest
                     () =>
                     {
                         Marshal_ByValue_Object(new object());
-                    },
-                    "Built-in COM has been disabled via a feature switch");
+                    });
             Assert.Throws<NotSupportedException>(
                     () =>
                     {
                         Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new object()));
-                    },
-                    "Built-in COM has been disabled via a feature switch");
+                    });
         }
 
         Assert.Throws<ArgumentException>(() => Marshal_ByValue_Invalid(TimeSpan.Zero));
@@ -88,78 +86,78 @@ partial class Test_VariantTest
         object obj;
 
         obj = (byte)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_Byte(ref obj, NumericValue));
+        Assert.True(Marshal_ByRef_Byte(ref obj, NumericValue));
 
         obj = (sbyte)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_SByte(ref obj, (sbyte)NumericValue));
+        Assert.True(Marshal_ByRef_SByte(ref obj, (sbyte)NumericValue));
 
         obj = (short)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_Int16(ref obj, NumericValue));
+        Assert.True(Marshal_ByRef_Int16(ref obj, NumericValue));
 
         obj = (ushort)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_UInt16(ref obj, NumericValue));
+        Assert.True(Marshal_ByRef_UInt16(ref obj, NumericValue));
 
         obj = (int)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_Int32(ref obj, NumericValue));
+        Assert.True(Marshal_ByRef_Int32(ref obj, NumericValue));
 
         obj = (uint)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_UInt32(ref obj, NumericValue));
+        Assert.True(Marshal_ByRef_UInt32(ref obj, NumericValue));
 
         obj = (long)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_Int64(ref obj, NumericValue));
+        Assert.True(Marshal_ByRef_Int64(ref obj, NumericValue));
 
         obj = (ulong)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_UInt64(ref obj, NumericValue));
+        Assert.True(Marshal_ByRef_UInt64(ref obj, NumericValue));
 
         obj = (float)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_Single(ref obj, NumericValue));
+        Assert.True(Marshal_ByRef_Single(ref obj, NumericValue));
 
         obj = (double)NumericValue;
-        Assert.IsTrue(Marshal_ByRef_Double(ref obj, NumericValue));
+        Assert.True(Marshal_ByRef_Double(ref obj, NumericValue));
 
         obj = StringValue;
-        Assert.IsTrue(Marshal_ByRef_String(ref obj, StringValue));
+        Assert.True(Marshal_ByRef_String(ref obj, StringValue));
 
         obj = new BStrWrapper(null);
-        Assert.IsTrue(Marshal_ByRef_String(ref obj, null));
+        Assert.True(Marshal_ByRef_String(ref obj, null));
 
         obj = CharValue;
-        Assert.IsTrue(Marshal_ByRef_Char(ref obj, CharValue));
+        Assert.True(Marshal_ByRef_Char(ref obj, CharValue));
 
         obj = true;
-        Assert.IsTrue(Marshal_ByRef_Boolean(ref obj, true));
+        Assert.True(Marshal_ByRef_Boolean(ref obj, true));
 
         obj = DateValue;
-        Assert.IsTrue(Marshal_ByRef_DateTime(ref obj, DateValue));
+        Assert.True(Marshal_ByRef_DateTime(ref obj, DateValue));
 
         obj = DecimalValue;
-        Assert.IsTrue(Marshal_ByRef_Decimal(ref obj, DecimalValue));
+        Assert.True(Marshal_ByRef_Decimal(ref obj, DecimalValue));
 
         obj = new CurrencyWrapper(DecimalValue);
-        Assert.IsTrue(Marshal_ByRef_Currency(ref obj, DecimalValue));
+        Assert.True(Marshal_ByRef_Currency(ref obj, DecimalValue));
 
         obj = DBNull.Value;
-        Assert.IsTrue(Marshal_ByRef_Null(ref obj));
+        Assert.True(Marshal_ByRef_Null(ref obj));
 
         obj = System.Reflection.Missing.Value;
-        Assert.IsTrue(Marshal_ByRef_Missing(ref obj));
+        Assert.True(Marshal_ByRef_Missing(ref obj));
 
         obj = null;
-        Assert.IsTrue(Marshal_ByRef_Empty(ref obj));
+        Assert.True(Marshal_ByRef_Empty(ref obj));
 
         if (hasComSupport)
         {
             obj = new object();
-            Assert.IsTrue(Marshal_ByRef_Object(ref obj));
+            Assert.True(Marshal_ByRef_Object(ref obj));
 
             obj = new UnknownWrapper(new object());
-            Assert.IsTrue(Marshal_ByRef_Object_IUnknown(ref obj));
+            Assert.True(Marshal_ByRef_Object_IUnknown(ref obj));
 
             obj = new GenerateIClassX();
-            Assert.IsTrue(Marshal_ByRef_Object(ref obj));
+            Assert.True(Marshal_ByRef_Object(ref obj));
 
             obj = new UnknownWrapper(new GenerateIClassX());
-            Assert.IsTrue(Marshal_ByRef_Object_IUnknown(ref obj));
+            Assert.True(Marshal_ByRef_Object_IUnknown(ref obj));
         }
         else
         {
@@ -168,28 +166,26 @@ partial class Test_VariantTest
                     {
                         obj = new object();
                         Marshal_ByRef_Object(ref obj);
-                    },
-                    "Built-in COM has been disabled via a feature switch");
+                    });
             Assert.Throws<NotSupportedException>(
                     () =>
                     {
                         obj = new UnknownWrapper(new object());
                         Marshal_ByRef_Object_IUnknown(ref obj);
-                    },
-                    "Built-in COM has been disabled via a feature switch");
+                    });
         }
 
         obj = DecimalValue;
-        Assert.IsTrue(Marshal_ChangeVariantType(ref obj, NumericValue));
-        Assert.IsTrue(obj is int);
-        Assert.AreEqual(NumericValue, (int)obj);
+        Assert.True(Marshal_ChangeVariantType(ref obj, NumericValue));
+        Assert.True(obj is int);
+        Assert.Equal(NumericValue, (int)obj);
     }
 
     private unsafe static void TestOut()
     {
-        Assert.IsTrue(Marshal_Out(out object obj, NumericValue));
-        Assert.IsTrue(obj is int);
-        Assert.AreEqual(NumericValue, (int)obj);
+        Assert.True(Marshal_Out(out object obj, NumericValue));
+        Assert.True(obj is int);
+        Assert.Equal(NumericValue, (int)obj);
     }
 
     private unsafe static void TestFieldByValue(bool hasComSupport)
@@ -197,78 +193,78 @@ partial class Test_VariantTest
         ObjectWrapper wrapper = new ObjectWrapper();
 
         wrapper.value = (byte)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_Byte(wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByValue_Byte(wrapper, NumericValue));
 
         wrapper.value = (sbyte)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_SByte(wrapper, (sbyte)NumericValue));
+        Assert.True(Marshal_Struct_ByValue_SByte(wrapper, (sbyte)NumericValue));
 
         wrapper.value = (short)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_Int16(wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByValue_Int16(wrapper, NumericValue));
 
         wrapper.value = (ushort)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_UInt16(wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByValue_UInt16(wrapper, NumericValue));
 
         wrapper.value = (int)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_Int32(wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByValue_Int32(wrapper, NumericValue));
 
         wrapper.value = (uint)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_UInt32(wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByValue_UInt32(wrapper, NumericValue));
 
         wrapper.value = (long)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_Int64(wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByValue_Int64(wrapper, NumericValue));
 
         wrapper.value = (ulong)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_UInt64(wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByValue_UInt64(wrapper, NumericValue));
 
         wrapper.value = (float)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_Single(wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByValue_Single(wrapper, NumericValue));
 
         wrapper.value = (double)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_Double(wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByValue_Double(wrapper, NumericValue));
 
         wrapper.value = StringValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_String(wrapper, StringValue));
+        Assert.True(Marshal_Struct_ByValue_String(wrapper, StringValue));
 
         wrapper.value = new BStrWrapper(null);
-        Assert.IsTrue(Marshal_Struct_ByValue_String(wrapper, null));
+        Assert.True(Marshal_Struct_ByValue_String(wrapper, null));
 
         wrapper.value = CharValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_Char(wrapper, CharValue));
+        Assert.True(Marshal_Struct_ByValue_Char(wrapper, CharValue));
 
         wrapper.value = true;
-        Assert.IsTrue(Marshal_Struct_ByValue_Boolean(wrapper, true));
+        Assert.True(Marshal_Struct_ByValue_Boolean(wrapper, true));
 
         wrapper.value = DateValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_DateTime(wrapper, DateValue));
+        Assert.True(Marshal_Struct_ByValue_DateTime(wrapper, DateValue));
 
         wrapper.value = DecimalValue;
-        Assert.IsTrue(Marshal_Struct_ByValue_Decimal(wrapper, DecimalValue));
+        Assert.True(Marshal_Struct_ByValue_Decimal(wrapper, DecimalValue));
 
         wrapper.value = new CurrencyWrapper(DecimalValue);
-        Assert.IsTrue(Marshal_Struct_ByValue_Currency(wrapper, DecimalValue));
+        Assert.True(Marshal_Struct_ByValue_Currency(wrapper, DecimalValue));
 
         wrapper.value = DBNull.Value;
-        Assert.IsTrue(Marshal_Struct_ByValue_Null(wrapper));
+        Assert.True(Marshal_Struct_ByValue_Null(wrapper));
 
         wrapper.value = System.Reflection.Missing.Value;
-        Assert.IsTrue(Marshal_Struct_ByValue_Missing(wrapper));
+        Assert.True(Marshal_Struct_ByValue_Missing(wrapper));
 
         wrapper.value = null;
-        Assert.IsTrue(Marshal_Struct_ByValue_Empty(wrapper));
+        Assert.True(Marshal_Struct_ByValue_Empty(wrapper));
 
         if (hasComSupport)
         {
             wrapper.value = new object();
-            Assert.IsTrue(Marshal_Struct_ByValue_Object(wrapper));
+            Assert.True(Marshal_Struct_ByValue_Object(wrapper));
 
             wrapper.value = new UnknownWrapper(new object());
-            Assert.IsTrue(Marshal_Struct_ByValue_Object_IUnknown(wrapper));
+            Assert.True(Marshal_Struct_ByValue_Object_IUnknown(wrapper));
 
             wrapper.value = new GenerateIClassX();
-            Assert.IsTrue(Marshal_Struct_ByValue_Object(wrapper));
+            Assert.True(Marshal_Struct_ByValue_Object(wrapper));
 
             wrapper.value = new UnknownWrapper(new GenerateIClassX());
-            Assert.IsTrue(Marshal_Struct_ByValue_Object_IUnknown(wrapper));
+            Assert.True(Marshal_Struct_ByValue_Object_IUnknown(wrapper));
         }
         else
         {
@@ -277,15 +273,13 @@ partial class Test_VariantTest
                 {
                     wrapper.value = new object();
                     Marshal_Struct_ByValue_Object(wrapper);
-                },
-                "Built-in COM has been disabled via a feature switch");
+                });
             Assert.Throws<NotSupportedException>(
                 () =>
                 {
                     wrapper.value = new UnknownWrapper(new object());
                     Marshal_Struct_ByValue_Object_IUnknown(wrapper);
-                },
-                "Built-in COM has been disabled via a feature switch");
+                });
         }
     }
 
@@ -294,78 +288,78 @@ partial class Test_VariantTest
         ObjectWrapper wrapper = new ObjectWrapper();
 
         wrapper.value = (byte)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_Byte(ref wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByRef_Byte(ref wrapper, NumericValue));
 
         wrapper.value = (sbyte)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_SByte(ref wrapper, (sbyte)NumericValue));
+        Assert.True(Marshal_Struct_ByRef_SByte(ref wrapper, (sbyte)NumericValue));
 
         wrapper.value = (short)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_Int16(ref wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByRef_Int16(ref wrapper, NumericValue));
 
         wrapper.value = (ushort)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_UInt16(ref wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByRef_UInt16(ref wrapper, NumericValue));
 
         wrapper.value = (int)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_Int32(ref wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByRef_Int32(ref wrapper, NumericValue));
 
         wrapper.value = (uint)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_UInt32(ref wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByRef_UInt32(ref wrapper, NumericValue));
 
         wrapper.value = (long)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_Int64(ref wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByRef_Int64(ref wrapper, NumericValue));
 
         wrapper.value = (ulong)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_UInt64(ref wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByRef_UInt64(ref wrapper, NumericValue));
 
         wrapper.value = (float)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_Single(ref wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByRef_Single(ref wrapper, NumericValue));
 
         wrapper.value = (double)NumericValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_Double(ref wrapper, NumericValue));
+        Assert.True(Marshal_Struct_ByRef_Double(ref wrapper, NumericValue));
 
         wrapper.value = StringValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_String(ref wrapper, StringValue));
+        Assert.True(Marshal_Struct_ByRef_String(ref wrapper, StringValue));
 
         wrapper.value = new BStrWrapper(null);
-        Assert.IsTrue(Marshal_Struct_ByRef_String(ref wrapper, null));
+        Assert.True(Marshal_Struct_ByRef_String(ref wrapper, null));
 
         wrapper.value = CharValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_Char(ref wrapper, CharValue));
+        Assert.True(Marshal_Struct_ByRef_Char(ref wrapper, CharValue));
 
         wrapper.value = true;
-        Assert.IsTrue(Marshal_Struct_ByRef_Boolean(ref wrapper, true));
+        Assert.True(Marshal_Struct_ByRef_Boolean(ref wrapper, true));
 
         wrapper.value = DateValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_DateTime(ref wrapper, DateValue));
+        Assert.True(Marshal_Struct_ByRef_DateTime(ref wrapper, DateValue));
 
         wrapper.value = DecimalValue;
-        Assert.IsTrue(Marshal_Struct_ByRef_Decimal(ref wrapper, DecimalValue));
+        Assert.True(Marshal_Struct_ByRef_Decimal(ref wrapper, DecimalValue));
 
         wrapper.value = new CurrencyWrapper(DecimalValue);
-        Assert.IsTrue(Marshal_Struct_ByRef_Currency(ref wrapper, DecimalValue));
+        Assert.True(Marshal_Struct_ByRef_Currency(ref wrapper, DecimalValue));
 
         wrapper.value = DBNull.Value;
-        Assert.IsTrue(Marshal_Struct_ByRef_Null(ref wrapper));
+        Assert.True(Marshal_Struct_ByRef_Null(ref wrapper));
 
         wrapper.value = System.Reflection.Missing.Value;
-        Assert.IsTrue(Marshal_Struct_ByRef_Missing(ref wrapper));
+        Assert.True(Marshal_Struct_ByRef_Missing(ref wrapper));
 
         wrapper.value = null;
-        Assert.IsTrue(Marshal_Struct_ByRef_Empty(ref wrapper));
+        Assert.True(Marshal_Struct_ByRef_Empty(ref wrapper));
 
         if (hasComSupport)
         {
             wrapper.value = new object();
-            Assert.IsTrue(Marshal_Struct_ByRef_Object(ref wrapper));
+            Assert.True(Marshal_Struct_ByRef_Object(ref wrapper));
 
             wrapper.value = new UnknownWrapper(new object());
-            Assert.IsTrue(Marshal_Struct_ByRef_Object_IUnknown(ref wrapper));
+            Assert.True(Marshal_Struct_ByRef_Object_IUnknown(ref wrapper));
 
             wrapper.value = new GenerateIClassX();
-            Assert.IsTrue(Marshal_Struct_ByRef_Object(ref wrapper));
+            Assert.True(Marshal_Struct_ByRef_Object(ref wrapper));
 
             wrapper.value = new UnknownWrapper(new GenerateIClassX());
-            Assert.IsTrue(Marshal_Struct_ByRef_Object_IUnknown(ref wrapper));
+            Assert.True(Marshal_Struct_ByRef_Object_IUnknown(ref wrapper));
         }
         else
         {
@@ -374,15 +368,13 @@ partial class Test_VariantTest
                     {
                         wrapper.value = new object();
                         Marshal_Struct_ByRef_Object(ref wrapper);
-                    },
-                    "Built-in COM has been disabled via a feature switch");
+                    });
             Assert.Throws<NotSupportedException>(
                     () =>
                     {
                         wrapper.value = new UnknownWrapper(new object());
                         Marshal_Struct_ByRef_Object_IUnknown(ref wrapper);
-                    },
-                    "Built-in COM has been disabled via a feature switch");
+                    });
         }
     }
 }
index 3afc831..d7cedae 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Numerics;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class Vector2_3_4Test
 {
@@ -43,28 +43,28 @@ public class Vector2_3_4Test
         Vector2 startingVector = new Vector2(X, Y);
         Vector2 newVector = new Vector2(XNew, YNew);
 
-        Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateVector2FromFloats(X, Y));
+        Assert.Equal(startingVector, Vector2_3_4TestNative.CreateVector2FromFloats(X, Y));
 
-        Assert.IsTrue(Vector2_3_4TestNative.Vector2EqualToFloats(startingVector, X, Y));
+        Assert.True(Vector2_3_4TestNative.Vector2EqualToFloats(startingVector, X, Y));
 
         Vector2 localVector = startingVector;
-        Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeVector2(ref localVector, X, Y, XNew, YNew));
-        Assert.AreEqual(newVector, localVector);
+        Assert.True(Vector2_3_4TestNative.ValidateAndChangeVector2(ref localVector, X, Y, XNew, YNew));
+        Assert.Equal(newVector, localVector);
 
         Vector2_3_4TestNative.GetVector2ForFloats(X, Y, out var vec);
-        Assert.AreEqual(startingVector, vec);
-        
-        Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateWrappedVector2FromFloats(X, Y).vec);
+        Assert.Equal(startingVector, vec);
 
-        Assert.IsTrue(Vector2_3_4TestNative.WrappedVector2EqualToFloats(new Vector2_3_4TestNative.Vector2Wrapper { vec = startingVector }, X, Y));
+        Assert.Equal(startingVector, Vector2_3_4TestNative.CreateWrappedVector2FromFloats(X, Y).vec);
+
+        Assert.True(Vector2_3_4TestNative.WrappedVector2EqualToFloats(new Vector2_3_4TestNative.Vector2Wrapper { vec = startingVector }, X, Y));
 
         var localVectorWrapper = new Vector2_3_4TestNative.Vector2Wrapper { vec = startingVector };
-        Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeWrappedVector2(ref localVectorWrapper, X, Y, XNew, YNew));
-        Assert.AreEqual(newVector, localVectorWrapper.vec);
+        Assert.True(Vector2_3_4TestNative.ValidateAndChangeWrappedVector2(ref localVectorWrapper, X, Y, XNew, YNew));
+        Assert.Equal(newVector, localVectorWrapper.vec);
 
-        Assert.AreEqual(newVector, Vector2_3_4TestNative.PassThroughVector2ToCallback(startingVector, vectorParam => 
+        Assert.Equal(newVector, Vector2_3_4TestNative.PassThroughVector2ToCallback(startingVector, vectorParam =>
         {
-            Assert.AreEqual(startingVector, vectorParam);
+            Assert.Equal(startingVector, vectorParam);
             return newVector;
         }));
     }
@@ -85,28 +85,28 @@ public class Vector2_3_4Test
         Vector3 startingVector = new Vector3(X, Y, Z);
         Vector3 newVector = new Vector3(XNew, YNew, ZNew);
 
-        Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateVector3FromFloats(X, Y, Z));
+        Assert.Equal(startingVector, Vector2_3_4TestNative.CreateVector3FromFloats(X, Y, Z));
 
-        Assert.IsTrue(Vector2_3_4TestNative.Vector3EqualToFloats(startingVector, X, Y, Z));
+        Assert.True(Vector2_3_4TestNative.Vector3EqualToFloats(startingVector, X, Y, Z));
 
         Vector3 localVector = startingVector;
-        Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeVector3(ref localVector, X, Y, Z, XNew, YNew, ZNew));
-        Assert.AreEqual(newVector, localVector);
+        Assert.True(Vector2_3_4TestNative.ValidateAndChangeVector3(ref localVector, X, Y, Z, XNew, YNew, ZNew));
+        Assert.Equal(newVector, localVector);
 
         Vector2_3_4TestNative.GetVector3ForFloats(X, Y, Z, out var vec);
-        Assert.AreEqual(startingVector, vec);
-        
-        Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateWrappedVector3FromFloats(X, Y, Z).vec);
+        Assert.Equal(startingVector, vec);
+
+        Assert.Equal(startingVector, Vector2_3_4TestNative.CreateWrappedVector3FromFloats(X, Y, Z).vec);
 
-        Assert.IsTrue(Vector2_3_4TestNative.WrappedVector3EqualToFloats(new Vector2_3_4TestNative.Vector3Wrapper { vec = startingVector }, X, Y, Z));
+        Assert.True(Vector2_3_4TestNative.WrappedVector3EqualToFloats(new Vector2_3_4TestNative.Vector3Wrapper { vec = startingVector }, X, Y, Z));
 
         var localVectorWrapper = new Vector2_3_4TestNative.Vector3Wrapper { vec = startingVector };
-        Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeWrappedVector3(ref localVectorWrapper, X, Y, Z, XNew, YNew, ZNew));
-        Assert.AreEqual(newVector, localVectorWrapper.vec);
+        Assert.True(Vector2_3_4TestNative.ValidateAndChangeWrappedVector3(ref localVectorWrapper, X, Y, Z, XNew, YNew, ZNew));
+        Assert.Equal(newVector, localVectorWrapper.vec);
 
-        Assert.AreEqual(newVector, Vector2_3_4TestNative.PassThroughVector3ToCallback(startingVector, vectorParam => 
+        Assert.Equal(newVector, Vector2_3_4TestNative.PassThroughVector3ToCallback(startingVector, vectorParam =>
         {
-            Assert.AreEqual(startingVector, vectorParam);
+            Assert.Equal(startingVector, vectorParam);
             return newVector;
         }));
     }
@@ -127,28 +127,28 @@ public class Vector2_3_4Test
         Vector4 startingVector = new Vector4(X, Y, Z, W);
         Vector4 newVector = new Vector4(XNew, YNew, ZNew, WNew);
 
-        Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateVector4FromFloats(X, Y, Z, W));
+        Assert.Equal(startingVector, Vector2_3_4TestNative.CreateVector4FromFloats(X, Y, Z, W));
 
-        Assert.IsTrue(Vector2_3_4TestNative.Vector4EqualToFloats(startingVector, X, Y, Z, W));
+        Assert.True(Vector2_3_4TestNative.Vector4EqualToFloats(startingVector, X, Y, Z, W));
 
         Vector4 localVector = startingVector;
-        Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeVector4(ref localVector, X, Y, Z, W, XNew, YNew, ZNew, WNew));
-        Assert.AreEqual(newVector, localVector);
+        Assert.True(Vector2_3_4TestNative.ValidateAndChangeVector4(ref localVector, X, Y, Z, W, XNew, YNew, ZNew, WNew));
+        Assert.Equal(newVector, localVector);
 
         Vector2_3_4TestNative.GetVector4ForFloats(X, Y, Z, W, out var vec);
-        Assert.AreEqual(startingVector, vec);
-        
-        Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateWrappedVector4FromFloats(X, Y, Z, W).vec);
+        Assert.Equal(startingVector, vec);
+
+        Assert.Equal(startingVector, Vector2_3_4TestNative.CreateWrappedVector4FromFloats(X, Y, Z, W).vec);
 
-        Assert.IsTrue(Vector2_3_4TestNative.WrappedVector4EqualToFloats(new Vector2_3_4TestNative.Vector4Wrapper { vec = startingVector }, X, Y, Z, W));
+        Assert.True(Vector2_3_4TestNative.WrappedVector4EqualToFloats(new Vector2_3_4TestNative.Vector4Wrapper { vec = startingVector }, X, Y, Z, W));
 
         var localVectorWrapper = new Vector2_3_4TestNative.Vector4Wrapper { vec = startingVector };
-        Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeWrappedVector4(ref localVectorWrapper, X, Y, Z, W, XNew, YNew, ZNew, WNew));
-        Assert.AreEqual(newVector, localVectorWrapper.vec);
+        Assert.True(Vector2_3_4TestNative.ValidateAndChangeWrappedVector4(ref localVectorWrapper, X, Y, Z, W, XNew, YNew, ZNew, WNew));
+        Assert.Equal(newVector, localVectorWrapper.vec);
 
-        Assert.AreEqual(newVector, Vector2_3_4TestNative.PassThroughVector4ToCallback(startingVector, vectorParam => 
+        Assert.Equal(newVector, Vector2_3_4TestNative.PassThroughVector4ToCallback(startingVector, vectorParam =>
         {
-            Assert.AreEqual(startingVector, vectorParam);
+            Assert.Equal(startingVector, vectorParam);
             return newVector;
         }));
     }
index 06e18ad..9fef580 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 
 class Test
 {
@@ -35,27 +35,27 @@ class Test
         UIntPtr uintPtrReturn = (UIntPtr)3000;
 
         UIntPtr uintPtr1 = uintPtrManaged;
-        Assert.AreEqual(uintPtrReturn, Marshal_In(uintPtr1), "The return value is wrong");
+        Assert.Equal(uintPtrReturn, Marshal_In(uintPtr1));
 
         UIntPtr uintPtr2 = uintPtrManaged;
-        Assert.AreEqual(uintPtrReturn, Marshal_InOut(uintPtr2), "The return value is wrong");
-        Assert.AreEqual(uintPtrManaged, uintPtr2, "The parameter value is changed");
+        Assert.Equal(uintPtrReturn, Marshal_InOut(uintPtr2));
+        Assert.Equal(uintPtrManaged, uintPtr2);
 
         UIntPtr uintPtr3 = uintPtrManaged;
-        Assert.AreEqual(uintPtrReturn, Marshal_Out(uintPtr3), "The return value is wrong");
-        Assert.AreEqual(uintPtrManaged, uintPtr3, "The parameter value is changed");
+        Assert.Equal(uintPtrReturn, Marshal_Out(uintPtr3));
+        Assert.Equal(uintPtrManaged, uintPtr3);
 
         UIntPtr uintPtr4 = uintPtrManaged;
-        Assert.AreEqual(uintPtrReturn, MarshalPointer_In(ref uintPtr4), "The return value is wrong");
-        Assert.AreEqual(uintPtrManaged, uintPtr4, "The parameter value is changed");
+        Assert.Equal(uintPtrReturn, MarshalPointer_In(ref uintPtr4));
+        Assert.Equal(uintPtrManaged, uintPtr4);
 
         UIntPtr uintPtr5 = uintPtrManaged;
-        Assert.AreEqual(uintPtrReturn, MarshalPointer_InOut(ref uintPtr5), "The return value is wrong");
-        Assert.AreEqual(uintPtrNative, uintPtr5, "The passed value is wrong");
+        Assert.Equal(uintPtrReturn, MarshalPointer_InOut(ref uintPtr5));
+        Assert.Equal(uintPtrNative, uintPtr5);
 
         UIntPtr uintPtr6 = uintPtrManaged;
-        Assert.AreEqual(uintPtrReturn, MarshalPointer_Out(out uintPtr6), "The return value is wrong");
-        Assert.AreEqual(uintPtrNative, uintPtr6, "The passed value is wrong");
+        Assert.Equal(uintPtrReturn, MarshalPointer_Out(out uintPtr6));
+        Assert.Equal(uintPtrNative, uintPtr6);
 
         return 100;
     }
index cb73505..7b7917a 100644 (file)
@@ -10,7 +10,7 @@ There should be no more than **1** project type per folder (i.e. a folder can co
 
 Ancillary source assets for all tests should be located in `Interop/common` and can be easily added to all managed tests via the `Interop.settings.targets` file or native tests via `Interop.cmake`.
 
-A common pattern for testing is using the `Assert` utilities. This class is part of the `CoreCLRTestLibrary` which is included in all test projects by the `Interop.settings.targets` import. In order to use, add the following `using TestLibrary;` in the relevant test file.
+A common pattern for testing is using xUnit's `Assert` utilities. These utilities can be referenced via `CoreCLRTestLibrary` which is included in all test projects by `Directory.Build.targets` in this directory. In order to use, add the following `using Xunit;` in the relevant test file.
 
 ### Managed
 
index bc3e8da..83b4745 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 
 class AnsiBStrTest
 {
index 6d62634..3888d64 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 
 class BStrTest
 {
index f44f353..69939dd 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 
 using static StringMarshalingTestNative;
 
@@ -28,44 +28,44 @@ class CommonStringTests
 
     private static void RunStringTests()
     {
-        Assert.IsTrue(MatchFunctionName(nameof(MatchFunctionName)));
+        Assert.True(MatchFunctionName(nameof(MatchFunctionName)));
         {
             string funcNameLocal = nameof(MatchFunctionNameByRef);
-            Assert.IsTrue(MatchFunctionNameByRef(ref funcNameLocal));
+            Assert.True(MatchFunctionNameByRef(ref funcNameLocal));
         }
 
         {
             string reversed = InitialString;
             ReverseInplaceByref(ref reversed);
-            Assert.AreEqual(Helpers.Reverse(InitialString), reversed);
+            Assert.Equal(Helpers.Reverse(InitialString), reversed);
         }
 
         {
             Reverse(InitialString, out string reversed);
-            Assert.AreEqual(Helpers.Reverse(InitialString), reversed);
+            Assert.Equal(Helpers.Reverse(InitialString), reversed);
         }
 
-        Assert.AreEqual(Helpers.Reverse(InitialString), ReverseAndReturn(InitialString));
+        Assert.Equal(Helpers.Reverse(InitialString), ReverseAndReturn(InitialString));
 
-        Assert.IsTrue(VerifyReversed(InitialString, (orig, rev) => rev == Helpers.Reverse(orig)));
+        Assert.True(VerifyReversed(InitialString, (orig, rev) => rev == Helpers.Reverse(orig)));
 
-        Assert.IsTrue(ReverseInCallback(InitialString, (string str, out string rev) => rev = Helpers.Reverse(InitialString)));
+        Assert.True(ReverseInCallback(InitialString, (string str, out string rev) => rev = Helpers.Reverse(InitialString)));
 
-        Assert.IsTrue(ReverseInCallbackReturned(InitialString, str => Helpers.Reverse(str)));
+        Assert.True(ReverseInCallbackReturned(InitialString, str => Helpers.Reverse(str)));
     }
 
     private static void RunStringBuilderTests()
     {
         var builder = new StringBuilder(InitialString);
         ReverseInplace(builder);
-        Assert.AreEqual(Helpers.Reverse(InitialString), builder.ToString());
+        Assert.Equal(Helpers.Reverse(InitialString), builder.ToString());
 
         builder = new StringBuilder(InitialString);
         ReverseInplaceByref(ref builder);
-        Assert.AreEqual(Helpers.Reverse(InitialString), builder.ToString());
+        Assert.Equal(Helpers.Reverse(InitialString), builder.ToString());
 
         builder = new StringBuilder(InitialString);
-        Assert.IsTrue(ReverseInplaceInCallback(builder, b =>
+        Assert.True(ReverseInplaceInCallback(builder, b =>
         {
             string reversed = Helpers.Reverse(b.ToString());
             b.Clear();
@@ -75,7 +75,7 @@ class CommonStringTests
 
     private static void RunStructTests()
     {
-        Assert.IsTrue(MatchFunctionNameInStruct(new StringInStruct { str = nameof(MatchFunctionNameInStruct)}));
+        Assert.True(MatchFunctionNameInStruct(new StringInStruct { str = nameof(MatchFunctionNameInStruct)}));
 
         var str = new StringInStruct
         {
@@ -84,6 +84,6 @@ class CommonStringTests
 
         ReverseInplaceByrefInStruct(ref str);
 
-        Assert.AreEqual(Helpers.Reverse(InitialString), str.str);
+        Assert.Equal(Helpers.Reverse(InitialString), str.str);
     }
 }
index c3e4678..75d78b1 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 
 class LPStrTest
 {
index 5405443..08dec90 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 
 using static LPTStrTestNative;
 
@@ -35,13 +35,13 @@ class LPTStrTest
     {
         int length = 10;
         StringBuilder nullTerminatorBuilder = new StringBuilder(length);
-        Assert.IsTrue(Verify_NullTerminators_PastEnd(nullTerminatorBuilder, length));
-        Assert.IsTrue(Verify_NullTerminators_PastEnd_Out(nullTerminatorBuilder, length));
+        Assert.True(Verify_NullTerminators_PastEnd(nullTerminatorBuilder, length));
+        Assert.True(Verify_NullTerminators_PastEnd_Out(nullTerminatorBuilder, length));
     }
 
     private static void RunByValTStrTests()
     {
-        Assert.IsTrue(MatchFuncNameAnsi(new ByValStringInStructAnsi { str = nameof(MatchFuncNameAnsi)}));
+        Assert.True(MatchFuncNameAnsi(new ByValStringInStructAnsi { str = nameof(MatchFuncNameAnsi)}));
 
         var ansiStr = new ByValStringInStructAnsi
         {
@@ -50,9 +50,9 @@ class LPTStrTest
 
         ReverseByValStringAnsi(ref ansiStr);
 
-        Assert.AreEqual(Helpers.Reverse(InitialString), ansiStr.str);
+        Assert.Equal(Helpers.Reverse(InitialString), ansiStr.str);
 
-        Assert.IsTrue(MatchFuncNameUni(new ByValStringInStructUnicode { str = nameof(MatchFuncNameUni)}));
+        Assert.True(MatchFuncNameUni(new ByValStringInStructUnicode { str = nameof(MatchFuncNameUni)}));
 
         var uniStr = new ByValStringInStructUnicode
         {
@@ -60,21 +60,21 @@ class LPTStrTest
         };
 
         ReverseByValStringUni(ref uniStr);
-        Assert.AreEqual(Helpers.Reverse(InitialString), uniStr.str);
+        Assert.Equal(Helpers.Reverse(InitialString), uniStr.str);
 
         ReverseCopyByValStringAnsi(new ByValStringInStructAnsi { str = LongString }, out ByValStringInStructSplitAnsi ansiStrSplit);
 
-        Assert.AreEqual(Helpers.Reverse(LongString[^10..]), ansiStrSplit.str1);
-        Assert.AreEqual(Helpers.Reverse(LongString[..^10]), ansiStrSplit.str2);
+        Assert.Equal(Helpers.Reverse(LongString[^10..]), ansiStrSplit.str1);
+        Assert.Equal(Helpers.Reverse(LongString[..^10]), ansiStrSplit.str2);
 
         ReverseCopyByValStringUni(new ByValStringInStructUnicode { str = LongString }, out ByValStringInStructSplitUnicode uniStrSplit);
 
-        Assert.AreEqual(Helpers.Reverse(LongString[^10..]), uniStrSplit.str1);
-        Assert.AreEqual(Helpers.Reverse(LongString[..^10]), uniStrSplit.str2);
+        Assert.Equal(Helpers.Reverse(LongString[^10..]), uniStrSplit.str1);
+        Assert.Equal(Helpers.Reverse(LongString[..^10]), uniStrSplit.str2);
 
         ReverseCopyByValStringUni(new ByValStringInStructUnicode { str = LongUnicodeString }, out ByValStringInStructSplitUnicode uniStrSplit2);
 
-        Assert.AreEqual(Helpers.Reverse(LongUnicodeString[^10..]), uniStrSplit2.str1);
-        Assert.AreEqual(Helpers.Reverse(LongUnicodeString[..^10]), uniStrSplit2.str2);
+        Assert.Equal(Helpers.Reverse(LongUnicodeString[^10..]), uniStrSplit2.str1);
+        Assert.Equal(Helpers.Reverse(LongUnicodeString[..^10]), uniStrSplit2.str2);
     }
 }
index 1ae0b76..54c7e1b 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 
 #pragma warning disable CS0612, CS0618
 
@@ -21,12 +21,12 @@ class Test
             string newValue = "zyxwvut\0";
 
             actual = expected;
-            Assert.IsTrue(VBByRefStrNative.Marshal_Ansi(expected, ref actual, newValue));
-            Assert.AreEqual(newValue, actual);
+            Assert.True(VBByRefStrNative.Marshal_Ansi(expected, ref actual, newValue));
+            Assert.Equal(newValue, actual);
 
             actual = expected;
-            Assert.IsTrue(VBByRefStrNative.Marshal_Unicode(expected, ref actual, newValue));
-            Assert.AreEqual(newValue, actual);
+            Assert.True(VBByRefStrNative.Marshal_Unicode(expected, ref actual, newValue));
+            Assert.Equal(newValue, actual);
 
             StringBuilder builder = new StringBuilder();
 
index 8338a54..0411177 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Text;
 using System.Security;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class Test_DelegatePInvokeTest
 {
@@ -34,56 +34,56 @@ public class Test_DelegatePInvokeTest
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByRef_INNER2 Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByRef_InnerExplicit([In, Out]ref InnerExplicit ie);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByRef_InnerExplicit Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByRef_InnerArrayExplicit([In, Out]ref InnerArrayExplicit iae);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByRef_InnerArrayExplicit Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByRef_OUTER3([In, Out]ref OUTER3 outer);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByRef_OUTER3 Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByRef_U([In, Out]ref U u);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByRef_U Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByRef_ByteStructPack2Explicit([In, Out]ref ByteStructPack2Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByRef_ByteStructPack2Explicit Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByRef_ShortStructPack4Explicit([In, Out]ref ShortStructPack4Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByRef_ShortStructPack4Explicit Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByRef_IntStructPack8Explicit([In, Out]ref IntStructPack8Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByRef_IntStructPack8Explicit Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByRef_LongStructPack16Explicit([In, Out]ref LongStructPack16Explicit bspe);
 
@@ -101,8 +101,8 @@ public class Test_DelegatePInvokeTest
                 INNER2 changeINNER2 = Helper.NewINNER2(77, 77.0F, "changed string");
                 DelegateCdeclByRef_INNER2 caller_INNER2 = Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_INNER2(ref sourceINNER2));
-                Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, changeINNER2, "Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr"));
+                Assert.True(caller_INNER2(ref sourceINNER2));
+                Assert.True(Helper.ValidateINNER2(sourceINNER2, changeINNER2, "Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr"));
                 break;
 
             case StructID.InnerExplicitId:
@@ -114,8 +114,8 @@ public class Test_DelegatePInvokeTest
                 changeInnerExplicit.f3 = "changed string";
                 DelegateCdeclByRef_InnerExplicit caller_InnerExplicit = Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_InnerExplicit(ref sourceInnerExplicit));
-                Assert.IsTrue(Helper.ValidateInnerExplicit(sourceInnerExplicit, changeInnerExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr"));
+                Assert.True(caller_InnerExplicit(ref sourceInnerExplicit));
+                Assert.True(Helper.ValidateInnerExplicit(sourceInnerExplicit, changeInnerExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.InnerArrayExplicitId:
@@ -123,8 +123,8 @@ public class Test_DelegatePInvokeTest
                 InnerArrayExplicit changeInnerArrayExplicit = Helper.NewInnerArrayExplicit(77, 77.0F, "change string1", "change string2");
                 DelegateCdeclByRef_InnerArrayExplicit caller_InnerArrayExplicit = Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_InnerArrayExplicit(ref sourceInnerArrayExplicit));
-                Assert.IsTrue(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, changeInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr"));
+                Assert.True(caller_InnerArrayExplicit(ref sourceInnerArrayExplicit));
+                Assert.True(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, changeInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.OUTER3Id:
@@ -132,19 +132,19 @@ public class Test_DelegatePInvokeTest
                 OUTER3 changeOUTER3 = Helper.NewOUTER3(77, 77.0F, "changed string", "changed string");
                 DelegateCdeclByRef_OUTER3 caller_OUTER3 = Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_OUTER3(ref sourceOUTER3));
-                Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, changeOUTER3, "Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr"));
+                Assert.True(caller_OUTER3(ref sourceOUTER3));
+                Assert.True(Helper.ValidateOUTER3(sourceOUTER3, changeOUTER3, "Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr"));
                 break;
 
             case StructID.UId:
-                U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, 
+                U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue,
                     byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2);
-                U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, 
+                U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue,
                     byte.MaxValue, sbyte.MinValue, long.MaxValue, ulong.MinValue, 64.0F, 6.4);
                 DelegateCdeclByRef_U caller_U = Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_U(ref sourceU));
-                Assert.IsTrue(Helper.ValidateU(sourceU, changeU, "Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr"));
+                Assert.True(caller_U(ref sourceU));
+                Assert.True(Helper.ValidateU(sourceU, changeU, "Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr"));
                 break;
 
             case StructID.ByteStructPack2ExplicitId:
@@ -152,8 +152,8 @@ public class Test_DelegatePInvokeTest
                 ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64);
                 DelegateCdeclByRef_ByteStructPack2Explicit caller_ByteStructPack2Explicit = Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_ByteStructPack2Explicit(ref source_bspe));
-                Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(source_bspe, change_bspe, "Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr"));
+                Assert.True(caller_ByteStructPack2Explicit(ref source_bspe));
+                Assert.True(Helper.ValidateByteStructPack2Explicit(source_bspe, change_bspe, "Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.ShortStructPack4ExplicitId:
@@ -161,8 +161,8 @@ public class Test_DelegatePInvokeTest
                 ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64);
                 DelegateCdeclByRef_ShortStructPack4Explicit caller_ShortStructPack4Explicit = Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_ShortStructPack4Explicit(ref source_sspe));
-                Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(source_sspe, change_sspe, "Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr"));
+                Assert.True(caller_ShortStructPack4Explicit(ref source_sspe));
+                Assert.True(Helper.ValidateShortStructPack4Explicit(source_sspe, change_sspe, "Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.IntStructPack8ExplicitId:
@@ -170,8 +170,8 @@ public class Test_DelegatePInvokeTest
                 IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(64, 64);
                 DelegateCdeclByRef_IntStructPack8Explicit caller_IntStructPack8Explicit = Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_IntStructPack8Explicit(ref source_ispe));
-                Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(source_ispe, change_ispe, "Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr"));
+                Assert.True(caller_IntStructPack8Explicit(ref source_ispe));
+                Assert.True(Helper.ValidateIntStructPack8Explicit(source_ispe, change_ispe, "Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.LongStructPack16ExplicitId:
@@ -179,12 +179,12 @@ public class Test_DelegatePInvokeTest
                 LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(64, 64);
                 DelegateCdeclByRef_LongStructPack16Explicit caller_LongStructPack16Explicit = Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_LongStructPack16Explicit(ref source_lspe));
-                Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(source_lspe, change_lspe, "Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Cdecl_FuncPtr"));
+                Assert.True(caller_LongStructPack16Explicit(ref source_lspe));
+                Assert.True(Helper.ValidateLongStructPack16Explicit(source_lspe, change_lspe, "Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Cdecl_FuncPtr"));
                 break;
 
             default:
-                Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong");
+                Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -199,56 +199,56 @@ public class Test_DelegatePInvokeTest
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByRef_INNER2 Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByRef_InnerExplicit([In, Out]ref InnerExplicit ie);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByRef_InnerExplicit Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByRef_InnerArrayExplicit([In, Out]ref InnerArrayExplicit iae);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByRef_InnerArrayExplicit Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByRef_OUTER3([In, Out]ref OUTER3 outer);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByRef_OUTER3 Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByRef_U([In, Out]ref U u);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByRef_U Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByRef_ByteStructPack2Explicit([In, Out]ref ByteStructPack2Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByRef_ByteStructPack2Explicit Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByRef_ShortStructPack4Explicit([In, Out]ref ShortStructPack4Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByRef_ShortStructPack4Explicit Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByRef_IntStructPack8Explicit([In, Out]ref IntStructPack8Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByRef_IntStructPack8Explicit Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByRef_LongStructPack16Explicit([In, Out]ref LongStructPack16Explicit bspe);
 
@@ -266,8 +266,8 @@ public class Test_DelegatePInvokeTest
                 INNER2 changeINNER2 = Helper.NewINNER2(77, 77.0F, "changed string");
                 DelegateStdcallByRef_INNER2 caller_INNER2 = Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_INNER2(ref sourceINNER2));
-                Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, changeINNER2, "Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr"));
+                Assert.True(caller_INNER2(ref sourceINNER2));
+                Assert.True(Helper.ValidateINNER2(sourceINNER2, changeINNER2, "Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr"));
                 break;
 
             case StructID.InnerExplicitId:
@@ -279,8 +279,8 @@ public class Test_DelegatePInvokeTest
                 changeInnerExplicit.f3 = "changed string";
                 DelegateStdcallByRef_InnerExplicit caller_InnerExplicit = Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_InnerExplicit(ref sourceInnerExplicit));
-                Assert.IsTrue(Helper.ValidateInnerExplicit(sourceInnerExplicit, changeInnerExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr"));
+                Assert.True(caller_InnerExplicit(ref sourceInnerExplicit));
+                Assert.True(Helper.ValidateInnerExplicit(sourceInnerExplicit, changeInnerExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.InnerArrayExplicitId:
@@ -288,8 +288,8 @@ public class Test_DelegatePInvokeTest
                 InnerArrayExplicit changeInnerArrayExplicit = Helper.NewInnerArrayExplicit(77, 77.0F, "change string1", "change string2");
                 DelegateStdcallByRef_InnerArrayExplicit caller_InnerArrayExplicit = Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_InnerArrayExplicit(ref sourceInnerArrayExplicit));
-                Assert.IsTrue(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, changeInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr"));
+                Assert.True(caller_InnerArrayExplicit(ref sourceInnerArrayExplicit));
+                Assert.True(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, changeInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.OUTER3Id:
@@ -297,19 +297,19 @@ public class Test_DelegatePInvokeTest
                 OUTER3 changeOUTER3 = Helper.NewOUTER3(77, 77.0F, "changed string", "changed string");
                 DelegateStdcallByRef_OUTER3 caller_OUTER3 = Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_OUTER3(ref sourceOUTER3));
-                Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, changeOUTER3, "Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr"));
+                Assert.True(caller_OUTER3(ref sourceOUTER3));
+                Assert.True(Helper.ValidateOUTER3(sourceOUTER3, changeOUTER3, "Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr"));
                 break;
 
             case StructID.UId:
-                U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, 
+                U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue,
                     byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2);
-                U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, 
+                U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue,
                     byte.MaxValue, sbyte.MinValue, long.MaxValue, ulong.MinValue, 64.0F, 6.4);
                 DelegateStdcallByRef_U caller_U = Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_U(ref sourceU));
-                Assert.IsTrue(Helper.ValidateU(sourceU, changeU, "Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr"));
+                Assert.True(caller_U(ref sourceU));
+                Assert.True(Helper.ValidateU(sourceU, changeU, "Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr"));
                 break;
 
             case StructID.ByteStructPack2ExplicitId:
@@ -317,8 +317,8 @@ public class Test_DelegatePInvokeTest
                 ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64);
                 DelegateStdcallByRef_ByteStructPack2Explicit caller_ByteStructPack2Explicit = Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_ByteStructPack2Explicit(ref source_bspe));
-                Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(source_bspe, change_bspe, "Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr"));
+                Assert.True(caller_ByteStructPack2Explicit(ref source_bspe));
+                Assert.True(Helper.ValidateByteStructPack2Explicit(source_bspe, change_bspe, "Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.ShortStructPack4ExplicitId:
@@ -326,8 +326,8 @@ public class Test_DelegatePInvokeTest
                 ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64);
                 DelegateStdcallByRef_ShortStructPack4Explicit caller_ShortStructPack4Explicit = Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_ShortStructPack4Explicit(ref source_sspe));
-                Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(source_sspe, change_sspe, "Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr"));
+                Assert.True(caller_ShortStructPack4Explicit(ref source_sspe));
+                Assert.True(Helper.ValidateShortStructPack4Explicit(source_sspe, change_sspe, "Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.IntStructPack8ExplicitId:
@@ -335,8 +335,8 @@ public class Test_DelegatePInvokeTest
                 IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(64, 64);
                 DelegateStdcallByRef_IntStructPack8Explicit caller_IntStructPack8Explicit = Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_IntStructPack8Explicit(ref source_ispe));
-                Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(source_ispe, change_ispe, "Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr"));
+                Assert.True(caller_IntStructPack8Explicit(ref source_ispe));
+                Assert.True(Helper.ValidateIntStructPack8Explicit(source_ispe, change_ispe, "Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.LongStructPack16ExplicitId:
@@ -344,12 +344,12 @@ public class Test_DelegatePInvokeTest
                 LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(64, 64);
                 DelegateStdcallByRef_LongStructPack16Explicit caller_LongStructPack16Explicit = Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_LongStructPack16Explicit(ref source_lspe));
-                Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(source_lspe, change_lspe, "Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Stdcall_FuncPtr"));
+                Assert.True(caller_LongStructPack16Explicit(ref source_lspe));
+                Assert.True(Helper.ValidateLongStructPack16Explicit(source_lspe, change_lspe, "Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Stdcall_FuncPtr"));
                 break;
 
             default:
-                Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Stdcall:The structid (Managed Side) is wrong");
+                Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Stdcall:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -371,49 +371,49 @@ public class Test_DelegatePInvokeTest
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByVal_InnerExplicit Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByVal_InnerArrayExplicit([In, Out] InnerArrayExplicit iae);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByVal_InnerArrayExplicit Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByVal_OUTER3([In, Out] OUTER3 outer);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByVal_OUTER3 Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByVal_U([In, Out] U u);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByVal_U Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByVal_ByteStructPack2Explicit([In, Out] ByteStructPack2Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByVal_ByteStructPack2Explicit Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByVal_ShortStructPack4Explicit([In, Out] ShortStructPack4Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByVal_ShortStructPack4Explicit Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByVal_IntStructPack8Explicit([In, Out] IntStructPack8Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateCdeclByVal_IntStructPack8Explicit Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool DelegateCdeclByVal_LongStructPack16Explicit([In, Out] LongStructPack16Explicit bspe);
 
@@ -431,8 +431,8 @@ public class Test_DelegatePInvokeTest
                 INNER2 cloneINNER2 = Helper.NewINNER2(1, 1.0F, "some string");
                 DelegateCdeclByVal_INNER2 caller_INNER2 = Get_MarshalStructAsParam_AsExpByValINNER2_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValINNER2_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_INNER2(sourceINNER2));
-                Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, cloneINNER2, "Get_MarshalStructAsParam_AsExpByValINNER2_Cdecl_FuncPtr"));
+                Assert.True(caller_INNER2(sourceINNER2));
+                Assert.True(Helper.ValidateINNER2(sourceINNER2, cloneINNER2, "Get_MarshalStructAsParam_AsExpByValINNER2_Cdecl_FuncPtr"));
                 break;
 
             case StructID.InnerExplicitId:
@@ -444,8 +444,8 @@ public class Test_DelegatePInvokeTest
                 cloneInnerExplicit.f3 = "some string";
                 DelegateCdeclByVal_InnerExplicit caller_InnerExplicit = Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_InnerExplicit(sourceInnerExplicit));
-                Assert.IsTrue(Helper.ValidateInnerExplicit(sourceInnerExplicit, cloneInnerExplicit, "Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr"));
+                Assert.True(caller_InnerExplicit(sourceInnerExplicit));
+                Assert.True(Helper.ValidateInnerExplicit(sourceInnerExplicit, cloneInnerExplicit, "Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.InnerArrayExplicitId:
@@ -453,8 +453,8 @@ public class Test_DelegatePInvokeTest
                 InnerArrayExplicit cloneInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2");
                 DelegateCdeclByVal_InnerArrayExplicit caller_InnerArrayExplicit = Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_InnerArrayExplicit(sourceInnerArrayExplicit));
-                Assert.IsTrue(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, cloneInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr"));
+                Assert.True(caller_InnerArrayExplicit(sourceInnerArrayExplicit));
+                Assert.True(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, cloneInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.OUTER3Id:
@@ -462,19 +462,19 @@ public class Test_DelegatePInvokeTest
                 OUTER3 cloneOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string");
                 DelegateCdeclByVal_OUTER3 caller_OUTER3 = Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_OUTER3(sourceOUTER3));
-                Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, cloneOUTER3, "Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr"));
+                Assert.True(caller_OUTER3(sourceOUTER3));
+                Assert.True(Helper.ValidateOUTER3(sourceOUTER3, cloneOUTER3, "Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr"));
                 break;
 
             case StructID.UId:
-                U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, 
+                U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue,
                     sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2);
-                U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, 
+                U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue,
                     sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2);
                 DelegateCdeclByVal_U caller_U = Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_U(sourceU));
-                Assert.IsTrue(Helper.ValidateU(sourceU, cloneU, "Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr"));
+                Assert.True(caller_U(sourceU));
+                Assert.True(Helper.ValidateU(sourceU, cloneU, "Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr"));
                 break;
 
             case StructID.ByteStructPack2ExplicitId:
@@ -482,8 +482,8 @@ public class Test_DelegatePInvokeTest
                 ByteStructPack2Explicit clone_bspe = Helper.NewByteStructPack2Explicit(32, 32);
                 DelegateCdeclByVal_ByteStructPack2Explicit caller_ByteStructPack2Explicit = Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_ByteStructPack2Explicit(source_bspe));
-                Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(source_bspe, clone_bspe, "Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr"));
+                Assert.True(caller_ByteStructPack2Explicit(source_bspe));
+                Assert.True(Helper.ValidateByteStructPack2Explicit(source_bspe, clone_bspe, "Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.ShortStructPack4ExplicitId:
@@ -491,8 +491,8 @@ public class Test_DelegatePInvokeTest
                 ShortStructPack4Explicit clone_sspe = Helper.NewShortStructPack4Explicit(32, 32);
                 DelegateCdeclByVal_ShortStructPack4Explicit caller_ShortStructPack4Explicit = Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_ShortStructPack4Explicit(source_sspe));
-                Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(source_sspe, clone_sspe, "Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr"));
+                Assert.True(caller_ShortStructPack4Explicit(source_sspe));
+                Assert.True(Helper.ValidateShortStructPack4Explicit(source_sspe, clone_sspe, "Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.IntStructPack8ExplicitId:
@@ -500,8 +500,8 @@ public class Test_DelegatePInvokeTest
                 IntStructPack8Explicit clone_ispe = Helper.NewIntStructPack8Explicit(32, 32);
                 DelegateCdeclByVal_IntStructPack8Explicit caller_IntStructPack8Explicit = Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_IntStructPack8Explicit(source_ispe));
-                Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(source_ispe, clone_ispe, "Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr"));
+                Assert.True(caller_IntStructPack8Explicit(source_ispe));
+                Assert.True(Helper.ValidateIntStructPack8Explicit(source_ispe, clone_ispe, "Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr"));
                 break;
 
             case StructID.LongStructPack16ExplicitId:
@@ -509,12 +509,12 @@ public class Test_DelegatePInvokeTest
                 LongStructPack16Explicit clone_lspe = Helper.NewLongStructPack16Explicit(32, 32);
                 DelegateCdeclByVal_LongStructPack16Explicit caller_LongStructPack16Explicit = Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Cdecl_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Cdecl_FuncPtr...");
-                Assert.IsTrue(caller_LongStructPack16Explicit(source_lspe));
-                Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(source_lspe, clone_lspe, "Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Cdecl_FuncPtr"));
+                Assert.True(caller_LongStructPack16Explicit(source_lspe));
+                Assert.True(Helper.ValidateLongStructPack16Explicit(source_lspe, clone_lspe, "Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Cdecl_FuncPtr"));
                 break;
 
             default:
-                Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong");
+                Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -529,56 +529,56 @@ public class Test_DelegatePInvokeTest
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByVal_INNER2 Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByVal_InnerExplicit([In, Out] InnerExplicit ie);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByVal_InnerExplicit Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByVal_InnerArrayExplicit([In, Out] InnerArrayExplicit iae);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByVal_InnerArrayExplicit Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByVal_OUTER3([In, Out] OUTER3 outer);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByVal_OUTER3 Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByVal_U([In, Out] U u);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByVal_U Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByVal_ByteStructPack2Explicit([In, Out] ByteStructPack2Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByVal_ByteStructPack2Explicit Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByVal_ShortStructPack4Explicit([In, Out] ShortStructPack4Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByVal_ShortStructPack4Explicit Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByVal_IntStructPack8Explicit([In, Out] IntStructPack8Explicit bspe);
 
     [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern DelegateStdcallByVal_IntStructPack8Explicit Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr();
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool DelegateStdcallByVal_LongStructPack16Explicit([In, Out] LongStructPack16Explicit bspe);
 
@@ -596,8 +596,8 @@ public class Test_DelegatePInvokeTest
                 INNER2 cloneINNER2 = Helper.NewINNER2(1, 1.0F, "some string");
                 DelegateStdcallByVal_INNER2 caller_INNER2 = Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_INNER2(sourceINNER2));
-                Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, cloneINNER2, "Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr"));
+                Assert.True(caller_INNER2(sourceINNER2));
+                Assert.True(Helper.ValidateINNER2(sourceINNER2, cloneINNER2, "Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr"));
                 break;
 
             case StructID.InnerExplicitId:
@@ -609,8 +609,8 @@ public class Test_DelegatePInvokeTest
                 cloneInnerExplicit.f3 = "some string";
                 DelegateStdcallByVal_InnerExplicit caller_InnerExplicit = Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_InnerExplicit(sourceInnerExplicit));
-                Assert.IsTrue(Helper.ValidateInnerExplicit(sourceInnerExplicit, cloneInnerExplicit, "Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr"));
+                Assert.True(caller_InnerExplicit(sourceInnerExplicit));
+                Assert.True(Helper.ValidateInnerExplicit(sourceInnerExplicit, cloneInnerExplicit, "Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.InnerArrayExplicitId:
@@ -618,8 +618,8 @@ public class Test_DelegatePInvokeTest
                 InnerArrayExplicit cloneInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2");
                 DelegateStdcallByVal_InnerArrayExplicit caller_InnerArrayExplicit = Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_InnerArrayExplicit(sourceInnerArrayExplicit));
-                Assert.IsTrue(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, cloneInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr"));
+                Assert.True(caller_InnerArrayExplicit(sourceInnerArrayExplicit));
+                Assert.True(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, cloneInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.OUTER3Id:
@@ -627,19 +627,19 @@ public class Test_DelegatePInvokeTest
                 OUTER3 cloneOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string");
                 DelegateStdcallByVal_OUTER3 caller_OUTER3 = Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_OUTER3(sourceOUTER3));
-                Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, cloneOUTER3, "Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr"));
+                Assert.True(caller_OUTER3(sourceOUTER3));
+                Assert.True(Helper.ValidateOUTER3(sourceOUTER3, cloneOUTER3, "Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr"));
                 break;
 
             case StructID.UId:
-                U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, 
+                U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue,
                     byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2);
-                U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, 
+                U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue,
                     byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2);
                 DelegateStdcallByVal_U caller_U = Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_U(sourceU));
-                Assert.IsTrue(Helper.ValidateU(sourceU, cloneU, "Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr"));
+                Assert.True(caller_U(sourceU));
+                Assert.True(Helper.ValidateU(sourceU, cloneU, "Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr"));
                 break;
 
             case StructID.ByteStructPack2ExplicitId:
@@ -647,8 +647,8 @@ public class Test_DelegatePInvokeTest
                 ByteStructPack2Explicit clone_bspe = Helper.NewByteStructPack2Explicit(32, 32);
                 DelegateStdcallByVal_ByteStructPack2Explicit caller_ByteStructPack2Explicit = Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_ByteStructPack2Explicit(source_bspe));
-                Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(source_bspe, clone_bspe, "Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr"));
+                Assert.True(caller_ByteStructPack2Explicit(source_bspe));
+                Assert.True(Helper.ValidateByteStructPack2Explicit(source_bspe, clone_bspe, "Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.ShortStructPack4ExplicitId:
@@ -656,8 +656,8 @@ public class Test_DelegatePInvokeTest
                 ShortStructPack4Explicit clone_sspe = Helper.NewShortStructPack4Explicit(32, 32);
                 DelegateStdcallByVal_ShortStructPack4Explicit caller_ShortStructPack4Explicit = Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_ShortStructPack4Explicit(source_sspe));
-                Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(source_sspe, clone_sspe, "Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr"));
+                Assert.True(caller_ShortStructPack4Explicit(source_sspe));
+                Assert.True(Helper.ValidateShortStructPack4Explicit(source_sspe, clone_sspe, "Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.IntStructPack8ExplicitId:
@@ -665,8 +665,8 @@ public class Test_DelegatePInvokeTest
                 IntStructPack8Explicit clone_ispe = Helper.NewIntStructPack8Explicit(32, 32);
                 DelegateStdcallByVal_IntStructPack8Explicit caller_IntStructPack8Explicit = Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_IntStructPack8Explicit(source_ispe));
-                Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(source_ispe, clone_ispe, "Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr"));
+                Assert.True(caller_IntStructPack8Explicit(source_ispe));
+                Assert.True(Helper.ValidateIntStructPack8Explicit(source_ispe, clone_ispe, "Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr"));
                 break;
 
             case StructID.LongStructPack16ExplicitId:
@@ -674,12 +674,12 @@ public class Test_DelegatePInvokeTest
                 LongStructPack16Explicit clone_lspe = Helper.NewLongStructPack16Explicit(32, 32);
                 DelegateStdcallByVal_LongStructPack16Explicit caller_LongStructPack16Explicit = Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Stdcall_FuncPtr();
                 Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Stdcall_FuncPtr...");
-                Assert.IsTrue(caller_LongStructPack16Explicit(source_lspe));
-                Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(source_lspe, clone_lspe, "Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Stdcall_FuncPtr"));
+                Assert.True(caller_LongStructPack16Explicit(source_lspe));
+                Assert.True(Helper.ValidateLongStructPack16Explicit(source_lspe, clone_lspe, "Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Stdcall_FuncPtr"));
                 break;
 
             default:
-                Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Stdcall:The structid (Managed Side) is wrong");
+                Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Stdcall:The structid (Managed Side) is wrong");
                 break;
         }
     }
index c6a9085..6120f3b 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Text;
 using System.Security;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class Test_ReversePInvokeTest
 {
@@ -27,8 +27,8 @@ public class Test_ReversePInvokeTest
 
     #region Methods implementation
 
-    #region ReversePinvoke, ByRef, Cdel  
-    
+    #region ReversePinvoke, ByRef, Cdel
+
     //ReversePinvoke,Cdel
     // 1.1
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
@@ -41,7 +41,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl");
         INNER2 sourceINNER2 = Helper.NewINNER2(77, 77.0F, "Native");
-        Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByRef_INNER2_Cdecl"));
+        Assert.True(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByRef_INNER2_Cdecl"));
         //changed the value
         inner2.f1 = 1;
         inner2.f2 = 1.0F;
@@ -62,7 +62,7 @@ public class Test_ReversePInvokeTest
         InnerExplicit source_ie = new InnerExplicit();
         source_ie.f1 = 77;
         source_ie.f3 = "Native";
-        Assert.IsTrue(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Cdecl"));
+        Assert.True(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Cdecl"));
         //changed the value
         inner2.f1 = 1;
         inner2.f3 = "some string";
@@ -80,7 +80,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl");
         InnerArrayExplicit source_iae = Helper.NewInnerArrayExplicit(77, 77.0F, "Native", "Native");
-        Assert.IsTrue(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_Cdecl"));
+        Assert.True(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_Cdecl"));
         //changed the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -102,7 +102,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl");
         OUTER3 sourceOUTER3 = Helper.NewOUTER3(77, 77.0F, "Native", "Native");
-        Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Cdecl"));
+        Assert.True(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Cdecl"));
         //changed the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -124,9 +124,9 @@ public class Test_ReversePInvokeTest
     public static bool TestMethod_DoCallBack_MarshalStructByRef_U_Cdecl(ref U u)
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl");
-        U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, 
+        U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue,
             sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 1.23);
-        Assert.IsTrue(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByRef_U_Cdecl"));
+        Assert.True(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByRef_U_Cdecl"));
         //changed the value
         u.d = 3.2;
         return true;
@@ -143,7 +143,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl");
         ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64);
-        Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Explicit_Cdecl"));
+        Assert.True(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Explicit_Cdecl"));
         //changed the value
         bspe.b1 = 32;
         bspe.b2 = 32;
@@ -161,7 +161,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl");
         ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64);
-        Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Cdecl"));
+        Assert.True(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Cdecl"));
         //changed the value
         sspe.s1 = 32;
         sspe.s2 = 32;
@@ -179,7 +179,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl");
         IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(64, 64);
-        Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Cdecl"));
+        Assert.True(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Cdecl"));
         //changed the value
         ispe.i1 = 32;
         ispe.i2 = 32;
@@ -197,7 +197,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl");
         LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(64, 64);
-        Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Cdecl"));
+        Assert.True(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Cdecl"));
         //changed the value
         lspe.l1 = 32;
         lspe.l2 = 32;
@@ -205,7 +205,7 @@ public class Test_ReversePInvokeTest
     }
 
     #endregion
-    
+
     #region ReversePinvoke, ByRef, Stdcall
 
     //ReversePinvoke,Stdcall
@@ -220,7 +220,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall");
         INNER2 sourceINNER2 = Helper.NewINNER2(77, 77.0F, "Native");
-        Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByRef_INNER2_Stdcall"));
+        Assert.True(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByRef_INNER2_Stdcall"));
         //changed the value
         inner2.f1 = 1;
         inner2.f2 = 1.0F;
@@ -241,7 +241,7 @@ public class Test_ReversePInvokeTest
         InnerExplicit source_ie = new InnerExplicit();
         source_ie.f1 = 77;
         source_ie.f3 = "Native";
-        Assert.IsTrue(Helper.ValidateInnerExplicit(inner2,source_ie, "TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Stdcall"));
+        Assert.True(Helper.ValidateInnerExplicit(inner2,source_ie, "TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Stdcall"));
         //changed the value
         inner2.f1 = 1;
         inner2.f3 = "some string";
@@ -259,7 +259,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall");
         InnerArrayExplicit source_iae = Helper.NewInnerArrayExplicit(77, 77.0F, "Native", "Native");
-        Assert.IsTrue(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_Stdcall"));
+        Assert.True(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_Stdcall"));
         //changed the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -281,7 +281,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall");
         OUTER3 sourceOUTER3 = Helper.NewOUTER3(77, 77.0F, "Native", "Native");
-        Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Stdcall"));
+        Assert.True(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Stdcall"));
         //changed the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -303,9 +303,9 @@ public class Test_ReversePInvokeTest
     public static bool TestMethod_DoCallBack_MarshalStructByRef_U_Stdcall(ref U u)
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall");
-        U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, 
+        U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue,
             sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 1.23);
-        Assert.IsTrue(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByRef_U_Stdcall"));
+        Assert.True(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByRef_U_Stdcall"));
         //changed the value
         u.d = 3.2;
         return true;
@@ -322,7 +322,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall");
         ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64);
-        Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Explicit_Stdcall"));
+        Assert.True(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Explicit_Stdcall"));
         //changed the value
         bspe.b1 = 32;
         bspe.b2 = 32;
@@ -340,7 +340,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall");
         ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64);
-        Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Stdcall"));
+        Assert.True(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Stdcall"));
         //changed the value
         sspe.s1 = 32;
         sspe.s2 = 32;
@@ -358,7 +358,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall");
         IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(64, 64);
-        Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Stdcall"));
+        Assert.True(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Stdcall"));
         //changed the value
         ispe.i1 = 32;
         ispe.i2 = 32;
@@ -376,7 +376,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall");
         LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(64, 64);
-        Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Stdcall"));
+        Assert.True(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Stdcall"));
         //changed the value
         lspe.l1 = 32;
         lspe.l2 = 32;
@@ -384,7 +384,7 @@ public class Test_ReversePInvokeTest
     }
 
     #endregion
-    
+
     #region ReversePinvoke, ByVal, Cdel
 
     // 3.1
@@ -398,7 +398,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl");
         INNER2 sourceINNER2 = Helper.NewINNER2(1, 1.0F, "some string");
-        Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByVal_INNER2_Cdecl"));
+        Assert.True(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByVal_INNER2_Cdecl"));
         //changed the value
         inner2.f1 = 77;
         inner2.f2 = 77.0F;
@@ -419,7 +419,7 @@ public class Test_ReversePInvokeTest
         InnerExplicit source_ie = new InnerExplicit();
         source_ie.f1 = 1;
         source_ie.f3 = "Native";
-        Assert.IsTrue(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Cdecl"));
+        Assert.True(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Cdecl"));
         //changed the value
         inner2.f1 = 1;
         inner2.f3 = "changed string";
@@ -437,7 +437,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl");
         InnerArrayExplicit source_iae = Helper.NewInnerArrayExplicit(1, 1.0F, "some string", "some string");
-        Assert.IsTrue(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_Cdecl"));
+        Assert.True(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_Cdecl"));
         //changed the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -459,7 +459,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl");
         OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string");
-        Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Cdecl"));
+        Assert.True(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Cdecl"));
         //changed the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -481,9 +481,9 @@ public class Test_ReversePInvokeTest
     public static bool TestMethod_DoCallBack_MarshalStructByVal_U_Cdecl( U u)
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl");
-        U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, 
+        U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue,
             sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2);
-        Assert.IsTrue(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByVal_U_Cdecl"));
+        Assert.True(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByVal_U_Cdecl"));
         //changed the value
         u.d = 1.23;
         return true;
@@ -500,7 +500,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl");
         ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(32, 32);
-        Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Explicit_Cdecl"));
+        Assert.True(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Explicit_Cdecl"));
         //changed the value
         bspe.b1 = 64;
         bspe.b2 = 64;
@@ -518,7 +518,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl");
         ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(32, 32);
-        Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Cdecl"));
+        Assert.True(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Cdecl"));
         //changed the value
         sspe.s1 = 64;
         sspe.s2 = 64;
@@ -536,7 +536,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl");
         IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(32, 32);
-        Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Cdecl"));
+        Assert.True(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Cdecl"));
         //changed the value
         ispe.i1 = 64;
         ispe.i2 = 64;
@@ -554,7 +554,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl");
         LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(32, 32);
-        Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Cdecl"));
+        Assert.True(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Cdecl"));
         //changed the value
         lspe.l1 = 64;
         lspe.l2 = 64;
@@ -562,9 +562,9 @@ public class Test_ReversePInvokeTest
     }
 
     #endregion
-    
+
     #region ReversePinvoke, ByVal, Stdcall
-   
+
     // 4.1
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool ByValStdcallcaller_INNER2([In, Out] INNER2 inner2);
@@ -576,14 +576,14 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall");
         INNER2 sourceINNER2 = Helper.NewINNER2(1, 1.0F, "some string");
-        Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByVal_INNER2_Stdcall"));
+        Assert.True(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByVal_INNER2_Stdcall"));
         //changed the value
         inner2.f1 = 77;
         inner2.f2 = 77.0F;
         inner2.f3 = "changed string";
         return true;
     }
-    
+
     // 4.2
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool ByValStdcallcaller_InnerExplicit([In, Out] InnerExplicit inner2);
@@ -597,13 +597,13 @@ public class Test_ReversePInvokeTest
         InnerExplicit source_ie = new InnerExplicit();
         source_ie.f1 = 1;
         source_ie.f3 = "Native";
-        Assert.IsTrue(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Stdcall"));
+        Assert.True(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Stdcall"));
         //changed the value
         inner2.f1 = 1;
         inner2.f3 = "changed string";
         return true;
     }
-   
+
     // 4.3
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool ByValStdcallcaller_InnerArrayExplicit([In, Out] InnerArrayExplicit inner2);
@@ -615,7 +615,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall");
         InnerArrayExplicit source_iae = Helper.NewInnerArrayExplicit(1, 1.0F, "some string", "some string");
-        Assert.IsTrue(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_Stdcall"));
+        Assert.True(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_Stdcall"));
         //changed the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -625,7 +625,7 @@ public class Test_ReversePInvokeTest
         iae.f4 = "changed string";
         return true;
     }
+
     // 4.4
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool ByValStdcallcaller_OUTER3([In, Out] OUTER3 outer3);
@@ -637,7 +637,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall");
         OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string");
-        Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Stdcall"));
+        Assert.True(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Stdcall"));
         //changed the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -659,14 +659,14 @@ public class Test_ReversePInvokeTest
     public static bool TestMethod_DoCallBack_MarshalStructByVal_U_Stdcall(U u)
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall");
-        U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, 
+        U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue,
             sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2);
-        Assert.IsTrue(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByVal_U_Stdcall"));
+        Assert.True(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByVal_U_Stdcall"));
         //changed the value
         u.d = 1.23;
         return true;
     }
-   
+
     // 4.6
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool ByValStdcallcaller_ByteStructPack2Explicit([In, Out] ByteStructPack2Explicit bspe);
@@ -678,7 +678,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall");
         ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(32, 32);
-        Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Explicit_Stdcall"));
+        Assert.True(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Explicit_Stdcall"));
         //changed the value
         bspe.b1 = 64;
         bspe.b2 = 64;
@@ -696,7 +696,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall");
         ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(32, 32);
-        Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Stdcall"));
+        Assert.True(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Stdcall"));
         //changed the value
         sspe.s1 = 64;
         sspe.s2 = 64;
@@ -714,7 +714,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall");
         IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(32, 32);
-        Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Stdcall"));
+        Assert.True(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Stdcall"));
         //changed the value
         ispe.i1 = 64;
         ispe.i2 = 64;
@@ -732,7 +732,7 @@ public class Test_ReversePInvokeTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall");
         LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(32, 32);
-        Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Stdcall"));
+        Assert.True(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Stdcall"));
         //changed the value
         lspe.l1 = 64;
         lspe.l2 = 64;
@@ -740,7 +740,7 @@ public class Test_ReversePInvokeTest
     }
 
     #endregion
-    
+
     #endregion
 
     static int Main()
@@ -759,7 +759,7 @@ public class Test_ReversePInvokeTest
             DoCallBack_MarshalByRefStruct_Cdecl_ShortStructPack4Explicit(new ByRefCdeclcaller_ShortStructPack4Explicit(TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Cdecl));
             DoCallBack_MarshalByRefStruct_Cdecl_IntStructPack8Explicit(new ByRefCdeclcaller_IntStructPack8Explicit(TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Cdecl));
             DoCallBack_MarshalByRefStruct_Cdecl_LongStructPack16Explicit(new ByRefCdeclcaller_LongStructPack16Explicit(TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Cdecl));
-            
+
             ////Reverse Pinvoke,ByRef,StdCall
             DoCallBack_MarshalByRefStruct_Stdcall_INNER2(new ByRefStdcallcaller_INNER2(TestMethod_DoCallBack_MarshalStructByRef_INNER2_Stdcall));
             DoCallBack_MarshalByRefStruct_Stdcall_InnerExplicit(new ByRefStdcallcaller_InnerExplicit(TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Stdcall));
@@ -792,7 +792,7 @@ public class Test_ReversePInvokeTest
             DoCallBack_MarshalByValStruct_Stdcall_ShortStructPack4Explicit(new ByValStdcallcaller_ShortStructPack4Explicit(TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Stdcall));
             DoCallBack_MarshalByValStruct_Stdcall_IntStructPack8Explicit(new ByValStdcallcaller_IntStructPack8Explicit(TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Stdcall));
             DoCallBack_MarshalByValStruct_Stdcall_LongStructPack16Explicit(new ByValStdcallcaller_LongStructPack16Explicit(TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Stdcall));
-        
+
             #endregion
 
             return 100;
index e8c2806..c2b3e36 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Text;
 using System.Security;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class MarshalStructTest
 {
@@ -39,9 +39,9 @@ public class MarshalStructTest
     }
 
     #region Methods for the struct InnerSequential declaration
-  
+
     #region PassByRef
-  
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool InnerSequentialByRefDelegateCdecl([In, Out]ref InnerSequential argStr);
@@ -61,11 +61,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern InnerSequentialByRefDelegateStdCall Get_MarshalStructInnerSequentialByRef_StdCall_FuncPtr();
-  
+
     #endregion
-  
+
     #region PassByValue
-   
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool InnerSequentialByValDelegateCdecl([In, Out] InnerSequential argStr);
@@ -85,15 +85,15 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern InnerSequentialByValDelegateStdCall Get_MarshalStructInnerSequentialByVal_StdCall_FuncPtr();
-  
+
     #endregion
 
     #endregion
 
     #region Methods for the struct InnerArraySequential declaration
-   
+
     #region PassByRef
-  
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool InnerArraySequentialByRefDelegateCdecl([In, Out]ref InnerArraySequential argStr);
@@ -113,11 +113,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern InnerArraySequentialByRefDelegateStdCall Get_MarshalStructInnerArraySequentialByRef_StdCall_FuncPtr();
+
     #endregion
-  
+
     #region PassByValue
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool InnerArraySequentialByValDelegateCdecl([In, Out] InnerArraySequential argStr);
@@ -139,13 +139,13 @@ public class MarshalStructTest
     public static extern InnerArraySequentialByValDelegateStdCall Get_MarshalStructInnerArraySequentialByVal_StdCall_FuncPtr();
 
     #endregion
-  
+
     #endregion
 
     #region Methods for the struct CharSetAnsiSequential declaration
-  
+
     #region PassByRef
-  
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool CharSetAnsiSequentialByRefDelegateCdecl([In, Out]ref CharSetAnsiSequential argStr);
@@ -165,11 +165,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern CharSetAnsiSequentialByRefDelegateStdCall Get_MarshalStructCharSetAnsiSequentialByRef_StdCall_FuncPtr();
-  
+
     #endregion
-  
+
     #region PassByValue
-   
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool CharSetAnsiSequentialByValDelegateCdecl([In, Out] CharSetAnsiSequential argStr);
@@ -189,15 +189,15 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern CharSetAnsiSequentialByValDelegateStdCall Get_MarshalStructCharSetAnsiSequentialByVal_StdCall_FuncPtr();
-   
+
     #endregion
-  
+
     #endregion
 
     #region Methods for the struct CharSetUnicodeSequential declaration
-  
+
     #region PassByRef
-  
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool CharSetUnicodeSequentialByRefDelegateCdecl([In, Out]ref CharSetUnicodeSequential argStr);
@@ -217,11 +217,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern CharSetUnicodeSequentialByRefDelegateStdCall Get_MarshalStructCharSetUnicodeSequentialByRef_StdCall_FuncPtr();
-  
+
     #endregion
+
     #region PassByValue
-  
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool CharSetUnicodeSequentialByValDelegateCdecl([In, Out] CharSetUnicodeSequential argStr);
@@ -241,15 +241,15 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern CharSetUnicodeSequentialByValDelegateStdCall Get_MarshalStructCharSetUnicodeSequentialByVal_StdCall_FuncPtr();
-  
+
     #endregion
-  
+
     #endregion
 
     #region Methods for the struct NumberSequential declaration
 
     #region PassByRef
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool NumberSequentialByRefDelegateCdecl([In, Out]ref NumberSequential argStr);
@@ -269,11 +269,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern NumberSequentialByRefDelegateStdCall Get_MarshalStructNumberSequentialByRef_StdCall_FuncPtr();
-   
+
     #endregion
-   
+
     #region PassByValue
-  
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool NumberSequentialByValDelegateCdecl([In, Out] NumberSequential argStr);
@@ -293,7 +293,7 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern NumberSequentialByValDelegateStdCall Get_MarshalStructNumberSequentialByVal_StdCall_FuncPtr();
-   
+
     #endregion
 
     #endregion
@@ -301,7 +301,7 @@ public class MarshalStructTest
     #region Methods for the struct S3 declaration
 
     #region PassByRef
-  
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S3ByRefDelegateCdecl([In, Out]ref S3 argStr);
@@ -321,11 +321,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S3ByRefDelegateStdCall Get_MarshalStructS3ByRef_StdCall_FuncPtr();
-   
+
     #endregion
-   
+
     #region PassByValue
-   
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S3ByValDelegateCdecl([In, Out] S3 argStr);
@@ -345,7 +345,7 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S3ByValDelegateStdCall Get_MarshalStructS3ByVal_StdCall_FuncPtr();
-  
+
     #endregion
 
     #endregion
@@ -353,7 +353,7 @@ public class MarshalStructTest
     #region Methods for the struct S5 declaration
 
     #region PassByRef
-   
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S5ByRefDelegateCdecl([In, Out]ref S5 argStr);
@@ -373,11 +373,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S5ByRefDelegateStdCall Get_MarshalStructS5ByRef_StdCall_FuncPtr();
-   
+
     #endregion
-   
+
     #region PassByValue
-    
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S5ByValDelegateCdecl([In, Out] S5 argStr);
@@ -397,7 +397,7 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S5ByValDelegateStdCall Get_MarshalStructS5ByVal_StdCall_FuncPtr();
-   
+
     #endregion
 
     #endregion
@@ -405,7 +405,7 @@ public class MarshalStructTest
     #region Methods for the struct StringStructSequentialAnsi declaration
 
     #region PassByRef
-    
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool StringStructSequentialAnsiByRefDelegateCdecl([In, Out]ref StringStructSequentialAnsi argStr);
@@ -425,11 +425,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern StringStructSequentialAnsiByRefDelegateStdCall Get_MarshalStructStringStructSequentialAnsiByRef_StdCall_FuncPtr();
-   
+
     #endregion
-  
+
     #region PassByValue
-   
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool StringStructSequentialAnsiByValDelegateCdecl([In, Out] StringStructSequentialAnsi argStr);
@@ -449,7 +449,7 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern StringStructSequentialAnsiByValDelegateStdCall Get_MarshalStructStringStructSequentialAnsiByVal_StdCall_FuncPtr();
-    
+
     #endregion
 
     #endregion
@@ -457,7 +457,7 @@ public class MarshalStructTest
     #region Methods for the struct StringStructSequentialUnicode declaration
 
     #region PassByRef
-    
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool StringStructSequentialUnicodeByRefDelegateCdecl([In, Out]ref StringStructSequentialUnicode argStr);
@@ -477,11 +477,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern StringStructSequentialUnicodeByRefDelegateStdCall Get_MarshalStructStringStructSequentialUnicodeByRef_StdCall_FuncPtr();
-   
+
     #endregion
-   
+
     #region PassByValue
-  
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool StringStructSequentialUnicodeByValDelegateCdecl([In, Out] StringStructSequentialUnicode argStr);
@@ -501,7 +501,7 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern StringStructSequentialUnicodeByValDelegateStdCall Get_MarshalStructStringStructSequentialUnicodeByVal_StdCall_FuncPtr();
-   
+
     #endregion
 
     #endregion
@@ -509,7 +509,7 @@ public class MarshalStructTest
     #region Methods for the struct S8 declaration
 
     #region PassByRef
-   
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S8ByRefDelegateCdecl([In, Out]ref S8 argStr);
@@ -529,11 +529,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S8ByRefDelegateStdCall Get_MarshalStructS8ByRef_StdCall_FuncPtr();
-   
+
     #endregion
-   
+
     #region PassByValue
-   
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S8ByValDelegateCdecl([In, Out] S8 argStr);
@@ -553,7 +553,7 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S8ByValDelegateStdCall Get_MarshalStructS8ByVal_StdCall_FuncPtr();
-  
+
     #endregion
 
     #endregion
@@ -561,7 +561,7 @@ public class MarshalStructTest
     #region Methods for the struct S9 declaration
 
     #region PassByRef
-   
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S9ByRefDelegateCdecl([In, Out]ref S9 argStr);
@@ -581,11 +581,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S9ByRefDelegateStdCall Get_MarshalStructS9ByRef_StdCall_FuncPtr();
-   
+
     #endregion
-   
+
     #region PassByValue
-   
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S9ByValDelegateCdecl([In, Out] S9 argStr);
@@ -605,7 +605,7 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S9ByValDelegateStdCall Get_MarshalStructS9ByVal_StdCall_FuncPtr();
-   
+
     #endregion
 
     #endregion
@@ -613,7 +613,7 @@ public class MarshalStructTest
     #region Methods for the struct IncludeOuterIntergerStructSequential declaration
 
     #region PassByRef
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool IncludeOuterIntergerStructSequentialByRefDelegateCdecl([In, Out]ref IncludeOuterIntergerStructSequential argStr);
@@ -633,11 +633,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern IncludeOuterIntergerStructSequentialByRefDelegateStdCall Get_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall_FuncPtr();
+
     #endregion
-    
+
     #region PassByValue
-   
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool IncludeOuterIntergerStructSequentialByValDelegateCdecl([In, Out] IncludeOuterIntergerStructSequential argStr);
@@ -657,7 +657,7 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern IncludeOuterIntergerStructSequentialByValDelegateStdCall Get_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall_FuncPtr();
-   
+
     #endregion
 
     #endregion
@@ -665,7 +665,7 @@ public class MarshalStructTest
     #region Methods for the struct S11 declaration
 
     #region PassByRef
-  
+
     //For Delegate Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S11ByRefDelegateCdecl([In, Out]ref S11 argStr);
@@ -685,11 +685,11 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S11ByRefDelegateStdCall Get_MarshalStructS11ByRef_StdCall_FuncPtr();
-  
+
     #endregion
-  
+
     #region PassByValue
-   
+
     //For Delegate Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S11ByValDelegateCdecl([In, Out] S11 argStr);
@@ -709,7 +709,7 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern S11ByValDelegateStdCall Get_MarshalStructS11ByVal_StdCall_FuncPtr();
-   
+
     #endregion
 
     #endregion
@@ -717,7 +717,7 @@ public class MarshalStructTest
     #region Methods for the struct ComplexStruct declaration
 
     #region PassByRef
-   
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool ComplexStructByRefDelegateCdecl([In, Out]ref ComplexStruct argStr);
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
@@ -738,7 +738,7 @@ public class MarshalStructTest
     #endregion
 
     #region PassByValue
+
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool ComplexStructByValDelegateCdecl([In, Out] ComplexStruct argStr);
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
@@ -755,15 +755,15 @@ public class MarshalStructTest
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static extern ComplexStructByValDelegateStdCall Get_MarshalStructComplexStructByVal_StdCall_FuncPtr();
-  
+
     #endregion
 
     #endregion
 
     #region Methods implementation
-    
+
     //By Ref
-    //Delegate P/Invoke 
+    //Delegate P/Invoke
     unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID structid)
     {
         Console.WriteLine("Delegate PInvoke,By Ref,Cdecl");
@@ -778,53 +778,53 @@ public class MarshalStructTest
                 cs.type.idata = 123;
                 cs.type.ptrdata = (IntPtr)0x120000;
                 ComplexStructByRefDelegateCdecl caller1 = Get_MarshalStructComplexStructByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller1(ref cs));
-                Assert.AreEqual(9999, cs.i);
-                Assert.IsFalse(cs.b);
-                Assert.AreEqual("Native", cs.str);
-                Assert.AreEqual(-1, cs.type.idata);
-                Assert.AreEqual(3.14159, cs.type.ddata);
+                Assert.True(caller1(ref cs));
+                Assert.Equal(9999, cs.i);
+                Assert.False(cs.b);
+                Assert.Equal("Native", cs.str);
+                Assert.Equal(-1, cs.type.idata);
+                Assert.Equal(3.14159, cs.type.ddata);
                 break;
             case StructID.InnerSequentialId:
                 InnerSequential source_is = Helper.NewInnerSequential(1, 1.0F, "some string");
                 InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string");
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerSequentialByRef_Cdecl...");
                 InnerSequentialByRefDelegateCdecl caller2 = Get_MarshalStructInnerSequentialByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller2(ref source_is));
-                Assert.IsTrue(Helper.ValidateInnerSequential(source_is, change_is, "DelegatePInvoke_MarshalStructInnerSequentialByRef_Cdecl"));
+                Assert.True(caller2(ref source_is));
+                Assert.True(Helper.ValidateInnerSequential(source_is, change_is, "DelegatePInvoke_MarshalStructInnerSequentialByRef_Cdecl"));
                 break;
             case StructID.InnerArraySequentialId:
                 InnerArraySequential source_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string");
                 InnerArraySequential change_ias = Helper.NewInnerArraySequential(77, 77.0F, "changed string");
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerArraySequentialByRef_Cdecl...");
                 InnerArraySequentialByRefDelegateCdecl caller3 = Get_MarshalStructInnerArraySequentialByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller3(ref source_ias));
-                Assert.IsTrue(Helper.ValidateInnerArraySequential(source_ias, change_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByRef_Cdecl"));
+                Assert.True(caller3(ref source_ias));
+                Assert.True(Helper.ValidateInnerArraySequential(source_ias, change_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByRef_Cdecl"));
                 break;
             case StructID.CharSetAnsiSequentialId:
                 CharSetAnsiSequential source_csas = Helper.NewCharSetAnsiSequential("some string", 'c');
                 CharSetAnsiSequential change_csas = Helper.NewCharSetAnsiSequential("change string", 'n');
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_Cdecl...");
                 CharSetAnsiSequentialByRefDelegateCdecl caller4 = Get_MarshalStructCharSetAnsiSequentialByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller4(ref source_csas));
-                Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(source_csas, change_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_Cdecl"));
+                Assert.True(caller4(ref source_csas));
+                Assert.True(Helper.ValidateCharSetAnsiSequential(source_csas, change_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_Cdecl"));
                 break;
             case StructID.CharSetUnicodeSequentialId:
                 CharSetUnicodeSequential source_csus = Helper.NewCharSetUnicodeSequential("some string", 'c');
                 CharSetUnicodeSequential change_csus = Helper.NewCharSetUnicodeSequential("change string", 'n');
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_Cdecl...");
                 CharSetUnicodeSequentialByRefDelegateCdecl caller5 = Get_MarshalStructCharSetUnicodeSequentialByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller5(ref source_csus));
-                Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(source_csus, change_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_Cdecl"));
+                Assert.True(caller5(ref source_csus));
+                Assert.True(Helper.ValidateCharSetUnicodeSequential(source_csus, change_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_Cdecl"));
                 break;
             case StructID.NumberSequentialId:
-                NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, 
+                NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue,
                     sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2);
                 NumberSequential change_ns = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructNumberSequentialByRef_Cdecl...");
                 NumberSequentialByRefDelegateCdecl caller6 = Get_MarshalStructNumberSequentialByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller6(ref source_ns));
-                Assert.IsTrue(Helper.ValidateNumberSequential(source_ns, change_ns, "DelegatePInvoke_MarshalStructNumberSequentialByRef_Cdecl"));
+                Assert.True(caller6(ref source_ns));
+                Assert.True(Helper.ValidateNumberSequential(source_ns, change_ns, "DelegatePInvoke_MarshalStructNumberSequentialByRef_Cdecl"));
                 break;
             case StructID.S3Id:
                 int[] iarr = new int[256];
@@ -834,8 +834,8 @@ public class MarshalStructTest
                 S3 changeS3 = Helper.NewS3(false, "change string", icarr);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS3ByRef_Cdecl...");
                 S3ByRefDelegateCdecl caller7 = Get_MarshalStructS3ByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller7(ref sourceS3));
-                Assert.IsTrue(Helper.ValidateS3(sourceS3, changeS3, "DelegatePInvoke_MarshalStructS3ByRef_Cdecl"));
+                Assert.True(caller7(ref sourceS3));
+                Assert.True(Helper.ValidateS3(sourceS3, changeS3, "DelegatePInvoke_MarshalStructS3ByRef_Cdecl"));
                 break;
             case StructID.S5Id:
                 Enum1 enums = Enum1.e1;
@@ -844,8 +844,8 @@ public class MarshalStructTest
                 S5 changeS5 = Helper.NewS5(64, "change string", enumch);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS5ByRef_Cdecl...");
                 S5ByRefDelegateCdecl caller8 = Get_MarshalStructS5ByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller8(ref sourceS5));
-                Assert.IsTrue(Helper.ValidateS5(sourceS5, changeS5, "DelegatePInvoke_MarshalStructS5ByRef_Cdecl"));
+                Assert.True(caller8(ref sourceS5));
+                Assert.True(Helper.ValidateS5(sourceS5, changeS5, "DelegatePInvoke_MarshalStructS5ByRef_Cdecl"));
                 break;
             case StructID.StringStructSequentialAnsiId:
                 strOne = new String('a', 512);
@@ -854,8 +854,8 @@ public class MarshalStructTest
                 StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_Cdecl...");
                 StringStructSequentialAnsiByRefDelegateCdecl caller9 = Get_MarshalStructStringStructSequentialAnsiByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller9(ref source_sssa));
-                Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(source_sssa, change_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_Cdecl"));
+                Assert.True(caller9(ref source_sssa));
+                Assert.True(Helper.ValidateStringStructSequentialAnsi(source_sssa, change_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_Cdecl"));
                 break;
             case StructID.StringStructSequentialUnicodeId:
                 strOne = new String('a', 256);
@@ -864,32 +864,32 @@ public class MarshalStructTest
                 StringStructSequentialUnicode change_sssu = Helper.NewStringStructSequentialUnicode(strTwo, strOne);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_Cdecl...");
                 StringStructSequentialUnicodeByRefDelegateCdecl caller10 = Get_MarshalStructStringStructSequentialUnicodeByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller10(ref source_sssu));
-                Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(source_sssu, change_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_Cdecl"));
+                Assert.True(caller10(ref source_sssu));
+                Assert.True(Helper.ValidateStringStructSequentialUnicode(source_sssu, change_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_Cdecl"));
                 break;
             case StructID.S8Id:
                 S8 sourceS8 = Helper.NewS8("hello", true, 10, 128, 128, 32);
                 S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS8ByRef_Cdecl...");
                 S8ByRefDelegateCdecl caller11 = Get_MarshalStructS8ByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller11(ref sourceS8));
-                Assert.IsTrue(Helper.ValidateS8(sourceS8, changeS8, "DelegatePInvoke_MarshalStructS8ByRef_Cdecl"));
+                Assert.True(caller11(ref sourceS8));
+                Assert.True(Helper.ValidateS8(sourceS8, changeS8, "DelegatePInvoke_MarshalStructS8ByRef_Cdecl"));
                 break;
             case StructID.S9Id:
                 S9 sourceS9 = Helper.NewS9(128, new TestDelegate1(testMethod));
                 S9 changeS9 = Helper.NewS9(256, null);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS9ByRef_Cdecl...");
                 S9ByRefDelegateCdecl caller12 = Get_MarshalStructS9ByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller12(ref sourceS9));
-                Assert.IsTrue(Helper.ValidateS9(sourceS9, changeS9, "DelegatePInvoke_MarshalStructS9ByRef_Cdecl"));
+                Assert.True(caller12(ref sourceS9));
+                Assert.True(Helper.ValidateS9(sourceS9, changeS9, "DelegatePInvoke_MarshalStructS9ByRef_Cdecl"));
                 break;
             case StructID.IncludeOuterIntergerStructSequentialId:
                 IncludeOuterIntergerStructSequential sourceIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32);
                 IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl...");
                 IncludeOuterIntergerStructSequentialByRefDelegateCdecl caller13 = Get_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller13(ref sourceIncludeOuterIntergerStructSequential));
-                Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, 
+                Assert.True(caller13(ref sourceIncludeOuterIntergerStructSequential));
+                Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential,
                     changeIncludeOuterIntergerStructSequential, "DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl"));
                 break;
             case StructID.S11Id:
@@ -897,11 +897,11 @@ public class MarshalStructTest
                 S11 changeS11 = Helper.NewS11((int*)(64), 64);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS11ByRef_Cdecl...");
                 S11ByRefDelegateCdecl caller14 = Get_MarshalStructS11ByRef_Cdecl_FuncPtr();
-                Assert.IsTrue(caller14(ref sourceS11));
-                Assert.IsTrue(Helper.ValidateS11(sourceS11, changeS11, "DelegatePInvoke_MarshalStructS11ByRef_Cdecl"));
+                Assert.True(caller14(ref sourceS11));
+                Assert.True(Helper.ValidateS11(sourceS11, changeS11, "DelegatePInvoke_MarshalStructS11ByRef_Cdecl"));
                 break;
             default:
-                Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong");
+                Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -920,53 +920,53 @@ public class MarshalStructTest
                 cs.type.idata = 123;
                 cs.type.ptrdata = (IntPtr)0x120000;
                 ComplexStructByRefDelegateStdCall caller1 = Get_MarshalStructComplexStructByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller1(ref cs));
-                Assert.AreEqual(9999, cs.i);
-                Assert.IsFalse(cs.b);
-                Assert.AreEqual("Native", cs.str);
-                Assert.AreEqual(-1, cs.type.idata);
-                Assert.AreEqual(3.14159, cs.type.ddata);
+                Assert.True(caller1(ref cs));
+                Assert.Equal(9999, cs.i);
+                Assert.False(cs.b);
+                Assert.Equal("Native", cs.str);
+                Assert.Equal(-1, cs.type.idata);
+                Assert.Equal(3.14159, cs.type.ddata);
                 break;
             case StructID.InnerSequentialId:
                 InnerSequential source_is = Helper.NewInnerSequential(1, 1.0F, "some string");
                 InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string");
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerSequentialByRef_StdCall...");
                 InnerSequentialByRefDelegateStdCall caller2 = Get_MarshalStructInnerSequentialByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller2(ref source_is));
-                Assert.IsTrue(Helper.ValidateInnerSequential(source_is, change_is, "DelegatePInvoke_MarshalStructInnerSequentialByRef_StdCall"));
+                Assert.True(caller2(ref source_is));
+                Assert.True(Helper.ValidateInnerSequential(source_is, change_is, "DelegatePInvoke_MarshalStructInnerSequentialByRef_StdCall"));
                 break;
             case StructID.InnerArraySequentialId:
                 InnerArraySequential source_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string");
                 InnerArraySequential change_ias = Helper.NewInnerArraySequential(77, 77.0F, "changed string");
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerArraySequentialByRef_StdCall...");
                 InnerArraySequentialByRefDelegateStdCall caller3 = Get_MarshalStructInnerArraySequentialByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller3(ref source_ias));
-                Assert.IsTrue(Helper.ValidateInnerArraySequential(source_ias, change_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByRef_StdCall"));
+                Assert.True(caller3(ref source_ias));
+                Assert.True(Helper.ValidateInnerArraySequential(source_ias, change_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByRef_StdCall"));
                 break;
             case StructID.CharSetAnsiSequentialId:
                 CharSetAnsiSequential source_csas = Helper.NewCharSetAnsiSequential("some string", 'c');
                 CharSetAnsiSequential change_csas = Helper.NewCharSetAnsiSequential("change string", 'n');
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_StdCall...");
                 CharSetAnsiSequentialByRefDelegateStdCall caller4 = Get_MarshalStructCharSetAnsiSequentialByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller4(ref source_csas));
-                Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(source_csas, change_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_StdCall"));
+                Assert.True(caller4(ref source_csas));
+                Assert.True(Helper.ValidateCharSetAnsiSequential(source_csas, change_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_StdCall"));
                 break;
             case StructID.CharSetUnicodeSequentialId:
                 CharSetUnicodeSequential source_csus = Helper.NewCharSetUnicodeSequential("some string", 'c');
                 CharSetUnicodeSequential change_csus = Helper.NewCharSetUnicodeSequential("change string", 'n');
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_StdCall...");
                 CharSetUnicodeSequentialByRefDelegateStdCall caller5 = Get_MarshalStructCharSetUnicodeSequentialByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller5(ref source_csus));
-                Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(source_csus, change_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_StdCall"));
+                Assert.True(caller5(ref source_csus));
+                Assert.True(Helper.ValidateCharSetUnicodeSequential(source_csus, change_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_StdCall"));
                 break;
             case StructID.NumberSequentialId:
-                NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, 
+                NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue,
                     sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2);
                 NumberSequential change_ns = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructNumberSequentialByRef_StdCall...");
                 NumberSequentialByRefDelegateStdCall caller6 = Get_MarshalStructNumberSequentialByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller6(ref source_ns));
-                Assert.IsTrue(Helper.ValidateNumberSequential(source_ns, change_ns, "DelegatePInvoke_MarshalStructNumberSequentialByRef_StdCall"));
+                Assert.True(caller6(ref source_ns));
+                Assert.True(Helper.ValidateNumberSequential(source_ns, change_ns, "DelegatePInvoke_MarshalStructNumberSequentialByRef_StdCall"));
                 break;
             case StructID.S3Id:
                 int[] iarr = new int[256];
@@ -976,8 +976,8 @@ public class MarshalStructTest
                 S3 changeS3 = Helper.NewS3(false, "change string", icarr);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS3ByRef_StdCall...");
                 S3ByRefDelegateStdCall caller7 = Get_MarshalStructS3ByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller7(ref sourceS3));
-                Assert.IsTrue(Helper.ValidateS3(sourceS3, changeS3, "DelegatePInvoke_MarshalStructS3ByRef_StdCall"));
+                Assert.True(caller7(ref sourceS3));
+                Assert.True(Helper.ValidateS3(sourceS3, changeS3, "DelegatePInvoke_MarshalStructS3ByRef_StdCall"));
                 break;
             case StructID.S5Id:
                 Enum1 enums = Enum1.e1;
@@ -986,8 +986,8 @@ public class MarshalStructTest
                 S5 changeS5 = Helper.NewS5(64, "change string", enumch);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS5ByRef_StdCall...");
                 S5ByRefDelegateStdCall caller8 = Get_MarshalStructS5ByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller8(ref sourceS5));
-                Assert.IsTrue(Helper.ValidateS5(sourceS5, changeS5, "DelegatePInvoke_MarshalStructS5ByRef_StdCall"));
+                Assert.True(caller8(ref sourceS5));
+                Assert.True(Helper.ValidateS5(sourceS5, changeS5, "DelegatePInvoke_MarshalStructS5ByRef_StdCall"));
                 break;
             case StructID.StringStructSequentialAnsiId:
                 strOne = new String('a', 512);
@@ -996,8 +996,8 @@ public class MarshalStructTest
                 StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_StdCall...");
                 StringStructSequentialAnsiByRefDelegateStdCall caller9 = Get_MarshalStructStringStructSequentialAnsiByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller9(ref source_sssa));
-                Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(source_sssa, change_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_StdCall"));
+                Assert.True(caller9(ref source_sssa));
+                Assert.True(Helper.ValidateStringStructSequentialAnsi(source_sssa, change_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_StdCall"));
                 break;
             case StructID.StringStructSequentialUnicodeId:
                 strOne = new String('a', 256);
@@ -1006,32 +1006,32 @@ public class MarshalStructTest
                 StringStructSequentialUnicode change_sssu = Helper.NewStringStructSequentialUnicode(strTwo, strOne);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_StdCall...");
                 StringStructSequentialUnicodeByRefDelegateStdCall caller10 = Get_MarshalStructStringStructSequentialUnicodeByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller10(ref source_sssu));
-                Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(source_sssu, change_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_StdCall"));
+                Assert.True(caller10(ref source_sssu));
+                Assert.True(Helper.ValidateStringStructSequentialUnicode(source_sssu, change_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_StdCall"));
                 break;
             case StructID.S8Id:
                 S8 sourceS8 = Helper.NewS8("hello", true, 10, 128, 128, 32);
                 S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS8ByRef_StdCall...");
                 S8ByRefDelegateStdCall caller11 = Get_MarshalStructS8ByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller11(ref sourceS8));
-                Assert.IsTrue(Helper.ValidateS8(sourceS8, changeS8, "DelegatePInvoke_MarshalStructS8ByRef_StdCall"));
+                Assert.True(caller11(ref sourceS8));
+                Assert.True(Helper.ValidateS8(sourceS8, changeS8, "DelegatePInvoke_MarshalStructS8ByRef_StdCall"));
                 break;
             case StructID.S9Id:
                 S9 sourceS9 = Helper.NewS9(128, new TestDelegate1(testMethod));
                 S9 changeS9 = Helper.NewS9(256, null);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS9ByRef_StdCall...");
                 S9ByRefDelegateStdCall caller12 = Get_MarshalStructS9ByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller12(ref sourceS9));
-                Assert.IsTrue(Helper.ValidateS9(sourceS9, changeS9, "DelegatePInvoke_MarshalStructS9ByRef_StdCall"));
+                Assert.True(caller12(ref sourceS9));
+                Assert.True(Helper.ValidateS9(sourceS9, changeS9, "DelegatePInvoke_MarshalStructS9ByRef_StdCall"));
                 break;
             case StructID.IncludeOuterIntergerStructSequentialId:
                 IncludeOuterIntergerStructSequential sourceIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32);
                 IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall...");
                 IncludeOuterIntergerStructSequentialByRefDelegateStdCall caller13 = Get_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller13(ref sourceIncludeOuterIntergerStructSequential));
-                Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, 
+                Assert.True(caller13(ref sourceIncludeOuterIntergerStructSequential));
+                Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential,
                     changeIncludeOuterIntergerStructSequential, "DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall"));
                 break;
             case StructID.S11Id:
@@ -1039,11 +1039,11 @@ public class MarshalStructTest
                 S11 changeS11 = Helper.NewS11((int*)(64), 64);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS11ByRef_StdCall...");
                 S11ByRefDelegateStdCall caller14 = Get_MarshalStructS11ByRef_StdCall_FuncPtr();
-                Assert.IsTrue(caller14(ref sourceS11));
-                Assert.IsTrue(Helper.ValidateS11(sourceS11, changeS11, "DelegatePInvoke_MarshalStructS11ByRef_StdCall"));
+                Assert.True(caller14(ref sourceS11));
+                Assert.True(Helper.ValidateS11(sourceS11, changeS11, "DelegatePInvoke_MarshalStructS11ByRef_StdCall"));
                 break;
             default:
-                Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_StdCall:The structid (Managed Side) is wrong");
+                Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_StdCall:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -1062,54 +1062,54 @@ public class MarshalStructTest
                 cs.type.idata = 123;
                 cs.type.ptrdata = (IntPtr)0x120000;
                 ComplexStructByValDelegateCdecl caller1 = Get_MarshalStructComplexStructByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller1(cs));
-                Assert.AreEqual(321, cs.i);
-                Assert.IsTrue(cs.b);
-                Assert.AreEqual("Managed", cs.str);
-                Assert.AreEqual(123, cs.type.idata);
-                Assert.AreEqual(0x120000, (int)cs.type.ptrdata);
+                Assert.True(caller1(cs));
+                Assert.Equal(321, cs.i);
+                Assert.True(cs.b);
+                Assert.Equal("Managed", cs.str);
+                Assert.Equal(123, cs.type.idata);
+                Assert.Equal(0x120000, (int)cs.type.ptrdata);
                 break;
             case StructID.InnerSequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerSequentialByVal_Cdecl...");
                 InnerSequential source_is = Helper.NewInnerSequential(1, 1.0F, "some string");
                 InnerSequential clone_is1 = Helper.NewInnerSequential(1, 1.0F, "some string");
                 InnerSequentialByValDelegateCdecl caller2 = Get_MarshalStructInnerSequentialByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller2(source_is));
-                Assert.IsTrue(Helper.ValidateInnerSequential(source_is, clone_is1, "DelegatePInvoke_MarshalStructInnerSequentialByVal_Cdecl"));
+                Assert.True(caller2(source_is));
+                Assert.True(Helper.ValidateInnerSequential(source_is, clone_is1, "DelegatePInvoke_MarshalStructInnerSequentialByVal_Cdecl"));
                 break;
             case StructID.InnerArraySequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerArraySequentialByVal_Cdecl...");
                 InnerArraySequential source_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string");
                 InnerArraySequential clone_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string");
                 InnerArraySequentialByValDelegateCdecl caller3 = Get_MarshalStructInnerArraySequentialByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller3(source_ias));
-                Assert.IsTrue(Helper.ValidateInnerArraySequential(source_ias, clone_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByVal_Cdecl"));
+                Assert.True(caller3(source_ias));
+                Assert.True(Helper.ValidateInnerArraySequential(source_ias, clone_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByVal_Cdecl"));
                 break;
             case StructID.CharSetAnsiSequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_Cdecl...");
                 CharSetAnsiSequential source_csas = Helper.NewCharSetAnsiSequential("some string", 'c');
                 CharSetAnsiSequential clone_csas = Helper.NewCharSetAnsiSequential("some string", 'c');
                 CharSetAnsiSequentialByValDelegateCdecl caller4 = Get_MarshalStructCharSetAnsiSequentialByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller4(source_csas));
-                Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(source_csas, clone_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_Cdecl"));
+                Assert.True(caller4(source_csas));
+                Assert.True(Helper.ValidateCharSetAnsiSequential(source_csas, clone_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_Cdecl"));
                 break;
             case StructID.CharSetUnicodeSequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_Cdecl...");
                 CharSetUnicodeSequential source_csus = Helper.NewCharSetUnicodeSequential("some string", 'c');
                 CharSetUnicodeSequential clone_csus = Helper.NewCharSetUnicodeSequential("some string", 'c');
                 CharSetUnicodeSequentialByValDelegateCdecl caller5 = Get_MarshalStructCharSetUnicodeSequentialByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller5(source_csus));
-                Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(source_csus, clone_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_Cdecl"));
+                Assert.True(caller5(source_csus));
+                Assert.True(Helper.ValidateCharSetUnicodeSequential(source_csus, clone_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_Cdecl"));
                 break;
             case StructID.NumberSequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructNumberSequentialByVal_Cdecl...");
-                NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, 
+                NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue,
                     sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2);
-                NumberSequential clone_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, 
+                NumberSequential clone_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue,
                     sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2);
                 NumberSequentialByValDelegateCdecl caller6 = Get_MarshalStructNumberSequentialByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller6(source_ns));
-                Assert.IsTrue(Helper.ValidateNumberSequential(source_ns, clone_ns, "DelegatePInvoke_MarshalStructNumberSequentialByVal_Cdecl"));
+                Assert.True(caller6(source_ns));
+                Assert.True(Helper.ValidateNumberSequential(source_ns, clone_ns, "DelegatePInvoke_MarshalStructNumberSequentialByVal_Cdecl"));
                 break;
             case StructID.S3Id:
                 int[] iarr = new int[256];
@@ -1119,8 +1119,8 @@ public class MarshalStructTest
                 S3 cloneS3 = Helper.NewS3(true, "some string", iarr);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS3ByVal_Cdecl...");
                 S3ByValDelegateCdecl caller7 = Get_MarshalStructS3ByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller7(sourceS3));
-                Assert.IsTrue(Helper.ValidateS3(sourceS3, cloneS3, "DelegatePInvoke_MarshalStructS3ByVal_Cdecl"));
+                Assert.True(caller7(sourceS3));
+                Assert.True(Helper.ValidateS3(sourceS3, cloneS3, "DelegatePInvoke_MarshalStructS3ByVal_Cdecl"));
                 break;
             case StructID.S5Id:
                 Enum1 enums = Enum1.e1;
@@ -1128,8 +1128,8 @@ public class MarshalStructTest
                 S5 cloneS5 = Helper.NewS5(32, "some string", enums);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS5ByVal_Cdecl...");
                 S5ByValDelegateCdecl caller8 = Get_MarshalStructS5ByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller8(sourceS5));
-                Assert.IsTrue(Helper.ValidateS5(sourceS5, cloneS5, "DelegatePInvoke_MarshalStructS5ByVal_Cdecl"));
+                Assert.True(caller8(sourceS5));
+                Assert.True(Helper.ValidateS5(sourceS5, cloneS5, "DelegatePInvoke_MarshalStructS5ByVal_Cdecl"));
                 break;
             case StructID.StringStructSequentialAnsiId:
                 strOne = new String('a', 512);
@@ -1138,8 +1138,8 @@ public class MarshalStructTest
                 StringStructSequentialAnsi clone_sssa = Helper.NewStringStructSequentialAnsi(strOne, strTwo);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_Cdecl...");
                 StringStructSequentialAnsiByValDelegateCdecl caller9 = Get_MarshalStructStringStructSequentialAnsiByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller9(source_sssa));
-                Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(source_sssa, clone_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_Cdecl"));
+                Assert.True(caller9(source_sssa));
+                Assert.True(Helper.ValidateStringStructSequentialAnsi(source_sssa, clone_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_Cdecl"));
                 break;
             case StructID.StringStructSequentialUnicodeId:
                 strOne = new String('a', 256);
@@ -1148,32 +1148,32 @@ public class MarshalStructTest
                 StringStructSequentialUnicode clone_sssu = Helper.NewStringStructSequentialUnicode(strOne, strTwo);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_Cdecl...");
                 StringStructSequentialUnicodeByValDelegateCdecl caller10 = Get_MarshalStructStringStructSequentialUnicodeByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller10(source_sssu));
-                Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(source_sssu, clone_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_Cdecl"));
+                Assert.True(caller10(source_sssu));
+                Assert.True(Helper.ValidateStringStructSequentialUnicode(source_sssu, clone_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_Cdecl"));
                 break;
             case StructID.S8Id:
                 S8 sourceS8 = Helper.NewS8("hello", true, 10, 128, 128, 32);
                 S8 cloneS8 = Helper.NewS8("hello", true, 10, 128, 128, 32);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS8ByVal_Cdecl...");
                 S8ByValDelegateCdecl caller11 = Get_MarshalStructS8ByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller11(sourceS8));
-                Assert.IsTrue(Helper.ValidateS8(sourceS8, cloneS8, "DelegatePInvoke_MarshalStructS8ByVal_Cdecl"));
+                Assert.True(caller11(sourceS8));
+                Assert.True(Helper.ValidateS8(sourceS8, cloneS8, "DelegatePInvoke_MarshalStructS8ByVal_Cdecl"));
                 break;
             case StructID.S9Id:
                 S9 sourceS9 = Helper.NewS9(128, new TestDelegate1(testMethod));
                 S9 cloneS9 = Helper.NewS9(128, new TestDelegate1(testMethod));
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS9ByVal_Cdecl...");
                 S9ByValDelegateCdecl caller12 = Get_MarshalStructS9ByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller12(sourceS9));
-                Assert.IsTrue(Helper.ValidateS9(sourceS9, cloneS9, "DelegatePInvoke_MarshalStructS9ByVal_Cdecl"));
+                Assert.True(caller12(sourceS9));
+                Assert.True(Helper.ValidateS9(sourceS9, cloneS9, "DelegatePInvoke_MarshalStructS9ByVal_Cdecl"));
                 break;
             case StructID.IncludeOuterIntergerStructSequentialId:
                 IncludeOuterIntergerStructSequential sourceIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32);
                 IncludeOuterIntergerStructSequential cloneIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl...");
                 IncludeOuterIntergerStructSequentialByValDelegateCdecl caller13 = Get_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller13(sourceIncludeOuterIntergerStructSequential));
-                Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, 
+                Assert.True(caller13(sourceIncludeOuterIntergerStructSequential));
+                Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential,
                     cloneIncludeOuterIntergerStructSequential, "DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl"));
                 break;
             case StructID.S11Id:
@@ -1181,11 +1181,11 @@ public class MarshalStructTest
                 S11 cloneS11 = Helper.NewS11((int*)(32), 32);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS11ByVal_Cdecl...");
                 S11ByValDelegateCdecl caller14 = Get_MarshalStructS11ByVal_Cdecl_FuncPtr();
-                Assert.IsTrue(caller14(sourceS11));
-                Assert.IsTrue(Helper.ValidateS11(sourceS11, cloneS11, "DelegatePInvoke_MarshalStructS11ByVal_Cdecl"));
+                Assert.True(caller14(sourceS11));
+                Assert.True(Helper.ValidateS11(sourceS11, cloneS11, "DelegatePInvoke_MarshalStructS11ByVal_Cdecl"));
                 break;
             default:
-                Assert.Fail("TestMethod_DelegatePInvoke_MarshalByVal_Cdecl:The structid (Managed Side) is wrong");
+                Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByVal_Cdecl:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -1204,54 +1204,54 @@ public class MarshalStructTest
                 cs.type.idata = 123;
                 cs.type.ptrdata = (IntPtr)0x120000;
                 ComplexStructByValDelegateStdCall caller1 = Get_MarshalStructComplexStructByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller1(cs));
-                Assert.AreEqual(321, cs.i);
-                Assert.IsTrue(cs.b);
-                Assert.AreEqual("Managed", cs.str);
-                Assert.AreEqual(123, cs.type.idata);
-                Assert.AreEqual(0x120000, (int)cs.type.ptrdata);
+                Assert.True(caller1(cs));
+                Assert.Equal(321, cs.i);
+                Assert.True(cs.b);
+                Assert.Equal("Managed", cs.str);
+                Assert.Equal(123, cs.type.idata);
+                Assert.Equal(0x120000, (int)cs.type.ptrdata);
                 break;
             case StructID.InnerSequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerSequentialByVal_StdCall...");
                 InnerSequential source_is = Helper.NewInnerSequential(1, 1.0F, "some string");
                 InnerSequential clone_is1 = Helper.NewInnerSequential(1, 1.0F, "some string");
                 InnerSequentialByValDelegateStdCall caller2 = Get_MarshalStructInnerSequentialByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller2(source_is));
-                Assert.IsTrue(Helper.ValidateInnerSequential(source_is, clone_is1, "DelegatePInvoke_MarshalStructInnerSequentialByVal_StdCall"));
+                Assert.True(caller2(source_is));
+                Assert.True(Helper.ValidateInnerSequential(source_is, clone_is1, "DelegatePInvoke_MarshalStructInnerSequentialByVal_StdCall"));
                 break;
             case StructID.InnerArraySequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerArraySequentialByVal_StdCall...");
                 InnerArraySequential source_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string");
                 InnerArraySequential clone_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string");
                 InnerArraySequentialByValDelegateStdCall caller3 = Get_MarshalStructInnerArraySequentialByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller3(source_ias));
-                Assert.IsTrue(Helper.ValidateInnerArraySequential(source_ias, clone_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByVal_StdCall"));
+                Assert.True(caller3(source_ias));
+                Assert.True(Helper.ValidateInnerArraySequential(source_ias, clone_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByVal_StdCall"));
                 break;
             case StructID.CharSetAnsiSequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_StdCall...");
                 CharSetAnsiSequential source_csas = Helper.NewCharSetAnsiSequential("some string", 'c');
                 CharSetAnsiSequential clone_csas = Helper.NewCharSetAnsiSequential("some string", 'c');
                 CharSetAnsiSequentialByValDelegateStdCall caller4 = Get_MarshalStructCharSetAnsiSequentialByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller4(source_csas));
-                Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(source_csas, clone_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_StdCall"));
+                Assert.True(caller4(source_csas));
+                Assert.True(Helper.ValidateCharSetAnsiSequential(source_csas, clone_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_StdCall"));
                 break;
             case StructID.CharSetUnicodeSequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_StdCall...");
                 CharSetUnicodeSequential source_csus = Helper.NewCharSetUnicodeSequential("some string", 'c');
                 CharSetUnicodeSequential clone_csus = Helper.NewCharSetUnicodeSequential("some string", 'c');
                 CharSetUnicodeSequentialByValDelegateStdCall caller5 = Get_MarshalStructCharSetUnicodeSequentialByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller5(source_csus));
-                Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(source_csus, clone_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_StdCall"));
+                Assert.True(caller5(source_csus));
+                Assert.True(Helper.ValidateCharSetUnicodeSequential(source_csus, clone_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_StdCall"));
                 break;
             case StructID.NumberSequentialId:
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructNumberSequentialByVal_StdCall...");
-                NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, 
+                NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue,
                     sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2);
-                NumberSequential clone_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, 
+                NumberSequential clone_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue,
                     sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2);
                 NumberSequentialByValDelegateStdCall caller6 = Get_MarshalStructNumberSequentialByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller6(source_ns));
-                Assert.IsTrue(Helper.ValidateNumberSequential(source_ns, clone_ns, "DelegatePInvoke_MarshalStructNumberSequentialByVal_StdCall"));
+                Assert.True(caller6(source_ns));
+                Assert.True(Helper.ValidateNumberSequential(source_ns, clone_ns, "DelegatePInvoke_MarshalStructNumberSequentialByVal_StdCall"));
                 break;
             case StructID.S3Id:
                 int[] iarr = new int[256];
@@ -1261,8 +1261,8 @@ public class MarshalStructTest
                 S3 cloneS3 = Helper.NewS3(true, "some string", iarr);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS3ByVal_StdCall...");
                 S3ByValDelegateStdCall caller7 = Get_MarshalStructS3ByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller7(sourceS3));
-                Assert.IsTrue(Helper.ValidateS3(sourceS3, cloneS3, "DelegatePInvoke_MarshalStructS3ByVal_StdCall"));
+                Assert.True(caller7(sourceS3));
+                Assert.True(Helper.ValidateS3(sourceS3, cloneS3, "DelegatePInvoke_MarshalStructS3ByVal_StdCall"));
                 break;
             case StructID.S5Id:
                 Enum1 enums = Enum1.e1;
@@ -1270,8 +1270,8 @@ public class MarshalStructTest
                 S5 cloneS5 = Helper.NewS5(32, "some string", enums);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS5ByVal_StdCall...");
                 S5ByValDelegateStdCall caller8 = Get_MarshalStructS5ByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller8(sourceS5));
-                Assert.IsTrue(Helper.ValidateS5(sourceS5, cloneS5, "DelegatePInvoke_MarshalStructS5ByVal_StdCall"));
+                Assert.True(caller8(sourceS5));
+                Assert.True(Helper.ValidateS5(sourceS5, cloneS5, "DelegatePInvoke_MarshalStructS5ByVal_StdCall"));
                 break;
             case StructID.StringStructSequentialAnsiId:
                 strOne = new String('a', 512);
@@ -1280,8 +1280,8 @@ public class MarshalStructTest
                 StringStructSequentialAnsi clone_sssa = Helper.NewStringStructSequentialAnsi(strOne, strTwo);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_StdCall...");
                 StringStructSequentialAnsiByValDelegateStdCall caller9 = Get_MarshalStructStringStructSequentialAnsiByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller9(source_sssa));
-                Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(source_sssa, clone_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_StdCall"));
+                Assert.True(caller9(source_sssa));
+                Assert.True(Helper.ValidateStringStructSequentialAnsi(source_sssa, clone_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_StdCall"));
                 break;
             case StructID.StringStructSequentialUnicodeId:
                 strOne = new String('a', 256);
@@ -1290,32 +1290,32 @@ public class MarshalStructTest
                 StringStructSequentialUnicode clone_sssu = Helper.NewStringStructSequentialUnicode(strOne, strTwo);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_StdCall...");
                 StringStructSequentialUnicodeByValDelegateStdCall caller10 = Get_MarshalStructStringStructSequentialUnicodeByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller10(source_sssu));
-                Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(source_sssu, clone_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_StdCall"));
+                Assert.True(caller10(source_sssu));
+                Assert.True(Helper.ValidateStringStructSequentialUnicode(source_sssu, clone_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_StdCall"));
                 break;
             case StructID.S8Id:
                 S8 sourceS8 = Helper.NewS8("hello", true, 10, 128, 128, 32);
                 S8 cloneS8 = Helper.NewS8("hello", true, 10, 128, 128, 32);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS8ByVal_StdCall...");
                 S8ByValDelegateStdCall caller11 = Get_MarshalStructS8ByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller11(sourceS8));
-                Assert.IsTrue(Helper.ValidateS8(sourceS8, cloneS8, "DelegatePInvoke_MarshalStructS8ByVal_StdCall"));
+                Assert.True(caller11(sourceS8));
+                Assert.True(Helper.ValidateS8(sourceS8, cloneS8, "DelegatePInvoke_MarshalStructS8ByVal_StdCall"));
                 break;
             case StructID.S9Id:
                 S9 sourceS9 = Helper.NewS9(128, new TestDelegate1(testMethod));
                 S9 cloneS9 = Helper.NewS9(128, new TestDelegate1(testMethod));
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS9ByVal_StdCall...");
                 S9ByValDelegateStdCall caller12 = Get_MarshalStructS9ByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller12(sourceS9));
-                Assert.IsTrue(Helper.ValidateS9(sourceS9, cloneS9, "DelegatePInvoke_MarshalStructS9ByVal_StdCall"));
+                Assert.True(caller12(sourceS9));
+                Assert.True(Helper.ValidateS9(sourceS9, cloneS9, "DelegatePInvoke_MarshalStructS9ByVal_StdCall"));
                 break;
             case StructID.IncludeOuterIntergerStructSequentialId:
                 IncludeOuterIntergerStructSequential sourceIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32);
                 IncludeOuterIntergerStructSequential cloneIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall...");
                 IncludeOuterIntergerStructSequentialByValDelegateStdCall caller13 = Get_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller13(sourceIncludeOuterIntergerStructSequential));
-                Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, 
+                Assert.True(caller13(sourceIncludeOuterIntergerStructSequential));
+                Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential,
                     cloneIncludeOuterIntergerStructSequential, "DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall"));
                 break;
             case StructID.S11Id:
@@ -1323,10 +1323,10 @@ public class MarshalStructTest
                 S11 cloneS11 = Helper.NewS11((int*)(32), 32);
                 Console.WriteLine("Calling DelegatePInvoke_MarshalStructS11ByVal_StdCall...");
                 S11ByValDelegateStdCall caller14 = Get_MarshalStructS11ByVal_StdCall_FuncPtr();
-                Assert.IsTrue(caller14(sourceS11));
+                Assert.True(caller14(sourceS11));
                 break;
             default:
-                Assert.Fail("TestMethod_DelegatePInvoke_MarshalByVal_StdCall:The structid (Managed Side) is wrong");
+                Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByVal_StdCall:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -1334,7 +1334,7 @@ public class MarshalStructTest
     #endregion
 
     #region By Ref
-   
+
     unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByRef_Cdecl()
     {
         TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID.ComplexStructId);
@@ -1352,7 +1352,7 @@ public class MarshalStructTest
         TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID.IncludeOuterIntergerStructSequentialId);
         TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID.S11Id);
     }
-   
+
     unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByRef_StdCall()
     {
         TestMethod_DelegatePInvoke_MarshalByRef_StdCall(StructID.ComplexStructId);
@@ -1370,11 +1370,11 @@ public class MarshalStructTest
         TestMethod_DelegatePInvoke_MarshalByRef_StdCall(StructID.IncludeOuterIntergerStructSequentialId);
         TestMethod_DelegatePInvoke_MarshalByRef_StdCall(StructID.S11Id);
     }
-  
+
     #endregion
 
     #region By Value
-   
+
     unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByVal_Cdecl()
     {
         TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID.ComplexStructId);
@@ -1392,7 +1392,7 @@ public class MarshalStructTest
         TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID.IncludeOuterIntergerStructSequentialId);
         TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID.S11Id);
     }
-    
+
     unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByVal_StdCall()
     {
         TestMethod_DelegatePInvoke_MarshalByVal_StdCall(StructID.ComplexStructId);
@@ -1410,7 +1410,7 @@ public class MarshalStructTest
         TestMethod_DelegatePInvoke_MarshalByVal_StdCall(StructID.IncludeOuterIntergerStructSequentialId);
         TestMethod_DelegatePInvoke_MarshalByVal_StdCall(StructID.S11Id);
     }
-    
+
     #endregion
 
     static int Main()
index 2e56b1b..3ef0766 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Text;
 using System.Security;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 public class MarshalStructTest
 {
@@ -52,7 +52,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
         InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string");
         //Check the input
-        Assert.IsTrue(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.f1 = 1;
         argstr.f2 = 1.0F;
@@ -67,7 +67,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string");
         //Check the input
-        Assert.IsTrue(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         argstr.f1 = 1;
         argstr.f2 = 1.0F;
@@ -94,7 +94,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string");
         //Check the input
-        Assert.IsTrue(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.f1 = 1;
         argstr.f2 = 1.0F;
@@ -109,7 +109,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string");
         //Check the input
-        Assert.IsTrue(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.f1 = 1;
         argstr.f2 = 1.0F;
@@ -140,7 +140,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
         InnerArraySequential change_is = Helper.NewInnerArraySequential(77, 77.0F, "changed string");
         //Check the input
-        Assert.IsTrue(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -158,7 +158,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         InnerArraySequential change_is = Helper.NewInnerArraySequential(77, 77.0F, "changed string");
         //Check the input
-        Assert.IsTrue(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -189,7 +189,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         InnerArraySequential change_is = Helper.NewInnerArraySequential(77, 77.0F, "changed string");
         //Check the input
-        Assert.IsTrue(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -207,7 +207,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         InnerArraySequential change_is = Helper.NewInnerArraySequential(77, 77.0F, "changed string");
         //Check the input
-        Assert.IsTrue(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         for (int i = 0; i < Common.NumArrElements; i++)
         {
@@ -241,7 +241,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
         CharSetAnsiSequential change_is = Helper.NewCharSetAnsiSequential("change string", 'n');
         //Check the input
-        Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.f1 = "some string";
         argstr.f2 = 'c';
@@ -255,7 +255,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         CharSetAnsiSequential change_is = Helper.NewCharSetAnsiSequential("change string", 'n');
         //Check the input
-        Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         argstr.f1 = "some string";
         argstr.f2 = 'c';
@@ -281,7 +281,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         CharSetAnsiSequential change_is = Helper.NewCharSetAnsiSequential("change string", 'n');
         //Check the input
-        Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.f1 = "some string";
         argstr.f2 = 'c';
@@ -295,7 +295,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         CharSetAnsiSequential change_is = Helper.NewCharSetAnsiSequential("change string", 'n');
         //Check the input
-        Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.f1 = "some string";
         argstr.f2 = 'c';
@@ -325,7 +325,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
         CharSetUnicodeSequential change_is = Helper.NewCharSetUnicodeSequential("change string", 'n');
         //Check the input
-        Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.f1 = "some string";
         argstr.f2 = 'c';
@@ -339,7 +339,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         CharSetUnicodeSequential change_is = Helper.NewCharSetUnicodeSequential("change string", 'n');
         //Check the input
-        Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         argstr.f1 = "some string";
         argstr.f2 = 'c';
@@ -365,7 +365,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         CharSetUnicodeSequential change_is = Helper.NewCharSetUnicodeSequential("change string", 'n');
         //Check the input
-        Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.f1 = "some string";
         argstr.f2 = 'c';
@@ -379,7 +379,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         CharSetUnicodeSequential change_is = Helper.NewCharSetUnicodeSequential("change string", 'n');
         //Check the input
-        Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.f1 = "some string";
         argstr.f2 = 'c';
@@ -409,7 +409,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
         NumberSequential change_is = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4);
         //Check the input
-        Assert.IsTrue(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.i32 = Int32.MinValue;
         argstr.ui32 = UInt32.MaxValue;
@@ -433,7 +433,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         NumberSequential change_is = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4);
         //Check the input
-        Assert.IsTrue(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         argstr.i32 = Int32.MinValue;
         argstr.ui32 = UInt32.MaxValue;
@@ -469,7 +469,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         NumberSequential change_is = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4);
         //Check the input
-        Assert.IsTrue(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.i32 = Int32.MinValue;
         argstr.ui32 = UInt32.MaxValue;
@@ -493,7 +493,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         NumberSequential change_is = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4);
         //Check the input
-        Assert.IsTrue(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.i32 = Int32.MinValue;
         argstr.ui32 = UInt32.MaxValue;
@@ -536,7 +536,7 @@ public class MarshalStructTest
         Helper.InitialArray(iarr, icarr);
         S3 changeS3 = Helper.NewS3(false, "change string", icarr);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.flag = true;
         argstr.str = "some string";
@@ -554,7 +554,7 @@ public class MarshalStructTest
         Helper.InitialArray(iarr, icarr);
         S3 changeS3 = Helper.NewS3(false, "change string", icarr);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.flag = true;
         argstr.str = "some string";
@@ -584,7 +584,7 @@ public class MarshalStructTest
         Helper.InitialArray(iarr, icarr);
         S3 changeS3 = Helper.NewS3(false, "change string", icarr);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.flag = true;
         argstr.str = "some string";
@@ -602,7 +602,7 @@ public class MarshalStructTest
         Helper.InitialArray(iarr, icarr);
         S3 changeS3 = Helper.NewS3(false, "change string", icarr);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.flag = true;
         argstr.str = "some string";
@@ -622,9 +622,9 @@ public class MarshalStructTest
     #endregion
 
     #region Methods for the struct S5 declaration
-  
+
     #region PassByRef
-  
+
     //For Reverse Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S5ByRefCdeclcaller([In, Out]ref S5 argStr);
@@ -638,13 +638,13 @@ public class MarshalStructTest
         s4.name = "some string";
         S5 changeS5 = Helper.NewS5(64, "change string", enumch);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.s4 = s4;
         argstr.ef = enums;
         return true;
     }
-   
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool S5ByRefStdCallcaller([In, Out]ref S5 argStr);
     private static bool TestMethodForStructS5_ReversePInvokeByRef_StdCall(ref S5 argstr)
@@ -657,7 +657,7 @@ public class MarshalStructTest
         s4.name = "some string";
         S5 changeS5 = Helper.NewS5(64, "change string", enumch);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         argstr.s4 = s4;
         argstr.ef = enums;
@@ -670,11 +670,11 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructS5ByRef_StdCall(S5ByRefStdCallcaller caller);
-  
+
     #endregion
-    
+
     #region PassByValue
-   
+
     //For Reverse Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S5ByValCdeclcaller([In, Out] S5 argStr);
@@ -688,7 +688,7 @@ public class MarshalStructTest
         s4.name = "some string";
         S5 changeS5 = Helper.NewS5(64, "change string", enumch);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.s4 = s4;
         argstr.ef = enums;
@@ -707,7 +707,7 @@ public class MarshalStructTest
         s4.name = "some string";
         S5 changeS5 = Helper.NewS5(64, "change string", enumch);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.s4 = s4;
         argstr.ef = enums;
@@ -720,15 +720,15 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructS5ByVal_StdCall(S5ByValStdCallcaller caller);
-  
+
     #endregion
-  
+
     #endregion
 
     #region Methods for the struct StringStructSequentialAnsi declaration
-   
+
     #region PassByRef
-   
+
     //For Reverse Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool StringStructSequentialAnsiByRefCdeclcaller([In, Out]ref StringStructSequentialAnsi argStr);
@@ -739,13 +739,13 @@ public class MarshalStructTest
         strTwo = new String('b', 512);
         StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne);
         //Check the input
-        Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.first = strOne;
         argstr.last = strTwo;
         return true;
     }
-   
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool StringStructSequentialAnsiByRefStdCallcaller([In, Out]ref StringStructSequentialAnsi argStr);
     private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_StdCall(ref StringStructSequentialAnsi argstr)
@@ -755,7 +755,7 @@ public class MarshalStructTest
         strTwo = new String('b', 512);
         StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne);
         //Check the input
-        Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         argstr.first = strOne;
         argstr.last = strTwo;
@@ -768,11 +768,11 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructStringStructSequentialAnsiByRef_StdCall(StringStructSequentialAnsiByRefStdCallcaller caller);
-    
+
     #endregion
-   
+
     #region PassByValue
-    
+
     //For Reverse Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool StringStructSequentialAnsiByValCdeclcaller([In, Out] StringStructSequentialAnsi argStr);
@@ -783,7 +783,7 @@ public class MarshalStructTest
         strTwo = new String('b', 512);
         StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne);
         //Check the input
-        Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.first = strOne;
         argstr.last = strTwo;
@@ -799,7 +799,7 @@ public class MarshalStructTest
         strTwo = new String('b', 512);
         StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne);
         //Check the input
-        Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.first = strOne;
         argstr.last = strTwo;
@@ -812,15 +812,15 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructStringStructSequentialAnsiByVal_StdCall(StringStructSequentialAnsiByValStdCallcaller caller);
-   
+
     #endregion
-   
+
     #endregion
 
     #region Methods for the struct StringStructSequentialUnicode declaration
-   
+
     #region PassByRef
-   
+
     //For Reverse Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool StringStructSequentialUnicodeByRefCdeclcaller([In, Out]ref StringStructSequentialUnicode argStr);
@@ -831,13 +831,13 @@ public class MarshalStructTest
         strTwo = new String('b', 256);
         StringStructSequentialUnicode change_sssa = Helper.NewStringStructSequentialUnicode(strTwo, strOne);
         //Check the input
-        Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.first = strOne;
         argstr.last = strTwo;
         return true;
     }
-   
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool StringStructSequentialUnicodeByRefStdCallcaller([In, Out]ref StringStructSequentialUnicode argStr);
     private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_StdCall(ref StringStructSequentialUnicode argstr)
@@ -847,7 +847,7 @@ public class MarshalStructTest
         strTwo = new String('b', 256);
         StringStructSequentialUnicode change_sssa = Helper.NewStringStructSequentialUnicode(strTwo, strOne);
         //Check the input
-        Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         argstr.first = strOne;
         argstr.last = strTwo;
@@ -860,9 +860,9 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_StdCall(StringStructSequentialUnicodeByRefStdCallcaller caller);
-   
+
     #endregion
-      
+
     #region PassByValue
     //For Reverse Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
@@ -874,7 +874,7 @@ public class MarshalStructTest
         strTwo = new String('b', 256);
         StringStructSequentialUnicode change_sssa = Helper.NewStringStructSequentialUnicode(strTwo, strOne);
         //Check the input
-        Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.first = strOne;
         argstr.last = strTwo;
@@ -890,7 +890,7 @@ public class MarshalStructTest
         strTwo = new String('b', 256);
         StringStructSequentialUnicode change_sssa = Helper.NewStringStructSequentialUnicode(strTwo, strOne);
         //Check the input
-        Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.first = strOne;
         argstr.last = strTwo;
@@ -903,15 +903,15 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_StdCall(StringStructSequentialUnicodeByValStdCallcaller caller);
-   
+
     #endregion
-   
+
     #endregion
 
     #region Methods for the struct S8 declaration
-  
+
     #region PassByRef
-   
+
     //For Reverse Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S8ByRefCdeclcaller([In, Out]ref S8 argStr);
@@ -920,7 +920,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
         S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.name = "hello";
         argstr.gender = true;
@@ -930,7 +930,7 @@ public class MarshalStructTest
         argstr.mySByte = 32;
         return true;
     }
-  
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool S8ByRefStdCallcaller([In, Out]ref S8 argStr);
     private static bool TestMethodForStructS8_ReversePInvokeByRef_StdCall(ref S8 argstr)
@@ -938,7 +938,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.name = "hello";
         argstr.gender = true;
@@ -955,11 +955,11 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructS8ByRef_StdCall(S8ByRefStdCallcaller caller);
-  
+
     #endregion
-  
+
     #region PassByValue
-   
+
     //For Reverse Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S8ByValCdeclcaller([In, Out] S8 argStr);
@@ -968,7 +968,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.name = "hello";
         argstr.gender = true;
@@ -986,7 +986,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.name = "hello";
         argstr.gender = true;
@@ -1003,15 +1003,15 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructS8ByVal_StdCall(S8ByValStdCallcaller caller);
-   
+
     #endregion
-  
+
     #endregion
 
     #region Methods for the struct S9 declaration
-  
+
     #region PassByRef
-    
+
     //For Reverse Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S9ByRefCdeclcaller([In, Out]ref S9 argStr);
@@ -1020,13 +1020,13 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
         S9 changeS9 = Helper.NewS9(256, null);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.i32 = 128;
         argstr.myDelegate1 = new TestDelegate1(testMethod);
         return true;
     }
-   
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool S9ByRefStdCallcaller([In, Out]ref S9 argStr);
     private static bool TestMethodForStructS9_ReversePInvokeByRef_StdCall(ref S9 argstr)
@@ -1034,7 +1034,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         S9 changeS9 = Helper.NewS9(256, null);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         argstr.i32 = 128;
         argstr.myDelegate1 = new TestDelegate1(testMethod);
@@ -1047,11 +1047,11 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructS9ByRef_StdCall(S9ByRefStdCallcaller caller);
-  
+
     #endregion
+
     #region PassByValue
-    
+
     //For Reverse Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S9ByValCdeclcaller([In, Out] S9 argStr);
@@ -1060,7 +1060,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         S9 changeS9 = Helper.NewS9(256, null);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.i32 = 128;
         argstr.myDelegate1 = new TestDelegate1(testMethod);
@@ -1074,7 +1074,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         S9 changeS9 = Helper.NewS9(256, null);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.i32 = 128;
         argstr.myDelegate1 = new TestDelegate1(testMethod);
@@ -1087,15 +1087,15 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructS9ByVal_StdCall(S9ByValStdCallcaller caller);
-   
+
     #endregion
-   
+
     #endregion
 
     #region Methods for the struct IncludeOuterIntergerStructSequential declaration
-   
+
     #region PassByRef
-   
+
     //For Reverse Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool IncludeOuterIntergerStructSequentialByRefCdeclcaller([In, Out]ref IncludeOuterIntergerStructSequential argStr);
@@ -1104,14 +1104,14 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
         IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, 
+        Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(argstr,
             changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.s.s_int.i = 32;
         argstr.s.i = 32;
         return true;
     }
-  
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool IncludeOuterIntergerStructSequentialByRefStdCallcaller([In, Out]ref IncludeOuterIntergerStructSequential argStr);
     private static bool TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_StdCall(ref IncludeOuterIntergerStructSequential argstr)
@@ -1119,7 +1119,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, 
+        Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(argstr,
             changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.s.s_int.i = 32;
@@ -1133,11 +1133,11 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall(IncludeOuterIntergerStructSequentialByRefStdCallcaller caller);
-   
+
     #endregion
-   
+
     #region PassByValue
-    
+
     //For Reverse Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate IncludeOuterIntergerStructSequential IncludeOuterIntergerStructSequentialByValCdeclcaller([In, Out] IncludeOuterIntergerStructSequential argStr);
@@ -1146,7 +1146,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, 
+        Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(argstr,
             changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.s.s_int.i = 32;
@@ -1161,7 +1161,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, 
+        Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(argstr,
             changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.s.s_int.i = 32;
@@ -1175,15 +1175,15 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall(IncludeOuterIntergerStructSequentialByValStdCallcaller caller);
-   
+
     #endregion
-   
+
     #endregion
 
     #region Methods for the struct S11 declaration
-  
+
     #region PassByRef
-   
+
     //For Reverse Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S11ByRefCdeclcaller([In, Out]ref S11 argStr);
@@ -1192,13 +1192,13 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
         S11 changeS11 = Helper.NewS11((int*)(64), 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByRef_Cdecl"));
+        Assert.True(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByRef_Cdecl"));
         //Chanage the value
         argstr.i32 = (int*)(32);
         argstr.i = 32;
         return true;
     }
-   
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate bool S11ByRefStdCallcaller([In, Out]ref S11 argStr);
     unsafe private static bool TestMethodForStructS11_ReversePInvokeByRef_StdCall(ref S11 argstr)
@@ -1206,7 +1206,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         S11 changeS11 = Helper.NewS11((int*)(64), 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByRef_StdCall"));
+        Assert.True(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByRef_StdCall"));
         //Chanage the value
         argstr.i32 = (int*)(32);
         argstr.i = 32;
@@ -1219,11 +1219,11 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructS11ByRef_StdCall(S11ByRefStdCallcaller caller);
-  
+
     #endregion
-  
+
     #region PassByValue
-   
+
     //For Reverse Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool S11ByValCdeclcaller([In, Out] S11 argStr);
@@ -1232,7 +1232,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         S11 changeS11 = Helper.NewS11((int*)(64), 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByVal_Cdecl"));
+        Assert.True(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.i32 = (int*)(32);
         argstr.i = 32;
@@ -1246,7 +1246,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         S11 changeS11 = Helper.NewS11((int*)(64), 64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByVal_StdCall"));
+        Assert.True(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.i32 = (int*)(32);
         argstr.i = 32;
@@ -1259,15 +1259,15 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructS11ByVal_StdCall(S11ByValStdCallcaller caller);
-  
+
     #endregion
-  
+
     #endregion
 
     #region Methods for the struct ComplexStruct declaration
-   
+
     #region PassByRef
-   
+
     //For Reverse Pinvoke ByRef
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool ComplexStructByRefCdeclcaller([In, Out]ref ComplexStruct argStr);
@@ -1275,11 +1275,11 @@ public class MarshalStructTest
     {
         Console.WriteLine("ReversePinvoke,By Ref,Cdecl");
             //Check the input
-            Assert.AreEqual(9999, cs.i);
-            Assert.IsFalse(cs.b);
-            Assert.AreEqual("Native", cs.str);
-            Assert.AreEqual(-1, cs.type.idata);
-            Assert.AreEqual(3.14159, cs.type.ddata);
+            Assert.Equal(9999, cs.i);
+            Assert.False(cs.b);
+            Assert.Equal("Native", cs.str);
+            Assert.Equal(-1, cs.type.idata);
+            Assert.Equal(3.14159, cs.type.ddata);
             //Chanage the value
             cs.i = 321;
             cs.b = true;
@@ -1295,11 +1295,11 @@ public class MarshalStructTest
     {
         Console.WriteLine("ReversePinvoke,By Ref,StdCall");
         //Check the input
-        Assert.AreEqual(9999, cs.i);
-        Assert.IsFalse(cs.b);
-        Assert.AreEqual("Native", cs.str);
-        Assert.AreEqual(-1, cs.type.idata);
-        Assert.AreEqual(3.14159, cs.type.ddata);
+        Assert.Equal(9999, cs.i);
+        Assert.False(cs.b);
+        Assert.Equal("Native", cs.str);
+        Assert.Equal(-1, cs.type.idata);
+        Assert.Equal(3.14159, cs.type.ddata);
         //Chanage the value
         cs.i = 321;
         cs.b = true;
@@ -1315,11 +1315,11 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructComplexStructByRef_StdCall(ComplexStructByRefStdCallcaller caller);
-   
+
     #endregion
-   
+
     #region PassByValue
-   
+
     //For Reverse Pinvoke ByVal
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
     public delegate bool ComplexStructByValCdeclcaller([In, Out] ComplexStruct argStr);
@@ -1327,11 +1327,11 @@ public class MarshalStructTest
     {
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         //Check the input
-        Assert.AreEqual(9999, cs.i);
-        Assert.IsFalse(cs.b);
-        Assert.AreEqual("Native", cs.str);
-        Assert.AreEqual(-1, cs.type.idata);
-        Assert.AreEqual(3.14159, cs.type.ddata);
+        Assert.Equal(9999, cs.i);
+        Assert.False(cs.b);
+        Assert.Equal("Native", cs.str);
+        Assert.Equal(-1, cs.type.idata);
+        Assert.Equal(3.14159, cs.type.ddata);
         //Try to Chanage the value
         cs.i = 321;
         cs.b = true;
@@ -1347,11 +1347,11 @@ public class MarshalStructTest
     {
         Console.WriteLine("Reverse Pinvoke,By Value,StdCall");
         //Check the input
-        Assert.AreEqual(9999, cs.i);
-        Assert.IsFalse(cs.b);
-        Assert.AreEqual("Native", cs.str);
-        Assert.AreEqual(-1, cs.type.idata);
-        Assert.AreEqual(3.14159, cs.type.ddata);
+        Assert.Equal(9999, cs.i);
+        Assert.False(cs.b);
+        Assert.Equal("Native", cs.str);
+        Assert.Equal(-1, cs.type.idata);
+        Assert.Equal(3.14159, cs.type.ddata);
         //Try to Chanage the value
         cs.i = 321;
         cs.b = true;
@@ -1367,7 +1367,7 @@ public class MarshalStructTest
     //Reverse Pinvoke,stdcall
     [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)]
     public static extern bool DoCallBack_MarshalStructComplexStructByVal_StdCall(ComplexStructByValStdCallcaller caller);
-   
+
     #endregion
 
     #endregion
@@ -1378,7 +1378,7 @@ public class MarshalStructTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl");
         ByteStruct3Byte change_bspe = Helper.NewByteStruct3Byte(1, 42, 90);
-        Assert.IsTrue(Helper.ValidateByteStruct3Byte(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_Cdecl"));
+        Assert.True(Helper.ValidateByteStruct3Byte(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_Cdecl"));
         //changed the value
         bspe.b1 = 7;
         bspe.b2 = 12;
@@ -1386,7 +1386,7 @@ public class MarshalStructTest
         success = true;
         return bspe;
     }
-    
+
     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
     public delegate ByteStruct3Byte ByValStdCallcaller_ByteStruct3Byte(ByteStruct3Byte bspe, [MarshalAs(UnmanagedType.Bool)] out bool success);
 
@@ -1394,7 +1394,7 @@ public class MarshalStructTest
     {
         Console.WriteLine("Reverse,Pinvoke,By Val,StdCall");
         ByteStruct3Byte change_bspe = Helper.NewByteStruct3Byte(1, 42, 90);
-        Assert.IsTrue(Helper.ValidateByteStruct3Byte(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_StdCall"));
+        Assert.True(Helper.ValidateByteStruct3Byte(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_StdCall"));
         //changed the value
         bspe.b1 = 7;
         bspe.b2 = 12;
@@ -1418,7 +1418,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,Cdecl");
         IntergerStructSequential changeIntergerStructSequential = Helper.NewIntergerStructSequential(64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateIntergerStructSequential(argstr, 
+        Assert.True(Helper.ValidateIntergerStructSequential(argstr,
             changeIntergerStructSequential, "TestMethodForStructIntergerStructSequential_ReversePInvokeByVal_Cdecl"));
         //Chanage the value
         argstr.i = 32;
@@ -1432,7 +1432,7 @@ public class MarshalStructTest
         Console.WriteLine("ReversePinvoke,By Value,StdCall");
         IntergerStructSequential changeIntergerStructSequential = Helper.NewIntergerStructSequential(64);
         //Check the input
-        Assert.IsTrue(Helper.ValidateIntergerStructSequential(argstr, 
+        Assert.True(Helper.ValidateIntergerStructSequential(argstr,
             changeIntergerStructSequential, "TestMethodForStructIntergerStructSequential_ReversePInvokeByVal_StdCall"));
         //Chanage the value
         argstr.i = 32;
@@ -1447,7 +1447,7 @@ public class MarshalStructTest
     public static extern bool DoCallBack_MarshalStructIntergerStructSequentialByVal_StdCall(IntergerStructSequentialByValStdCallcaller caller);
 
     #region Methods implementation
-   
+
     //Reverse P/Invoke By Ref
     private static void TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID structid)
     {
@@ -1455,68 +1455,68 @@ public class MarshalStructTest
         {
             case StructID.ComplexStructId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexStructByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructComplexStructByRef_Cdecl(new ComplexStructByRefCdeclcaller(TestMethodForStructComplexStruct_ReversePInvokeByRef_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructComplexStructByRef_Cdecl(new ComplexStructByRefCdeclcaller(TestMethodForStructComplexStruct_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.InnerSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerSequentialByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructInnerSequentialByRef_Cdecl(new InnerSequentialByRefCdeclcaller(TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructInnerSequentialByRef_Cdecl(new InnerSequentialByRefCdeclcaller(TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.InnerArraySequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByRef_Cdecl(
+                Assert.True(DoCallBack_MarshalStructInnerArraySequentialByRef_Cdecl(
                     new InnerArraySequentialByRefCdeclcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.CharSetAnsiSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_Cdecl(
+                Assert.True(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_Cdecl(
                     new CharSetAnsiSequentialByRefCdeclcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.CharSetUnicodeSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_Cdecl(
+                Assert.True(DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_Cdecl(
                     new CharSetUnicodeSequentialByRefCdeclcaller(TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.NumberSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructNumberSequentialByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructNumberSequentialByRef_Cdecl(new NumberSequentialByRefCdeclcaller(TestMethodForStructNumberSequential_ReversePInvokeByRef_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructNumberSequentialByRef_Cdecl(new NumberSequentialByRefCdeclcaller(TestMethodForStructNumberSequential_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.S3Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS3ByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS3ByRef_Cdecl(new S3ByRefCdeclcaller(TestMethodForStructS3_ReversePInvokeByRef_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS3ByRef_Cdecl(new S3ByRefCdeclcaller(TestMethodForStructS3_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.S5Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS5ByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS5ByRef_Cdecl(new S5ByRefCdeclcaller(TestMethodForStructS5_ReversePInvokeByRef_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS5ByRef_Cdecl(new S5ByRefCdeclcaller(TestMethodForStructS5_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.StringStructSequentialAnsiId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_Cdecl(
+                Assert.True(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_Cdecl(
                     new StringStructSequentialAnsiByRefCdeclcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.StringStructSequentialUnicodeId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_Cdecl(
+                Assert.True(DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_Cdecl(
                     new StringStructSequentialUnicodeByRefCdeclcaller(TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.S8Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS8ByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS8ByRef_Cdecl(new S8ByRefCdeclcaller(TestMethodForStructS8_ReversePInvokeByRef_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS8ByRef_Cdecl(new S8ByRefCdeclcaller(TestMethodForStructS8_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.S9Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS9ByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS9ByRef_Cdecl(new S9ByRefCdeclcaller(TestMethodForStructS9_ReversePInvokeByRef_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS9ByRef_Cdecl(new S9ByRefCdeclcaller(TestMethodForStructS9_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.IncludeOuterIntergerStructSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl(
+                Assert.True(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl(
                     new IncludeOuterIntergerStructSequentialByRefCdeclcaller(TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_Cdecl)));
                 break;
             case StructID.S11Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS11ByRef_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS11ByRef_Cdecl(new S11ByRefCdeclcaller(TestMethodForStructS11_ReversePInvokeByRef_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS11ByRef_Cdecl(new S11ByRefCdeclcaller(TestMethodForStructS11_ReversePInvokeByRef_Cdecl)));
                 break;
             default:
-                Assert.Fail("DoCallBack_MarshalStructByRef_Cdecl:The structid (Managed Side) is wrong");
+                Assert.True(false, "DoCallBack_MarshalStructByRef_Cdecl:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -1527,68 +1527,68 @@ public class MarshalStructTest
         {
             case StructID.ComplexStructId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexStructByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructComplexStructByRef_StdCall(new ComplexStructByRefStdCallcaller(TestMethodForStructComplexStruct_ReversePInvokeByRef_StdCall)));
+                Assert.True(DoCallBack_MarshalStructComplexStructByRef_StdCall(new ComplexStructByRefStdCallcaller(TestMethodForStructComplexStruct_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.InnerSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerSequentialByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructInnerSequentialByRef_StdCall(new InnerSequentialByRefStdCallcaller(TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCall)));
+                Assert.True(DoCallBack_MarshalStructInnerSequentialByRef_StdCall(new InnerSequentialByRefStdCallcaller(TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.InnerArraySequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByRef_StdCall(
+                Assert.True(DoCallBack_MarshalStructInnerArraySequentialByRef_StdCall(
                     new InnerArraySequentialByRefStdCallcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.CharSetAnsiSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_StdCall(
+                Assert.True(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_StdCall(
                     new CharSetAnsiSequentialByRefStdCallcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.CharSetUnicodeSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_StdCall(
+                Assert.True(DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_StdCall(
                     new CharSetUnicodeSequentialByRefStdCallcaller(TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.NumberSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructNumberSequentialByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructNumberSequentialByRef_StdCall(new NumberSequentialByRefStdCallcaller(TestMethodForStructNumberSequential_ReversePInvokeByRef_StdCall)));
+                Assert.True(DoCallBack_MarshalStructNumberSequentialByRef_StdCall(new NumberSequentialByRefStdCallcaller(TestMethodForStructNumberSequential_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.S3Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS3ByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS3ByRef_StdCall(new S3ByRefStdCallcaller(TestMethodForStructS3_ReversePInvokeByRef_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS3ByRef_StdCall(new S3ByRefStdCallcaller(TestMethodForStructS3_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.S5Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS5ByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS5ByRef_StdCall(new S5ByRefStdCallcaller(TestMethodForStructS5_ReversePInvokeByRef_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS5ByRef_StdCall(new S5ByRefStdCallcaller(TestMethodForStructS5_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.StringStructSequentialAnsiId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_StdCall(
+                Assert.True(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_StdCall(
                     new StringStructSequentialAnsiByRefStdCallcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.StringStructSequentialUnicodeId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_StdCall(
+                Assert.True(DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_StdCall(
                     new StringStructSequentialUnicodeByRefStdCallcaller(TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.S8Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS8ByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS8ByRef_StdCall(new S8ByRefStdCallcaller(TestMethodForStructS8_ReversePInvokeByRef_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS8ByRef_StdCall(new S8ByRefStdCallcaller(TestMethodForStructS8_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.S9Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS9ByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS9ByRef_StdCall(new S9ByRefStdCallcaller(TestMethodForStructS9_ReversePInvokeByRef_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS9ByRef_StdCall(new S9ByRefStdCallcaller(TestMethodForStructS9_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.IncludeOuterIntergerStructSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall(
+                Assert.True(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall(
                     new IncludeOuterIntergerStructSequentialByRefStdCallcaller(TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_StdCall)));
                 break;
             case StructID.S11Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS11ByRef_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS11ByRef_StdCall(new S11ByRefStdCallcaller(TestMethodForStructS11_ReversePInvokeByRef_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS11ByRef_StdCall(new S11ByRefStdCallcaller(TestMethodForStructS11_ReversePInvokeByRef_StdCall)));
                 break;
             default:
-                Assert.Fail("DoCallBack_MarshalStructByRef_StdCall:The structid (Managed Side) is wrong");
+                Assert.True(false, "DoCallBack_MarshalStructByRef_StdCall:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -1636,73 +1636,73 @@ public class MarshalStructTest
         {
             case StructID.ComplexStructId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexeStructByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructComplexStructByVal_Cdecl(new ComplexStructByValCdeclcaller(TestMethodForStructComplexStruct_ReversePInvokeByVal_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructComplexStructByVal_Cdecl(new ComplexStructByValCdeclcaller(TestMethodForStructComplexStruct_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.InnerSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerSequentialByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructInnerSequentialByVal_Cdecl(new InnerSequentialByValCdeclcaller(TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructInnerSequentialByVal_Cdecl(new InnerSequentialByValCdeclcaller(TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.InnerArraySequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByVal_Cdecl(
+                Assert.True(DoCallBack_MarshalStructInnerArraySequentialByVal_Cdecl(
                     new InnerArraySequentialByValCdeclcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.CharSetAnsiSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_Cdecl
+                Assert.True(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_Cdecl
                     (new CharSetAnsiSequentialByValCdeclcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.CharSetUnicodeSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_Cdecl(
+                Assert.True(DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_Cdecl(
                     new CharSetUnicodeSequentialByValCdeclcaller(TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.NumberSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructNumberSequentialByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructNumberSequentialByVal_Cdecl(new NumberSequentialByValCdeclcaller(TestMethodForStructNumberSequential_ReversePInvokeByVal_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructNumberSequentialByVal_Cdecl(new NumberSequentialByValCdeclcaller(TestMethodForStructNumberSequential_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.S3Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS3ByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS3ByVal_Cdecl(new S3ByValCdeclcaller(TestMethodForStructS3_ReversePInvokeByVal_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS3ByVal_Cdecl(new S3ByValCdeclcaller(TestMethodForStructS3_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.S5Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS5ByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS5ByVal_Cdecl(new S5ByValCdeclcaller(TestMethodForStructS5_ReversePInvokeByVal_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS5ByVal_Cdecl(new S5ByValCdeclcaller(TestMethodForStructS5_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.StringStructSequentialAnsiId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_Cdecl(
+                Assert.True(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_Cdecl(
                     new StringStructSequentialAnsiByValCdeclcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.StringStructSequentialUnicodeId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_Cdecl(
+                Assert.True(DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_Cdecl(
                     new StringStructSequentialUnicodeByValCdeclcaller(TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.S8Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS8ByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS8ByVal_Cdecl(new S8ByValCdeclcaller(TestMethodForStructS8_ReversePInvokeByVal_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS8ByVal_Cdecl(new S8ByValCdeclcaller(TestMethodForStructS8_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.S9Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS9ByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS9ByVal_Cdecl(new S9ByValCdeclcaller(TestMethodForStructS9_ReversePInvokeByVal_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS9ByVal_Cdecl(new S9ByValCdeclcaller(TestMethodForStructS9_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.IncludeOuterIntergerStructSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl(
+                Assert.True(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl(
                     new IncludeOuterIntergerStructSequentialByValCdeclcaller(TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.S11Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS11ByVal_Cdecl...");
-                Assert.IsTrue(DoCallBack_MarshalStructS11ByVal_Cdecl(new S11ByValCdeclcaller(TestMethodForStructS11_ReversePInvokeByVal_Cdecl)));
+                Assert.True(DoCallBack_MarshalStructS11ByVal_Cdecl(new S11ByValCdeclcaller(TestMethodForStructS11_ReversePInvokeByVal_Cdecl)));
                 break;
             case StructID.ByteStruct3Byte:
                 Console.WriteLine("Calling DoCallBack_MarshalStructByVal_Cdecl_ByteStruct3Byte...");
-                Assert.IsTrue(DoCallBack_MarshalStructByVal_Cdecl_ByteStruct3Byte(
+                Assert.True(DoCallBack_MarshalStructByVal_Cdecl_ByteStruct3Byte(
                     new ByValCdeclcaller_ByteStruct3Byte(TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_Cdecl)));
                 break;
             default:
-                Assert.Fail("DoCallBack_MarshalStructByVal_Cdecl:The structid (Managed Side) is wrong");
+                Assert.True(false, "DoCallBack_MarshalStructByVal_Cdecl:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -1713,73 +1713,73 @@ public class MarshalStructTest
         {
             case StructID.ComplexStructId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexStructByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructComplexStructByVal_StdCall(new ComplexStructByValStdCallcaller(TestMethodForStructComplexStruct_ReversePInvokeByVal_StdCall)));
+                Assert.True(DoCallBack_MarshalStructComplexStructByVal_StdCall(new ComplexStructByValStdCallcaller(TestMethodForStructComplexStruct_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.InnerSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerSequentialByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructInnerSequentialByVal_StdCall(new InnerSequentialByValStdCallcaller(TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCall)));
+                Assert.True(DoCallBack_MarshalStructInnerSequentialByVal_StdCall(new InnerSequentialByValStdCallcaller(TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.InnerArraySequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByVal_StdCall(
+                Assert.True(DoCallBack_MarshalStructInnerArraySequentialByVal_StdCall(
                     new InnerArraySequentialByValStdCallcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.CharSetAnsiSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_StdCall(
+                Assert.True(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_StdCall(
                     new CharSetAnsiSequentialByValStdCallcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.CharSetUnicodeSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_StdCall(
+                Assert.True(DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_StdCall(
                     new CharSetUnicodeSequentialByValStdCallcaller(TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.NumberSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructNumberSequentialByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructNumberSequentialByVal_StdCall(new NumberSequentialByValStdCallcaller(TestMethodForStructNumberSequential_ReversePInvokeByVal_StdCall)));
+                Assert.True(DoCallBack_MarshalStructNumberSequentialByVal_StdCall(new NumberSequentialByValStdCallcaller(TestMethodForStructNumberSequential_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.S3Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS3ByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS3ByVal_StdCall(new S3ByValStdCallcaller(TestMethodForStructS3_ReversePInvokeByVal_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS3ByVal_StdCall(new S3ByValStdCallcaller(TestMethodForStructS3_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.S5Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS5ByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS5ByVal_StdCall(new S5ByValStdCallcaller(TestMethodForStructS5_ReversePInvokeByVal_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS5ByVal_StdCall(new S5ByValStdCallcaller(TestMethodForStructS5_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.StringStructSequentialAnsiId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_StdCall(
+                Assert.True(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_StdCall(
                     new StringStructSequentialAnsiByValStdCallcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.StringStructSequentialUnicodeId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_StdCall(
+                Assert.True(DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_StdCall(
                     new StringStructSequentialUnicodeByValStdCallcaller(TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.S8Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS8ByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS8ByVal_StdCall(new S8ByValStdCallcaller(TestMethodForStructS8_ReversePInvokeByVal_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS8ByVal_StdCall(new S8ByValStdCallcaller(TestMethodForStructS8_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.S9Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS9ByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS9ByVal_StdCall(new S9ByValStdCallcaller(TestMethodForStructS9_ReversePInvokeByVal_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS9ByVal_StdCall(new S9ByValStdCallcaller(TestMethodForStructS9_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.IncludeOuterIntergerStructSequentialId:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall(
+                Assert.True(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall(
                     new IncludeOuterIntergerStructSequentialByValStdCallcaller(TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.S11Id:
                 Console.WriteLine("Calling ReversePInvoke_MarshalStructS11ByVal_StdCall...");
-                Assert.IsTrue(DoCallBack_MarshalStructS11ByVal_StdCall(new S11ByValStdCallcaller(TestMethodForStructS11_ReversePInvokeByVal_StdCall)));
+                Assert.True(DoCallBack_MarshalStructS11ByVal_StdCall(new S11ByValStdCallcaller(TestMethodForStructS11_ReversePInvokeByVal_StdCall)));
                 break;
             case StructID.ByteStruct3Byte:
                 Console.WriteLine("Calling DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte...");
-                Assert.IsTrue(DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte(
+                Assert.True(DoCallBack_MarshalStructByVal_StdCall_ByteStruct3Byte(
                     new ByValStdCallcaller_ByteStruct3Byte(TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_StdCall)));
                 break;
             default:
-                Assert.Fail("DoCallBack_MarshalStructByVal_StdCall:The structid (Managed Side) is wrong");
+                Assert.True(false, "DoCallBack_MarshalStructByVal_StdCall:The structid (Managed Side) is wrong");
                 break;
         }
     }
@@ -1829,13 +1829,13 @@ public class MarshalStructTest
             TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID.ByteStruct3Byte);
         }
     }
-  
+
     #endregion
 
     static int Main()
     {
         try{
-            
+
         //Reverse Pinvoke,ByRef,cdecl
         Console.WriteLine("Run the methods for marshaling struct Reverse P/Invoke ByRef");
         Run_TestMethod_DoCallBack_MarshalStructByRef_Cdecl();
index b33941e..5d11f27 100644 (file)
@@ -6,7 +6,7 @@ using System.IO;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
-using TestLibrary;
+using Xunit;
 
 unsafe static class SuppressGCTransitionNative
 {
@@ -115,7 +115,7 @@ unsafe class SuppressGCTransitionTest
         Console.WriteLine($"{nameof(Inline_NoGCTransition)} ({expected}) ...");
         int n;
         int ret = SuppressGCTransitionNative.NextUInt_Inline_NoGCTransition(&n);
-        Assert.AreEqual(expected, n);
+        Assert.Equal(expected, n);
         CheckGCMode.Validate(transitionSuppressed: true, ret);
         return n + 1;
     }
@@ -125,7 +125,7 @@ unsafe class SuppressGCTransitionTest
         Console.WriteLine($"{nameof(Inline_GCTransition)} ({expected}) ...");
         int n;
         int ret = SuppressGCTransitionNative.NextUInt_Inline_GCTransition(&n);
-        Assert.AreEqual(expected, n);
+        Assert.Equal(expected, n);
         CheckGCMode.Validate(transitionSuppressed: false, ret);
         return n + 1;
     }
@@ -135,7 +135,7 @@ unsafe class SuppressGCTransitionTest
         Console.WriteLine($"{nameof(NoInline_NoGCTransition)} ({expected}) ...");
         int n;
         bool ret = SuppressGCTransitionNative.NextUInt_NoInline_NoGCTransition(&n);
-        Assert.AreEqual(expected, n);
+        Assert.Equal(expected, n);
         CheckGCMode.Validate(transitionSuppressed: true, ret);
         return n + 1;
     }
@@ -145,7 +145,7 @@ unsafe class SuppressGCTransitionTest
         Console.WriteLine($"{nameof(NoInline_GCTransition)} ({expected}) ...");
         int n;
         bool ret = SuppressGCTransitionNative.NextUInt_NoInline_GCTransition(&n);
-        Assert.AreEqual(expected, n);
+        Assert.Equal(expected, n);
         CheckGCMode.Validate(transitionSuppressed: false, ret);
         return n + 1;
     }
@@ -157,18 +157,18 @@ unsafe class SuppressGCTransitionTest
 
         {
             bool ret = SuppressGCTransitionNative.NextUInt_NoInline_GCTransition(&n);
-            Assert.AreEqual(expected++, n);
+            Assert.Equal(expected++, n);
             CheckGCMode.Validate(transitionSuppressed: false, ret);
             ret = SuppressGCTransitionNative.NextUInt_NoInline_NoGCTransition(&n);
-            Assert.AreEqual(expected++, n);
+            Assert.Equal(expected++, n);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             int ret = SuppressGCTransitionNative.NextUInt_Inline_GCTransition(&n);
-            Assert.AreEqual(expected++, n);
+            Assert.Equal(expected++, n);
             CheckGCMode.Validate(transitionSuppressed: false, ret);
             ret = SuppressGCTransitionNative.NextUInt_Inline_NoGCTransition(&n);
-            Assert.AreEqual(expected++, n);
+            Assert.Equal(expected++, n);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         return n + 1;
@@ -187,7 +187,7 @@ unsafe class SuppressGCTransitionTest
         // Use the non-optimized version at the end so a GC poll is not
         // inserted here as well.
         SuppressGCTransitionNative.NextUInt_NoInline_GCTransition(&n);
-        Assert.AreEqual(expected + count, n);
+        Assert.Equal(expected + count, n);
         return n + 1;
     }
     [MethodImpl(MethodImplOptions.NoInlining)]
@@ -196,7 +196,7 @@ unsafe class SuppressGCTransitionTest
         Console.WriteLine($"{nameof(Inline_NoGCTransition)} ({expected}) ...");
         int n;
         int ret = SuppressGCTransitionNative.GetNextUIntFunctionPointer_Inline_NoGCTransition()(&n);
-        Assert.AreEqual(expected, n);
+        Assert.Equal(expected, n);
         CheckGCMode.Validate(transitionSuppressed: true, ret);
         return n + 1;
     }
@@ -206,7 +206,7 @@ unsafe class SuppressGCTransitionTest
         Console.WriteLine($"{nameof(Inline_GCTransition)} ({expected}) ...");
         int n;
         int ret = SuppressGCTransitionNative.GetNextUIntFunctionPointer_Inline_GCTransition()(&n);
-        Assert.AreEqual(expected, n);
+        Assert.Equal(expected, n);
         CheckGCMode.Validate(transitionSuppressed: false, ret);
         return n + 1;
     }
@@ -216,7 +216,7 @@ unsafe class SuppressGCTransitionTest
         Console.WriteLine($"{nameof(NoInline_NoGCTransition)} ({expected}) ...");
         int n;
         bool ret = SuppressGCTransitionNative.GetNextUIntFunctionPointer_NoInline_NoGCTransition()(&n);
-        Assert.AreEqual(expected, n);
+        Assert.Equal(expected, n);
         CheckGCMode.Validate(transitionSuppressed: true, ret);
         return n + 1;
     }
@@ -226,7 +226,7 @@ unsafe class SuppressGCTransitionTest
         Console.WriteLine($"{nameof(NoInline_GCTransition)} ({expected}) ...");
         int n;
         bool ret = SuppressGCTransitionNative.GetNextUIntFunctionPointer_NoInline_GCTransition()(&n);
-        Assert.AreEqual(expected, n);
+        Assert.Equal(expected, n);
         CheckGCMode.Validate(transitionSuppressed: false, ret);
         return n + 1;
     }
@@ -244,7 +244,7 @@ unsafe class SuppressGCTransitionTest
 
         MethodInfo callNextUInt = typeof(FunctionPointer).GetMethod("Call_NextUInt");
         int ret = (int)callNextUInt.Invoke(null, new object[] { fptr, boxedN });
-        Assert.AreEqual(expected, n);
+        Assert.Equal(expected, n);
         CheckGCMode.Validate(transitionSuppressed: false, ret);
         return n + 1;
     }
@@ -273,7 +273,7 @@ unsafe class SuppressGCTransitionTest
         // Call function with same (blittable) signature, but without SuppressGCTransition.
         // IL stub should not be re-used, GC transition should occur, and callback should be invoked.
         SuppressGCTransitionNative.InvokeCallbackFuncPtr_Inline_GCTransition(&ReturnInt, &n);
-        Assert.AreEqual(expected++, n);
+        Assert.Equal(expected++, n);
 
         // Call function that has SuppressGCTransition
         SuppressGCTransitionNative.InvokeCallbackFuncPtr_NoInline_NoGCTransition(null, null);
@@ -281,7 +281,7 @@ unsafe class SuppressGCTransitionTest
         // Call function with same (non-blittable) signature, but without SuppressGCTransition
         // IL stub should not be re-used, GC transition should occur, and callback should be invoked.
         SuppressGCTransitionNative.InvokeCallbackFuncPtr_NoInline_GCTransition(&ReturnInt, &n);
-        Assert.AreEqual(expected++, n);
+        Assert.Equal(expected++, n);
 
         return n + 1;
     }
@@ -301,22 +301,22 @@ unsafe class SuppressGCTransitionTest
 
         // Call function that does not have SuppressGCTransition
         SuppressGCTransitionNative.InvokeCallbackVoidPtr_Inline_GCTransition(cb, &n);
-        Assert.AreEqual(expected++, n);
+        Assert.Equal(expected++, n);
 
         // Call function with same (blittable) signature, but with SuppressGCTransition.
         // IL stub should not be re-used, GC transition not should occur, and callback invocation should fail.
         SuppressGCTransitionNative.InvokeCallbackVoidPtr_Inline_NoGCTransition(cb, &n);
-        Assert.AreEqual(expected++, n);
+        Assert.Equal(expected++, n);
 
         // Call function that does not have SuppressGCTransition
         SuppressGCTransitionNative.InvokeCallbackVoidPtr_NoInline_GCTransition(cb, &n);
-        Assert.AreEqual(expected++, n);
+        Assert.Equal(expected++, n);
 
         // Call function with same (non-blittable) signature, but with SuppressGCTransition
         // IL stub should not be re-used, GC transition not should occur, and callback invocation should fail.
         expected = n + 1;
         SuppressGCTransitionNative.InvokeCallbackVoidPtr_NoInline_NoGCTransition(cb, &n);
-        Assert.AreEqual(expected++, n);
+        Assert.Equal(expected++, n);
 
         return n + 1;
     }
index 60dcc10..52e1d47 100644 (file)
@@ -8,7 +8,7 @@ using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Threading;
-using TestLibrary;
+using Xunit;
 
 public unsafe static class PInvokesCS
 {
index d6e0b16..ff95372 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Threading;
-using TestLibrary;
+using Xunit;
 
 public unsafe class Program
 {
@@ -24,19 +24,19 @@ public unsafe class Program
             Console.WriteLine($" -- default: UnmanagedCallConv()");
             int b;
             PInvokesCS.DefaultDllImport.Default.Blittable_Double_DefaultUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)");
             int b;
             PInvokesCS.DefaultDllImport.Cdecl.Blittable_Double_CdeclUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)");
             int b;
             PInvokesCS.DefaultDllImport.Stdcall.Blittable_Double_StdcallUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         if (ValidateMismatch)
@@ -56,19 +56,19 @@ public unsafe class Program
             Console.WriteLine($" -- default: UnmanagedCallConv()");
             int b;
             PInvokesCS.DefaultDllImport.Default.NotBlittable_Double_DefaultUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)");
             int b;
             PInvokesCS.DefaultDllImport.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)");
             int b;
             PInvokesCS.DefaultDllImport.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         if (ValidateMismatch)
@@ -88,19 +88,19 @@ public unsafe class Program
             Console.WriteLine($" -- default: UnmanagedCallConv()");
             int b;
             PInvokesCS.WinapiDllImport.Default.Blittable_Double_DefaultUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)");
             int b;
             PInvokesCS.WinapiDllImport.Cdecl.Blittable_Double_CdeclUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)");
             int b;
             PInvokesCS.WinapiDllImport.Stdcall.Blittable_Double_StdcallUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         if (ValidateMismatch)
@@ -120,19 +120,19 @@ public unsafe class Program
             Console.WriteLine($" -- default: UnmanagedCallConv()");
             int b;
             PInvokesCS.WinapiDllImport.Default.NotBlittable_Double_DefaultUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)");
             int b;
             PInvokesCS.WinapiDllImport.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)");
             int b;
             PInvokesCS.WinapiDllImport.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         if (ValidateMismatch)
@@ -152,19 +152,19 @@ public unsafe class Program
             Console.WriteLine($" -- default: UnmanagedCallConv()");
             int b;
             PInvokesIL.UnsetPInvokeImpl.Default.Blittable_Double_DefaultUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)");
             int b;
             PInvokesIL.UnsetPInvokeImpl.Cdecl.Blittable_Double_CdeclUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)");
             int b;
             PInvokesIL.UnsetPInvokeImpl.Stdcall.Blittable_Double_StdcallUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         if (ValidateMismatch)
@@ -184,19 +184,19 @@ public unsafe class Program
             Console.WriteLine($" -- default: UnmanagedCallConv()");
             int b;
             PInvokesIL.UnsetPInvokeImpl.Default.NotBlittable_Double_DefaultUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)");
             int b;
             PInvokesIL.UnsetPInvokeImpl.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)");
             int b;
             PInvokesIL.UnsetPInvokeImpl.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         if (ValidateMismatch)
@@ -216,42 +216,42 @@ public unsafe class Program
             Console.WriteLine($" -- default: SuppressGCTransition, UnmanagedCallConv()");
             int b;
             int ret = PInvokesCS.SuppressGCTransition.Default.Blittable_Double_DefaultUnmanagedCallConv_SuppressGCAttr(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- default: UnmanagedCallConv(suppressgctransition)");
             int b;
             int ret = PInvokesCS.SuppressGCTransition.Default.Blittable_Double_DefaultUnmanagedCallConv_SuppressGC(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- cdecl: SuppressGCTransition, UnmanagedCallConv(cdecl)");
             int b;
             int ret = PInvokesCS.SuppressGCTransition.Cdecl.Blittable_Double_CdeclUnmanagedCallConv_SuppressGCAttr(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl, suppressgctransition)");
             int b;
             int ret = PInvokesCS.SuppressGCTransition.Cdecl.Blittable_Double_CdeclUnmanagedCallConv_SuppressGC(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- stdcall: SuppressGCTransition, UnmanagedCallConv(stdcall)");
             int b;
             int ret = PInvokesCS.SuppressGCTransition.Stdcall.Blittable_Double_StdcallUnmanagedCallConv_SuppressGCAttr(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall, suppressgctransition)");
             int b;
             int ret = PInvokesCS.SuppressGCTransition.Stdcall.Blittable_Double_StdcallUnmanagedCallConv_SuppressGC(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
     }
@@ -266,42 +266,42 @@ public unsafe class Program
             Console.WriteLine($" -- default: SuppressGCTransition, UnmanagedCallConv()");
             int b;
             bool ret = PInvokesCS.SuppressGCTransition.Default.NotBlittable_Double_DefaultUnmanagedCallConv_SuppressGCAttr(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- default: UnmanagedCallConv(suppressgctransition)");
             int b;
             bool ret = PInvokesCS.SuppressGCTransition.Default.NotBlittable_Double_DefaultUnmanagedCallConv_SuppressGC(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- cdecl: SuppressGCTransition, UnmanagedCallConv(cdecl)");
             int b;
             bool ret = PInvokesCS.SuppressGCTransition.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv_SuppressGCAttr(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl, suppressgctransition)");
             int b;
             bool ret = PInvokesCS.SuppressGCTransition.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv_SuppressGC(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- stdcall: SuppressGCTransition, UnmanagedCallConv(stdcall)");
             int b;
             bool ret = PInvokesCS.SuppressGCTransition.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv_SuppressGCAttr(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
         {
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall, suppressgctransition)");
             int b;
             bool ret = PInvokesCS.SuppressGCTransition.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv_SuppressGC(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: true, ret);
         }
     }
@@ -318,14 +318,14 @@ public unsafe class Program
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(stdcall)");
             int b;
             PInvokesCS.MatchingDllImport.Cdecl.Blittable_Double_StdcallUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             // Should not suppress GC transition
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(suppressgctransition)");
             int b;
             int ret = PInvokesCS.MatchingDllImport.Cdecl.Blittable_Double_SuppressGCUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: false, ret);
         }
         {
@@ -333,14 +333,14 @@ public unsafe class Program
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(cdecl)");
             int b;
             PInvokesCS.MatchingDllImport.Stdcall.Blittable_Double_CdeclUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             // Should not suppress GC transition
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(suppressgctransition)");
             int b;
             int ret = PInvokesCS.MatchingDllImport.Stdcall.Blittable_Double_SuppressGCUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: false, ret);
         }
     }
@@ -357,14 +357,14 @@ public unsafe class Program
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(stdcall)");
             int b;
             PInvokesCS.MatchingDllImport.Cdecl.NotBlittable_Double_StdcallUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             // Should not suppress GC transition
             Console.WriteLine($" -- cdecl: UnmanagedCallConv(suppressgctransition)");
             int b;
             bool ret = PInvokesCS.MatchingDllImport.Cdecl.NotBlittable_Double_SuppressGCUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: false, ret);
         }
         {
@@ -372,14 +372,14 @@ public unsafe class Program
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(cdecl)");
             int b;
             PInvokesCS.MatchingDllImport.Stdcall.NotBlittable_Double_CdeclUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
         {
             // Should not suppress GC transition
             Console.WriteLine($" -- stdcall: UnmanagedCallConv(suppressgctransition)");
             int b;
             bool ret = PInvokesCS.MatchingDllImport.Stdcall.NotBlittable_Double_SuppressGCUnmanagedCallConv(a, &b);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
             CheckGCMode.Validate(transitionSuppressed: false, ret);
         }
     }
index fe10e63..5911af4 100644 (file)
@@ -8,7 +8,7 @@ using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Threading;
-using TestLibrary;
+using Xunit;
 using InvalidCSharp;
 
 public unsafe class Program
@@ -86,19 +86,19 @@ public unsafe class Program
     public static void TestUnmanagedCallersOnlyValid()
     {
         Console.WriteLine($"Running {nameof(TestUnmanagedCallersOnlyValid)}...");
-        
+
         int n = 12345;
         int expected = DoubleImpl(n);
-        Assert.AreEqual(expected, UnmanagedCallersOnlyDll.CallManagedProc((IntPtr)(delegate* unmanaged<int, int>)&ManagedDoubleCallback, n));    
+        Assert.Equal(expected, UnmanagedCallersOnlyDll.CallManagedProc((IntPtr)(delegate* unmanaged<int, int>)&ManagedDoubleCallback, n));
     }
 
     public static void TestUnmanagedCallersOnlyValid_OnNewNativeThread()
     {
         Console.WriteLine($"Running {nameof(TestUnmanagedCallersOnlyValid_OnNewNativeThread)}...");
-    
+
         int n = 12345;
         int expected = DoubleImpl(n);
-        Assert.AreEqual(expected, UnmanagedCallersOnlyDll.CallManagedProcOnNewThread((IntPtr)(delegate* unmanaged<int, int>)&ManagedDoubleCallback, n));
+        Assert.Equal(expected, UnmanagedCallersOnlyDll.CallManagedProcOnNewThread((IntPtr)(delegate* unmanaged<int, int>)&ManagedDoubleCallback, n));
     }
 
     [UnmanagedCallersOnly]
@@ -147,7 +147,7 @@ public unsafe class Program
         {
             expected += DoubleImpl(n);
         }
-        Assert.AreEqual(expected, UnmanagedCallersOnlyDll.CallManagedProcMultipleTimes(callCount, (IntPtr)(delegate* unmanaged<int, int>)&ManagedDoubleInNativeCallback, n));
+        Assert.Equal(expected, UnmanagedCallersOnlyDll.CallManagedProcMultipleTimes(callCount, (IntPtr)(delegate* unmanaged<int, int>)&ManagedDoubleInNativeCallback, n));
     }
 
     private const int CallbackThrowsErrorCode = 27;
@@ -164,7 +164,7 @@ public unsafe class Program
 
         int n = 12345;
         // Method should have thrown and caught an exception.
-        Assert.AreEqual(-1, UnmanagedCallersOnlyDll.CallManagedProcCatchException((IntPtr)(delegate* unmanaged<int, int>)&CallbackThrows, n));
+        Assert.Equal(-1, UnmanagedCallersOnlyDll.CallManagedProcCatchException((IntPtr)(delegate* unmanaged<int, int>)&CallbackThrows, n));
     }
 
     public static void NegativeTest_ViaDelegate()
@@ -194,7 +194,7 @@ public unsafe class Program
     [UnmanagedCallersOnly]
     public static int CallbackMethodNonBlittable(bool x1)
     {
-        Assert.Fail($"Functions with attribute {nameof(UnmanagedCallersOnlyAttribute)} cannot have non-blittable arguments");
+        Assert.True(false, $"Functions with attribute {nameof(UnmanagedCallersOnlyAttribute)} cannot have non-blittable arguments");
         return -1;
     }
 
@@ -210,7 +210,7 @@ public unsafe class Program
     public static void NegativeTest_InstantiatedGenericArguments()
     {
         Console.WriteLine($"Running {nameof(NegativeTest_InstantiatedGenericArguments)}...");
-        
+
         int n = 12345;
         // Try invoking method
         Assert.Throws<InvalidProgramException>(() => { UnmanagedCallersOnlyDll.CallManagedProc((IntPtr)(delegate* unmanaged<int, int>)&Callbacks.CallbackMethodGeneric<int>, n); });
@@ -228,7 +228,7 @@ public unsafe class Program
     [UnmanagedCallersOnly]
     public static void CallbackViaCalli(int val)
     {
-        Assert.Fail($"Functions with attribute {nameof(UnmanagedCallersOnlyAttribute)} cannot be called via calli");
+        Assert.True(false, $"Functions with attribute {nameof(UnmanagedCallersOnlyAttribute)} cannot be called via calli");
     }
 
     public static void NegativeTest_ViaCalli()
@@ -259,7 +259,7 @@ public unsafe class Program
         int n = 1234;
         int expected = DoubleImpl(n);
         delegate* unmanaged[Stdcall]<int, int> nativeMethod = &CallbackViaUnmanagedCalli;
-        Assert.AreEqual(expected, nativeMethod(n));
+        Assert.Equal(expected, nativeMethod(n));
     }
 
     [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
@@ -278,11 +278,11 @@ public unsafe class Program
         try
         {
             testNativeMethod(n);
-            Assert.Fail($"Function {nameof(CallbackViaUnmanagedCalliThrows)} should throw");
+            Assert.True(false, $"Function {nameof(CallbackViaUnmanagedCalliThrows)} should throw");
         }
         catch (Exception e)
         {
-            Assert.AreEqual(CallbackThrowsErrorCode, e.HResult);
+            Assert.Equal(CallbackThrowsErrorCode, e.HResult);
         }
     }
 
index 9e03629..663f3c2 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices.WindowsRuntime;
-using TestLibrary;
+using Xunit;
 
 namespace WinRT
 {
index e3c6da3..b2e6c50 100644 (file)
@@ -5,7 +5,7 @@ using System;
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-using TestLibrary;
+using Xunit;
 
 unsafe internal class CheckGCMode
 {
@@ -29,7 +29,7 @@ unsafe internal class CheckGCMode
         if (!Enabled)
             return;
 
-        Assert.AreEqual(transitionSuppressed, inCooperativeMode, $"GC transition should{(transitionSuppressed ? "" : " not")} have been suppressed");
+        Assert.Equal(transitionSuppressed, inCooperativeMode);
     }
 
     internal static void Validate(bool transitionSuppressed, int inCooperativeMode)
index 746150b..3563947 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
@@ -95,36 +95,36 @@ unsafe class CdeclMemberFunctionTest
     {
         CdeclMemberFunctionNative.SizeF result = instance->vtable->getSize(instance, 1234);
 
-        Assert.AreEqual(instance->width, result.width);
-        Assert.AreEqual(instance->height, result.height);
+        Assert.Equal(instance->width, result.width);
+        Assert.Equal(instance->height, result.height);
     }
 
     private static void Test4ByteHFA(CdeclMemberFunctionNative.C* instance)
     {
         CdeclMemberFunctionNative.Width result = instance->vtable->getWidth(instance);
 
-        Assert.AreEqual(instance->width, result.width);
+        Assert.Equal(instance->width, result.width);
     }
 
     private static void Test4ByteNonHFA(CdeclMemberFunctionNative.C* instance)
     {
         CdeclMemberFunctionNative.IntWrapper result = instance->vtable->getHeightAsInt(instance);
 
-        Assert.AreEqual((int)instance->height, result.i);
+        Assert.Equal((int)instance->height, result.i);
     }
 
     private static void TestEnum(CdeclMemberFunctionNative.C* instance)
     {
         CdeclMemberFunctionNative.E result = instance->vtable->getE(instance);
 
-        Assert.AreEqual(instance->dummy, result);
+        Assert.Equal(instance->dummy, result);
     }
 
     private static void TestCLong(CdeclMemberFunctionNative.C* instance)
     {
         CLong result = instance->vtable->getWidthAsLong(instance);
 
-        Assert.AreEqual((nint)instance->width, result.Value);
+        Assert.Equal((nint)instance->width, result.Value);
     }
 
     private static void Test8ByteHFAUnmanagedCallersOnly()
@@ -132,8 +132,8 @@ unsafe class CdeclMemberFunctionTest
         CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         CdeclMemberFunctionNative.SizeF result = CdeclMemberFunctionNative.GetSizeFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
-        Assert.AreEqual(c.height, result.height);
+        Assert.Equal(c.width, result.width);
+        Assert.Equal(c.height, result.height);
     }
 
     private static void Test4ByteHFAUnmanagedCallersOnly()
@@ -141,7 +141,7 @@ unsafe class CdeclMemberFunctionTest
         CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         CdeclMemberFunctionNative.Width result = CdeclMemberFunctionNative.GetWidthFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
+        Assert.Equal(c.width, result.width);
     }
 
     private static void Test4ByteNonHFAUnmanagedCallersOnly()
@@ -149,7 +149,7 @@ unsafe class CdeclMemberFunctionTest
         CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         CdeclMemberFunctionNative.IntWrapper result = CdeclMemberFunctionNative.GetHeightAsIntFromManaged(&c);
 
-        Assert.AreEqual((int)c.height, result.i);
+        Assert.Equal((int)c.height, result.i);
     }
 
     private static void TestEnumUnmanagedCallersOnly()
@@ -157,7 +157,7 @@ unsafe class CdeclMemberFunctionTest
         CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         CdeclMemberFunctionNative.E result = CdeclMemberFunctionNative.GetEFromManaged(&c);
 
-        Assert.AreEqual(c.dummy, result);
+        Assert.Equal(c.dummy, result);
     }
 
     private static void TestCLongUnmanagedCallersOnly()
@@ -165,7 +165,7 @@ unsafe class CdeclMemberFunctionTest
         CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         CLong result = CdeclMemberFunctionNative.GetWidthAsLongFromManaged(&c);
 
-        Assert.AreEqual((nint)c.width, result.Value);
+        Assert.Equal((nint)c.width, result.Value);
     }
 
     private static CdeclMemberFunctionNative.C CreateCWithUnmanagedCallersOnlyVTable(float width, float height)
index bb1429a..3afe617 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
@@ -95,36 +95,36 @@ unsafe class PlatformDefaultMemberFunctionTest
     {
         PlatformDefaultMemberFunctionNative.SizeF result = instance->vtable->getSize(instance, 1234);
 
-        Assert.AreEqual(instance->width, result.width);
-        Assert.AreEqual(instance->height, result.height);
+        Assert.Equal(instance->width, result.width);
+        Assert.Equal(instance->height, result.height);
     }
 
     private static void Test4ByteHFA(PlatformDefaultMemberFunctionNative.C* instance)
     {
         PlatformDefaultMemberFunctionNative.Width result = instance->vtable->getWidth(instance);
 
-        Assert.AreEqual(instance->width, result.width);
+        Assert.Equal(instance->width, result.width);
     }
 
     private static void Test4ByteNonHFA(PlatformDefaultMemberFunctionNative.C* instance)
     {
         PlatformDefaultMemberFunctionNative.IntWrapper result = instance->vtable->getHeightAsInt(instance);
 
-        Assert.AreEqual((int)instance->height, result.i);
+        Assert.Equal((int)instance->height, result.i);
     }
 
     private static void TestEnum(PlatformDefaultMemberFunctionNative.C* instance)
     {
         PlatformDefaultMemberFunctionNative.E result = instance->vtable->getE(instance);
 
-        Assert.AreEqual(instance->dummy, result);
+        Assert.Equal(instance->dummy, result);
     }
 
     private static void TestCLong(PlatformDefaultMemberFunctionNative.C* instance)
     {
         CLong result = instance->vtable->getWidthAsLong(instance);
 
-        Assert.AreEqual((nint)instance->width, result.Value);
+        Assert.Equal((nint)instance->width, result.Value);
     }
 
     private static void Test8ByteHFAUnmanagedCallersOnly()
@@ -132,8 +132,8 @@ unsafe class PlatformDefaultMemberFunctionTest
         PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         PlatformDefaultMemberFunctionNative.SizeF result = PlatformDefaultMemberFunctionNative.GetSizeFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
-        Assert.AreEqual(c.height, result.height);
+        Assert.Equal(c.width, result.width);
+        Assert.Equal(c.height, result.height);
     }
 
     private static void Test4ByteHFAUnmanagedCallersOnly()
@@ -141,7 +141,7 @@ unsafe class PlatformDefaultMemberFunctionTest
         PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         PlatformDefaultMemberFunctionNative.Width result = PlatformDefaultMemberFunctionNative.GetWidthFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
+        Assert.Equal(c.width, result.width);
     }
 
     private static void Test4ByteNonHFAUnmanagedCallersOnly()
@@ -149,7 +149,7 @@ unsafe class PlatformDefaultMemberFunctionTest
         PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         PlatformDefaultMemberFunctionNative.IntWrapper result = PlatformDefaultMemberFunctionNative.GetHeightAsIntFromManaged(&c);
 
-        Assert.AreEqual((int)c.height, result.i);
+        Assert.Equal((int)c.height, result.i);
     }
 
     private static void TestEnumUnmanagedCallersOnly()
@@ -157,7 +157,7 @@ unsafe class PlatformDefaultMemberFunctionTest
         PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         PlatformDefaultMemberFunctionNative.E result = PlatformDefaultMemberFunctionNative.GetEFromManaged(&c);
 
-        Assert.AreEqual(c.dummy, result);
+        Assert.Equal(c.dummy, result);
     }
 
     private static void TestCLongUnmanagedCallersOnly()
@@ -165,7 +165,7 @@ unsafe class PlatformDefaultMemberFunctionTest
         PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         CLong result = PlatformDefaultMemberFunctionNative.GetWidthAsLongFromManaged(&c);
 
-        Assert.AreEqual((nint)c.width, result.Value);
+        Assert.Equal((nint)c.width, result.Value);
     }
 
     private static PlatformDefaultMemberFunctionNative.C CreateCWithUnmanagedCallersOnlyVTable(float width, float height)
index f3480f0..fc9a9c8 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
@@ -95,44 +95,44 @@ unsafe class StdCallMemberFunctionTest
     {
         StdCallMemberFunctionNative.SizeF result = instance->vtable->getSize(instance, 1234);
 
-        Assert.AreEqual(instance->width, result.width);
-        Assert.AreEqual(instance->height, result.height);
+        Assert.Equal(instance->width, result.width);
+        Assert.Equal(instance->height, result.height);
     }
 
     private static void Test4ByteHFA(StdCallMemberFunctionNative.C* instance)
     {
         StdCallMemberFunctionNative.Width result = instance->vtable->getWidth(instance);
 
-        Assert.AreEqual(instance->width, result.width);
+        Assert.Equal(instance->width, result.width);
     }
 
     private static void Test4ByteNonHFA(StdCallMemberFunctionNative.C* instance)
     {
         StdCallMemberFunctionNative.IntWrapper result = instance->vtable->getHeightAsInt(instance);
 
-        Assert.AreEqual((int)instance->height, result.i);
+        Assert.Equal((int)instance->height, result.i);
     }
 
     private static void TestEnum(StdCallMemberFunctionNative.C* instance)
     {
         StdCallMemberFunctionNative.E result = instance->vtable->getE(instance);
 
-        Assert.AreEqual(instance->dummy, result);
+        Assert.Equal(instance->dummy, result);
     }
 
     private static void TestCLong(StdCallMemberFunctionNative.C* instance)
     {
         CLong result = instance->vtable->getWidthAsLong(instance);
 
-        Assert.AreEqual((nint)instance->width, result.Value);
+        Assert.Equal((nint)instance->width, result.Value);
     }
     private static void Test8ByteHFAUnmanagedCallersOnly()
     {
         StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         StdCallMemberFunctionNative.SizeF result = StdCallMemberFunctionNative.GetSizeFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
-        Assert.AreEqual(c.height, result.height);
+        Assert.Equal(c.width, result.width);
+        Assert.Equal(c.height, result.height);
     }
 
     private static void Test4ByteHFAUnmanagedCallersOnly()
@@ -140,7 +140,7 @@ unsafe class StdCallMemberFunctionTest
         StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         StdCallMemberFunctionNative.Width result = StdCallMemberFunctionNative.GetWidthFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
+        Assert.Equal(c.width, result.width);
     }
 
     private static void Test4ByteNonHFAUnmanagedCallersOnly()
@@ -148,7 +148,7 @@ unsafe class StdCallMemberFunctionTest
         StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         StdCallMemberFunctionNative.IntWrapper result = StdCallMemberFunctionNative.GetHeightAsIntFromManaged(&c);
 
-        Assert.AreEqual((int)c.height, result.i);
+        Assert.Equal((int)c.height, result.i);
     }
 
     private static void TestEnumUnmanagedCallersOnly()
@@ -156,7 +156,7 @@ unsafe class StdCallMemberFunctionTest
         StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         StdCallMemberFunctionNative.E result = StdCallMemberFunctionNative.GetEFromManaged(&c);
 
-        Assert.AreEqual(c.dummy, result);
+        Assert.Equal(c.dummy, result);
     }
 
     private static void TestCLongUnmanagedCallersOnly()
@@ -164,7 +164,7 @@ unsafe class StdCallMemberFunctionTest
         StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         CLong result = StdCallMemberFunctionNative.GetWidthAsLongFromManaged(&c);
 
-        Assert.AreEqual((nint)c.width, result.Value);
+        Assert.Equal((nint)c.width, result.Value);
     }
 
     private static StdCallMemberFunctionNative.C CreateCWithUnmanagedCallersOnlyVTable(float width, float height)
index 16ef813..51563e3 100644 (file)
@@ -4,7 +4,7 @@
 using System;
 using System.Reflection;
 using System.Text;
-using TestLibrary;
+using Xunit;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
@@ -115,8 +115,8 @@ unsafe class ThisCallTest
 
         ThisCallNative.SizeF result = callback(instance, 1234);
 
-        Assert.AreEqual(instance->width, result.width);
-        Assert.AreEqual(instance->height, result.height);
+        Assert.Equal(instance->width, result.width);
+        Assert.Equal(instance->height, result.height);
     }
 
     private static void Test4ByteHFA(ThisCallNative.C* instance)
@@ -125,7 +125,7 @@ unsafe class ThisCallTest
 
         ThisCallNative.Width result = callback(instance);
 
-        Assert.AreEqual(instance->width, result.width);
+        Assert.Equal(instance->width, result.width);
     }
 
     private static void Test4ByteNonHFA(ThisCallNative.C* instance)
@@ -134,7 +134,7 @@ unsafe class ThisCallTest
 
         ThisCallNative.IntWrapper result = callback(instance);
 
-        Assert.AreEqual((int)instance->height, result.i);
+        Assert.Equal((int)instance->height, result.i);
     }
 
     private static void TestEnum(ThisCallNative.C* instance)
@@ -143,7 +143,7 @@ unsafe class ThisCallTest
 
         ThisCallNative.E result = callback(instance);
 
-        Assert.AreEqual(instance->dummy, result);
+        Assert.Equal(instance->dummy, result);
     }
 
     private static void TestCLong(ThisCallNative.C* instance)
@@ -152,7 +152,7 @@ unsafe class ThisCallTest
 
         CLong result = callback(instance);
 
-        Assert.AreEqual((nint)instance->width, result.Value);
+        Assert.Equal((nint)instance->width, result.Value);
     }
 
     private static void Test8ByteHFAReverse()
@@ -160,8 +160,8 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f);
         ThisCallNative.SizeF result = ThisCallNative.GetSizeFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
-        Assert.AreEqual(c.height, result.height);
+        Assert.Equal(c.width, result.width);
+        Assert.Equal(c.height, result.height);
     }
 
     private static void Test4ByteHFAReverse()
@@ -169,7 +169,7 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f);
         ThisCallNative.Width result = ThisCallNative.GetWidthFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
+        Assert.Equal(c.width, result.width);
     }
 
     private static void Test4ByteNonHFAReverse()
@@ -177,7 +177,7 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f);
         ThisCallNative.IntWrapper result = ThisCallNative.GetHeightAsIntFromManaged(&c);
 
-        Assert.AreEqual((int)c.height, result.i);
+        Assert.Equal((int)c.height, result.i);
     }
 
     private static void TestEnumReverse()
@@ -185,7 +185,7 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f);
         ThisCallNative.E result = ThisCallNative.GetEFromManaged(&c);
 
-        Assert.AreEqual(c.dummy, result);
+        Assert.Equal(c.dummy, result);
     }
 
     private static void TestCLongReverse()
@@ -193,7 +193,7 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f);
         CLong result = ThisCallNative.GetWidthAsLongFromManaged(&c);
 
-        Assert.AreEqual((nint)c.width, result.Value);
+        Assert.Equal((nint)c.width, result.Value);
     }
 
     private static void Test8ByteHFAUnmanagedCallersOnly()
@@ -201,8 +201,8 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         ThisCallNative.SizeF result = ThisCallNative.GetSizeFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
-        Assert.AreEqual(c.height, result.height);
+        Assert.Equal(c.width, result.width);
+        Assert.Equal(c.height, result.height);
     }
 
     private static void Test4ByteHFAUnmanagedCallersOnly()
@@ -210,7 +210,7 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         ThisCallNative.Width result = ThisCallNative.GetWidthFromManaged(&c);
 
-        Assert.AreEqual(c.width, result.width);
+        Assert.Equal(c.width, result.width);
     }
 
     private static void Test4ByteNonHFAUnmanagedCallersOnly()
@@ -218,7 +218,7 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         ThisCallNative.IntWrapper result = ThisCallNative.GetHeightAsIntFromManaged(&c);
 
-        Assert.AreEqual((int)c.height, result.i);
+        Assert.Equal((int)c.height, result.i);
     }
 
     private static void TestEnumUnmanagedCallersOnly()
@@ -226,7 +226,7 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         ThisCallNative.E result = ThisCallNative.GetEFromManaged(&c);
 
-        Assert.AreEqual(c.dummy, result);
+        Assert.Equal(c.dummy, result);
     }
 
     private static void TestCLongUnmanagedCallersOnly()
@@ -234,7 +234,7 @@ unsafe class ThisCallTest
         ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f);
         CLong result = ThisCallNative.GetWidthAsLongFromManaged(&c);
 
-        Assert.AreEqual((nint)c.width, result.Value);
+        Assert.Equal((nint)c.width, result.Value);
     }
 
     private static ThisCallNative.C CreateCWithManagedVTable(float width, float height)
index 98279fb..bc991d0 100644 (file)
@@ -7,8 +7,6 @@ using System.Runtime.Loader;
 using TestLibrary;
 using Xunit;
 
-using Assert = Xunit.Assert;
-
 namespace AssemblyDependencyResolverTests
 {
     class AssemblyDependencyResolverTests : TestBase
@@ -37,10 +35,10 @@ namespace AssemblyDependencyResolverTests
             const string errorMessageFirstLine = "First line: failure";
             const string errorMessageSecondLine = "Second line: value";
 
-            using (HostPolicyMock.MockValues_corehost_set_error_writer errorWriterMock = 
+            using (HostPolicyMock.MockValues_corehost_set_error_writer errorWriterMock =
                 HostPolicyMock.Mock_corehost_set_error_writer())
             {
-                using (HostPolicyMock.MockValues_corehost_resolve_component_dependencies resolverMock = 
+                using (HostPolicyMock.MockValues_corehost_resolve_component_dependencies resolverMock =
                     HostPolicyMock.Mock_corehost_resolve_component_dependencies(
                         134,
                         "",
@@ -76,7 +74,7 @@ namespace AssemblyDependencyResolverTests
         public void TestComponentLoadFailureWithPreviousErrorWriter()
         {
             IntPtr previousWriter = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(
-                (HostPolicyMock.ErrorWriterDelegate)((string _) => { Assert.True(false, "Should never get here"); }));
+                (HostPolicyMock.ErrorWriterDelegate)((string _) => { Assert.True(false); }));
 
             using (HostPolicyMock.MockValues_corehost_set_error_writer errorWriterMock =
                 HostPolicyMock.Mock_corehost_set_error_writer(previousWriter))
@@ -105,7 +103,7 @@ namespace AssemblyDependencyResolverTests
             string assemblyDependencyPath = CreateMockAssembly("AssemblyDependency.dll");
 
             IntPtr previousWriter = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(
-                (HostPolicyMock.ErrorWriterDelegate)((string _) => { Assert.True(false, "Should never get here"); }));
+                (HostPolicyMock.ErrorWriterDelegate)((string _) => { Assert.True(false); }));
 
             using (HostPolicyMock.MockValues_corehost_set_error_writer errorWriterMock =
                 HostPolicyMock.Mock_corehost_set_error_writer(previousWriter))
index 48a436e..828a555 100644 (file)
@@ -3,15 +3,12 @@
 using System;
 using System.IO;
 using System.Runtime.Loader;
-using TestLibrary;
 using Xunit;
 
-using Assert = Xunit.Assert;
-
 namespace AssemblyDependencyResolverTests
 {
     class InvalidHostingTest
-    {        
+    {
         public static int Main(string [] args)
         {
             try
@@ -22,7 +19,7 @@ namespace AssemblyDependencyResolverTests
                 Directory.CreateDirectory(componentDirectory);
                 string componentAssemblyPath = Path.Combine(componentDirectory, "InvalidHostingComponent.dll");
                 File.WriteAllText(componentAssemblyPath, "Mock assembly");
-                
+
                 object innerException = Assert.Throws<InvalidOperationException>(() =>
                 {
                     AssemblyDependencyResolver resolver = new AssemblyDependencyResolver(
index de52a77..3ac42f5 100644 (file)
@@ -10,7 +10,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.Loader;
 using System.Runtime.Remoting;
 using System.Threading.Tasks;
-using TestLibrary;
+using Xunit;
 
 namespace ContextualReflectionTest
 {
@@ -60,7 +60,7 @@ namespace ContextualReflectionTest
                 defaultAssembly = Assembly.GetExecutingAssembly();
                 alcAssembly = alc.LoadFromAssemblyPath(defaultAssembly.Location);
 
-                Assert.AreEqual(alcAssembly, alc.LoadFromAssemblyName(alcAssembly.GetName()));
+                Assert.Equal(alcAssembly, alc.LoadFromAssemblyName(alcAssembly.GetName()));
 
                 alcProgramType = alcAssembly.GetType("ContextualReflectionTest.Program");
 
@@ -82,39 +82,39 @@ namespace ContextualReflectionTest
         void VerifyIsolationDefault()
         {
             VerifyIsolation();
-            Assert.AreEqual(defaultAssembly, Assembly.GetExecutingAssembly());
-            Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()));
-            Assert.AreNotEqual(alcProgramType, typeof(Program));
-            Assert.AreNotEqual((object)alcProgramInstance, (object)this);
+            Assert.Equal(defaultAssembly, Assembly.GetExecutingAssembly());
+            Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()));
+            Assert.NotEqual(alcProgramType, typeof(Program));
+            Assert.NotEqual((object)alcProgramInstance, (object)this);
         }
 
         void VerifyIsolationAlc()
         {
             VerifyIsolation();
-            Assert.AreEqual(alcAssembly, Assembly.GetExecutingAssembly());
-            Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()));
-            Assert.AreEqual(alcProgramType, typeof(Program));
-            Assert.AreEqual((object)alcProgramInstance, (object)this);
+            Assert.Equal(alcAssembly, Assembly.GetExecutingAssembly());
+            Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()));
+            Assert.Equal(alcProgramType, typeof(Program));
+            Assert.Equal((object)alcProgramInstance, (object)this);
         }
 
         void VerifyIsolation()
         {
-            Assert.AreEqual("Default", AssemblyLoadContext.Default.Name);
+            Assert.Equal("Default", AssemblyLoadContext.Default.Name);
 
-            Assert.IsNotNull(alc);
-            Assert.IsNotNull(alcAssembly);
-            Assert.IsNotNull(alcProgramType);
-            Assert.IsNotNull(alcProgramInstance);
+            Assert.NotNull(alc);
+            Assert.NotNull(alcAssembly);
+            Assert.NotNull(alcProgramType);
+            Assert.NotNull(alcProgramInstance);
 
-            Assert.AreEqual("Isolated", alc.Name);
+            Assert.Equal("Isolated", alc.Name);
 
-            Assert.AreNotEqual(defaultAssembly, alcAssembly);
-            Assert.AreNotEqual(alc, AssemblyLoadContext.Default);
+            Assert.NotEqual(defaultAssembly, alcAssembly);
+            Assert.NotEqual(alc, AssemblyLoadContext.Default);
 
-            Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(alcProgramInstance.alcAssembly));
-            Assert.AreEqual(alcAssembly, alcProgramInstance.alcAssembly);
-            Assert.AreEqual(alcProgramType, alcProgramInstance.alcProgramType);
-            Assert.AreEqual(alcProgramInstance, alcProgramInstance.alcProgramInstance);
+            Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(alcProgramInstance.alcAssembly));
+            Assert.Equal(alcAssembly, alcProgramInstance.alcAssembly);
+            Assert.Equal(alcProgramType, alcProgramInstance.alcProgramType);
+            Assert.Equal(alcProgramInstance, alcProgramInstance.alcProgramInstance);
         }
 
         void VerifyTestResolve()
@@ -133,160 +133,160 @@ namespace ContextualReflectionTest
 
         void VerifyContextualReflectionProxy()
         {
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             using (alc.EnterContextualReflection())
             {
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 using (AssemblyLoadContext.Default.EnterContextualReflection())
                 {
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
                     using (AssemblyLoadContext.EnterContextualReflection(null))
                     {
-                        Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+                        Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
                         using (AssemblyLoadContext.EnterContextualReflection(alcAssembly))
                         {
-                            Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                            Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                         }
-                        Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+                        Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
                     }
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
                 }
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
             }
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
         }
 
         void VerifyUsingStatementContextualReflectionUsage()
         {
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 using IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 using IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 alcScope.Dispose();
-                Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 using IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 alcScope.Dispose();
-                Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
                 alcScope.Dispose();
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 using IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 {
                     using IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection();
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
 
                 }
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 using IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 try
                 {
                     using IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection();
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
 
                     throw new InvalidOperationException();
                 }
                 catch
                 {
                 }
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 using IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 using IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection();
-                Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
                 defaultScope.Dispose();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 alcScope.Dispose();
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
         }
 
         void VerifyBadContextualReflectionUsage()
         {
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 alcScope.Dispose();
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 alcScope.Dispose();
                 alcScope.Dispose();
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection();
-                Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
                 defaultScope.Dispose();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 alcScope.Dispose();
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection();
-                Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext);
 
                 alcScope.Dispose();
-                Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
                 defaultScope.Dispose();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 alcScope.Dispose();
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
 
             {
                 IDisposable alcScope = alc.EnterContextualReflection();
-                Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
+                Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext);
                 try
                 {
                     IDisposable defaultScope = AssemblyLoadContext.EnterContextualReflection(null);
-                    Assert.AreEqual(null, AssemblyLoadContext.CurrentContextualReflectionContext);
+                    Assert.Equal(null, AssemblyLoadContext.CurrentContextualReflectionContext);
 
                     throw new InvalidOperationException();
                 }
@@ -295,7 +295,7 @@ namespace ContextualReflectionTest
                 }
             }
 
-            Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext);
+            Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext);
         }
 
         void TestResolveMissingAssembly(bool isolated, Action<string> action, bool skipNullIsolated = false)
@@ -335,31 +335,31 @@ namespace ContextualReflectionTest
             {
                 Assembly assembly = assemblyLoad("ContextualReflection");
 
-                Assert.AreEqual(isolated ? alc : AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(assembly));
+                Assert.Equal(isolated ? alc : AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(assembly));
 
                 Assembly depends = assemblyLoad("ContextualReflectionDependency");
 
-                Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends));
+                Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends));
             }
             using (AssemblyLoadContext.Default.EnterContextualReflection())
             {
                 Assembly assembly = assemblyLoad("ContextualReflection");
 
-                Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(assembly));
+                Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(assembly));
 
                 Assembly depends = assemblyLoad("ContextualReflectionDependency");
 
-                Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends));
+                Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends));
             }
             using (alc.EnterContextualReflection())
             {
                 Assembly assembly = assemblyLoad("ContextualReflection");
 
-                Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(assembly));
+                Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(assembly));
 
                 Assembly depends = assemblyLoad("ContextualReflectionDependency");
 
-                Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends));
+                Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends));
             }
         }
 
@@ -384,29 +384,29 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = Assembly.GetExecutingAssembly();
 
-                    Assert.IsNotNull(p);
-                    Assert.AreEqual(expectedAssembly, p.Assembly);
-                    Assert.AreEqual(typeof (Program), p);
+                    Assert.NotNull(p);
+                    Assert.Equal(expectedAssembly, p.Assembly);
+                    Assert.Equal(typeof (Program), p);
                 }
                 {
                     Type p = typeGetType("ContextualReflectionTest.Program, ContextualReflection");
 
                     Assembly expectedAssembly = Assembly.GetExecutingAssembly();
 
-                    Assert.IsNotNull(p);
-                    Assert.AreEqual(expectedAssembly, p.Assembly);
-                    Assert.AreEqual(typeof (Program), p);
+                    Assert.NotNull(p);
+                    Assert.Equal(expectedAssembly, p.Assembly);
+                    Assert.Equal(typeof (Program), p);
                 }
                 {
                     Type g = typeGetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]], ContextualReflection");
 
                     Assembly expectedAssembly = Assembly.GetExecutingAssembly();
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(expectedAssembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]);
-                    Assert.AreEqual(isolated ? alc : AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly));
+                    Assert.NotNull(g);
+                    Assert.Equal(expectedAssembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(typeof (Program), g.GenericTypeArguments[0]);
+                    Assert.Equal(isolated ? alc : AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly));
                 }
             }
             using (AssemblyLoadContext.Default.EnterContextualReflection())
@@ -416,29 +416,29 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = Assembly.GetExecutingAssembly();
 
-                    Assert.IsNotNull(p);
-                    Assert.AreEqual(expectedAssembly, p.Assembly);
-                    Assert.AreEqual(typeof (Program), p);
+                    Assert.NotNull(p);
+                    Assert.Equal(expectedAssembly, p.Assembly);
+                    Assert.Equal(typeof (Program), p);
                 }
                 {
                     Type p = typeGetType("ContextualReflectionTest.Program, ContextualReflection");
 
                     Assembly expectedAssembly = defaultAssembly;
 
-                    Assert.IsNotNull(p);
-                    Assert.AreEqual(expectedAssembly, p.Assembly);
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(p.Assembly));
+                    Assert.NotNull(p);
+                    Assert.Equal(expectedAssembly, p.Assembly);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(p.Assembly));
                 }
                 {
                     Type g = typeGetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]], ContextualReflection");
 
                     Assembly expectedAssembly = defaultAssembly;
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(expectedAssembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.Assembly));
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly));
+                    Assert.NotNull(g);
+                    Assert.Equal(expectedAssembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.Assembly));
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly));
                 }
             }
             using (alc.EnterContextualReflection())
@@ -448,29 +448,29 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = Assembly.GetExecutingAssembly();
 
-                    Assert.IsNotNull(p);
-                    Assert.AreEqual(expectedAssembly, p.Assembly);
-                    Assert.AreEqual(typeof (Program), p);
+                    Assert.NotNull(p);
+                    Assert.Equal(expectedAssembly, p.Assembly);
+                    Assert.Equal(typeof (Program), p);
                 }
                 {
                     Type p = typeGetType("ContextualReflectionTest.Program, ContextualReflection");
 
                     Assembly expectedAssembly = alcAssembly;
 
-                    Assert.IsNotNull(p);
-                    Assert.AreEqual(expectedAssembly, p.Assembly);
-                    Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(p.Assembly));
+                    Assert.NotNull(p);
+                    Assert.Equal(expectedAssembly, p.Assembly);
+                    Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(p.Assembly));
                 }
                 {
                     Type g = typeGetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]], ContextualReflection");
 
                     Assembly expectedAssembly = alcAssembly;
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(expectedAssembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(g.Assembly));
-                    Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly));
+                    Assert.NotNull(g);
+                    Assert.Equal(expectedAssembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(g.Assembly));
+                    Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly));
                 }
             }
         }
@@ -486,20 +486,20 @@ namespace ContextualReflectionTest
                 {
                     Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]", throwOnError : false);
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(typeof (Program), g.GenericTypeArguments[0]);
                 }
                 {
                     Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]", throwOnError : false);
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(typeof (Program), g.GenericTypeArguments[0]);
                 }
                 {
                     Assembly mscorlib = typeof (System.Collections.Generic.List<string>).Assembly;
@@ -508,9 +508,9 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = mscorlib;
 
-                    Assert.IsNotNull(m);
-                    Assert.AreEqual(expectedAssembly, m.Assembly);
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
+                    Assert.NotNull(m);
+                    Assert.Equal(expectedAssembly, m.Assembly);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
                 }
             }
             using (AssemblyLoadContext.Default.EnterContextualReflection())
@@ -518,20 +518,20 @@ namespace ContextualReflectionTest
                 {
                     Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]", throwOnError : false);
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(typeof (Program), g.GenericTypeArguments[0]);
                 }
                 {
                     Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]", throwOnError : false);
 
                     Assembly expectedAssembly = defaultAssembly;
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
                 }
                 {
                     Assembly mscorlib = typeof (System.Collections.Generic.List<string>).Assembly;
@@ -540,9 +540,9 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = mscorlib;
 
-                    Assert.IsNotNull(m);
-                    Assert.AreEqual(expectedAssembly, m.Assembly);
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
+                    Assert.NotNull(m);
+                    Assert.Equal(expectedAssembly, m.Assembly);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
                 }
             }
             using (alc.EnterContextualReflection())
@@ -550,20 +550,20 @@ namespace ContextualReflectionTest
                 {
                     Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]", throwOnError : false);
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(typeof (Program), g.GenericTypeArguments[0]);
                 }
                 {
                     Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]", throwOnError : false);
 
                     Assembly expectedAssembly = alcAssembly;
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
                 }
                 {
                     Assembly mscorlib = typeof (System.Collections.Generic.List<string>).Assembly;
@@ -572,9 +572,9 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = mscorlib;
 
-                    Assert.IsNotNull(m);
-                    Assert.AreEqual(expectedAssembly, m.Assembly);
-                    Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
+                    Assert.NotNull(m);
+                    Assert.Equal(expectedAssembly, m.Assembly);
+                    Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
                 }
             }
         }
@@ -597,21 +597,21 @@ namespace ContextualReflectionTest
                     ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]");
                     Type g = objectHandle.Unwrap().GetType();
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(typeof (Program), g.GenericTypeArguments[0]);
                 }
                 {
                     ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]");
                     Type g = objectHandle.Unwrap().GetType();
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(typeof (Program), g.GenericTypeArguments[0]);
                 }
                 {
                     ObjectHandle objectHandle = Activator.CreateInstance("ContextualReflection" , "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]");
@@ -619,9 +619,9 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = assembly;
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(expectedAssembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.NotNull(g);
+                    Assert.Equal(expectedAssembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
                 }
                 {
                     Assembly expectedAssembly = alcAssembly;
@@ -631,9 +631,9 @@ namespace ContextualReflectionTest
                     ObjectHandle objectHandle = Activator.CreateInstance(mscorlib.GetName().Name, "System.Collections.Generic.List`1[[ContextualReflectionTest.Program, ContextualReflection]]");
                     Type m = objectHandle.Unwrap().GetType();
 
-                    Assert.IsNotNull(m);
-                    Assert.AreEqual(mscorlib, m.Assembly);
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
+                    Assert.NotNull(m);
+                    Assert.Equal(mscorlib, m.Assembly);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
                 }
             }
             using (AssemblyLoadContext.Default.EnterContextualReflection())
@@ -642,11 +642,11 @@ namespace ContextualReflectionTest
                     ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]");
                     Type g = objectHandle.Unwrap().GetType();
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(typeof (Program), g.GenericTypeArguments[0]);
                 }
                 {
                     ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]");
@@ -654,9 +654,9 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = defaultAssembly;
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
                 }
                 {
                     ObjectHandle objectHandle = Activator.CreateInstance("ContextualReflection" , "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]");
@@ -664,9 +664,9 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = defaultAssembly;
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(expectedAssembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.NotNull(g);
+                    Assert.Equal(expectedAssembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
                 }
                 {
                     Assembly mscorlib = typeof (System.Collections.Generic.List<string>).Assembly;
@@ -676,9 +676,9 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = mscorlib;
 
-                    Assert.IsNotNull(m);
-                    Assert.AreEqual(expectedAssembly, m.Assembly);
-                    Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
+                    Assert.NotNull(m);
+                    Assert.Equal(expectedAssembly, m.Assembly);
+                    Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
                 }
             }
             using (alc.EnterContextualReflection())
@@ -687,11 +687,11 @@ namespace ContextualReflectionTest
                     ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]");
                     Type g = objectHandle.Unwrap().GetType();
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
-                    Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly);
+                    Assert.Equal(typeof (Program), g.GenericTypeArguments[0]);
                 }
                 {
                     ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]");
@@ -699,9 +699,9 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = alcAssembly;
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(assembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.NotNull(g);
+                    Assert.Equal(assembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
                 }
                 {
                     ObjectHandle objectHandle = Activator.CreateInstance("ContextualReflection" , "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]");
@@ -709,9 +709,9 @@ namespace ContextualReflectionTest
 
                     Assembly expectedAssembly = alcAssembly;
 
-                    Assert.IsNotNull(g);
-                    Assert.AreEqual(expectedAssembly, g.Assembly);
-                    Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly);
+                    Assert.NotNull(g);
+                    Assert.Equal(expectedAssembly, g.Assembly);
+                    Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly);
                 }
                 {
                     Assembly mscorlib = typeof (System.Collections.Generic.List<string>).Assembly;
@@ -719,9 +719,9 @@ namespace ContextualReflectionTest
                     ObjectHandle objectHandle = Activator.CreateInstance(mscorlib.GetName().Name, "System.Collections.Generic.List`1[[ContextualReflectionTest.Program, ContextualReflection]]");
                     Type m = objectHandle.Unwrap().GetType();
 
-                    Assert.IsNotNull(m);
-                    Assert.AreEqual(mscorlib, m.Assembly);
-                    Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
+                    Assert.NotNull(m);
+                    Assert.Equal(mscorlib, m.Assembly);
+                    Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly));
                 }
             }
         }
@@ -737,13 +737,13 @@ namespace ContextualReflectionTest
             }
 
             AssemblyLoadContext context = AssemblyLoadContext.GetLoadContext(assemblyBuilder);
-            Assert.AreEqual(assemblyLoadContext, context);
-            Assert.IsTrue(assemblyLoadContext.Assemblies.Any(a => AssemblyName.ReferenceMatchesDefinition(a.GetName(), assemblyBuilder.GetName())));
+            Assert.Equal(assemblyLoadContext, context);
+            Assert.True(assemblyLoadContext.Assemblies.Any(a => AssemblyName.ReferenceMatchesDefinition(a.GetName(), assemblyBuilder.GetName())));
         }
 
         void TestMockAssemblyThrows()
         {
-            Exception e = Assert.ThrowsArgumentException("activating", () => AssemblyLoadContext.EnterContextualReflection(new MockAssembly()));
+            Exception e = AssertExtensions.ThrowsArgumentException("activating", () => AssemblyLoadContext.EnterContextualReflection(new MockAssembly()));
         }
 
         public void RunTests()
index dd44f3c..f23c41b 100644 (file)
@@ -58,7 +58,7 @@ namespace ContextualReflectionTest
             }
             finally
             {
-                TestLibrary.Assert.AreEqual(expected, ResolveEvent);
+                Xunit.Assert.Equal(expected, ResolveEvent);
             }
         }
     }
index 9696ad2..56395b8 100644 (file)
@@ -8,7 +8,7 @@ using System.Linq;
 using System.Threading;
 using System.Reflection;
 
-using TestLibrary;
+using Xunit;
 
 namespace BinderTracingTests
 {
@@ -171,7 +171,7 @@ namespace BinderTracingTests
 
         public BindOperation[] WaitAndGetEventsForAssembly(AssemblyName assemblyName)
         {
-            Assert.IsTrue(IsLoadToTrack(assemblyName.Name), $"Waiting for load for untracked name: {assemblyName.Name}. Tracking loads for: {string.Join(", ", loadsToTrack)}");
+            Assert.True(IsLoadToTrack(assemblyName.Name), $"Waiting for load for untracked name: {assemblyName.Name}. Tracking loads for: {string.Join(", ", loadsToTrack)}");
 
             const int waitIntervalInMs = 50;
             int waitTimeoutInMs = Environment.GetEnvironmentVariable("COMPlus_GCStress") == null
@@ -232,7 +232,7 @@ namespace BinderTracingTests
 
                     lock (eventsLock)
                     {
-                        Assert.IsTrue(!bindOperations.ContainsKey(data.ActivityId), "AssemblyLoadStart should not exist for same activity ID ");
+                        Assert.True(!bindOperations.ContainsKey(data.ActivityId), "AssemblyLoadStart should not exist for same activity ID ");
                         bindOperation.Nested = bindOperations.ContainsKey(data.RelatedActivityId);
                         bindOperations.Add(data.ActivityId, bindOperation);
                         if (bindOperation.Nested)
@@ -253,7 +253,7 @@ namespace BinderTracingTests
                     lock (eventsLock)
                     {
                         if (!bindOperations.ContainsKey(data.ActivityId))
-                            Assert.Fail(GetMissingAssemblyBindStartMessage(data, $"Success={success}, Name={resultName}"));
+                            Assert.True(false, GetMissingAssemblyBindStartMessage(data, $"Success={success}, Name={resultName}"));
 
                         BindOperation bind = bindOperations[data.ActivityId];
                         bind.Success = success;
@@ -276,7 +276,7 @@ namespace BinderTracingTests
                     lock (eventsLock)
                     {
                         if (!bindOperations.ContainsKey(data.ActivityId))
-                            Assert.Fail(GetMissingAssemblyBindStartMessage(data, attempt.ToString()));
+                            Assert.True(false, GetMissingAssemblyBindStartMessage(data, attempt.ToString()));
 
                         BindOperation bind = bindOperations[data.ActivityId];
                         bind.ResolutionAttempts.Add(attempt);
@@ -292,7 +292,7 @@ namespace BinderTracingTests
                     lock (eventsLock)
                     {
                         if (!bindOperations.ContainsKey(data.ActivityId))
-                            Assert.Fail(GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString()));
+                            Assert.True(false, GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString()));
 
                         BindOperation bind = bindOperations[data.ActivityId];
                         bind.AssemblyLoadContextResolvingHandlers.Add(handlerInvocation);
@@ -308,7 +308,7 @@ namespace BinderTracingTests
                     lock (eventsLock)
                     {
                         if (!bindOperations.ContainsKey(data.ActivityId))
-                            Assert.Fail(GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString()));
+                            Assert.True(false, GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString()));
 
                         BindOperation bind = bindOperations[data.ActivityId];
                         bind.AppDomainAssemblyResolveHandlers.Add(handlerInvocation);
@@ -324,7 +324,7 @@ namespace BinderTracingTests
                     lock (eventsLock)
                     {
                         if (!bindOperations.ContainsKey(data.ActivityId))
-                            Assert.Fail(GetMissingAssemblyBindStartMessage(data, loadFrom.ToString()));
+                            Assert.True(false, GetMissingAssemblyBindStartMessage(data, loadFrom.ToString()));
 
                         BindOperation bind = bindOperations[data.ActivityId];
                         bind.AssemblyLoadFromHandler = loadFrom;
@@ -341,7 +341,7 @@ namespace BinderTracingTests
                     lock (eventsLock)
                     {
                         if (!bindOperations.ContainsKey(data.ActivityId))
-                            Assert.Fail(GetMissingAssemblyBindStartMessage(data, probedPath.ToString()));
+                            Assert.True(false, GetMissingAssemblyBindStartMessage(data, probedPath.ToString()));
 
                         BindOperation bind = bindOperations[data.ActivityId];
                         bind.ProbedPaths.Add(probedPath);
index d50d881..7a89445 100644 (file)
@@ -9,7 +9,7 @@ using System.Linq;
 using System.Reflection;
 using System.Runtime.Loader;
 
-using TestLibrary;
+using Xunit;
 
 namespace BinderTracingTests
 {
index 2777609..6a3ef07 100644 (file)
@@ -11,7 +11,7 @@ using System.Reflection;
 using System.Runtime.Loader;
 using System.Runtime.InteropServices;
 
-using TestLibrary;
+using Xunit;
 
 namespace BinderTracingTests
 {
index 89a809a..9596b84 100644 (file)
@@ -9,7 +9,7 @@ using System.Linq;
 using System.Reflection;
 using System.Runtime.Loader;
 
-using TestLibrary;
+using Xunit;
 
 namespace BinderTracingTests
 {
@@ -37,8 +37,8 @@ namespace BinderTracingTests
                 }
                 catch { }
 
-                Assert.AreEqual(1, handlers.Invocations.Count);
-                Assert.AreEqual(0, handlers.Binds.Count);
+                Assert.Equal(1, handlers.Invocations.Count);
+                Assert.Equal(0, handlers.Binds.Count);
                 return new BindOperation()
                 {
                     AssemblyName = assemblyName,
@@ -62,8 +62,8 @@ namespace BinderTracingTests
             {
                 Assembly asm = alc.LoadFromAssemblyName(assemblyName);
 
-                Assert.AreEqual(1, handlers.Invocations.Count);
-                Assert.AreEqual(1, handlers.Binds.Count);
+                Assert.Equal(1, handlers.Invocations.Count);
+                Assert.Equal(1, handlers.Binds.Count);
                 return new BindOperation()
                 {
                     AssemblyName = assemblyName,
@@ -87,8 +87,8 @@ namespace BinderTracingTests
             {
                 Assert.Throws<FileLoadException>(() => alc.LoadFromAssemblyName(assemblyName));
 
-                Assert.AreEqual(1, handlers.Invocations.Count);
-                Assert.AreEqual(1, handlers.Binds.Count);
+                Assert.Equal(1, handlers.Invocations.Count);
+                Assert.Equal(1, handlers.Binds.Count);
                 return new BindOperation()
                 {
                     AssemblyName = assemblyName,
@@ -111,10 +111,10 @@ namespace BinderTracingTests
             {
                 Assembly asm = alc.LoadFromAssemblyName(assemblyName);
 
-                Assert.AreEqual(1, handlerNull.Invocations.Count);
-                Assert.AreEqual(0, handlerNull.Binds.Count);
-                Assert.AreEqual(1, handlerLoad.Invocations.Count);
-                Assert.AreEqual(1, handlerLoad.Binds.Count);
+                Assert.Equal(1, handlerNull.Invocations.Count);
+                Assert.Equal(0, handlerNull.Binds.Count);
+                Assert.Equal(1, handlerLoad.Invocations.Count);
+                Assert.Equal(1, handlerLoad.Binds.Count);
                 return new BindOperation()
                 {
                     AssemblyName = assemblyName,
@@ -141,8 +141,8 @@ namespace BinderTracingTests
                 }
                 catch { }
 
-                Assert.AreEqual(1, handlers.Invocations.Count);
-                Assert.AreEqual(0, handlers.Binds.Count);
+                Assert.Equal(1, handlers.Invocations.Count);
+                Assert.Equal(0, handlers.Binds.Count);
                 return new BindOperation()
                 {
                     AssemblyName = assemblyName,
@@ -166,8 +166,8 @@ namespace BinderTracingTests
             {
                 Assembly asm = alc.LoadFromAssemblyName(assemblyName);
 
-                Assert.AreEqual(1, handlers.Invocations.Count);
-                Assert.AreEqual(1, handlers.Binds.Count);
+                Assert.Equal(1, handlers.Invocations.Count);
+                Assert.Equal(1, handlers.Binds.Count);
                 return new BindOperation()
                 {
                     AssemblyName = assemblyName,
@@ -192,8 +192,8 @@ namespace BinderTracingTests
                 // Result of AssemblyResolve event does not get checked for name mismatch
                 Assembly asm = alc.LoadFromAssemblyName(assemblyName);
 
-                Assert.AreEqual(1, handlers.Invocations.Count);
-                Assert.AreEqual(1, handlers.Binds.Count);
+                Assert.Equal(1, handlers.Invocations.Count);
+                Assert.Equal(1, handlers.Binds.Count);
                 return new BindOperation()
                 {
                     AssemblyName = assemblyName,
@@ -218,10 +218,10 @@ namespace BinderTracingTests
             {
                 Assembly asm = alc.LoadFromAssemblyName(assemblyName);
 
-                Assert.AreEqual(1, handlerNull.Invocations.Count);
-                Assert.AreEqual(0, handlerNull.Binds.Count);
-                Assert.AreEqual(1, handlerLoad.Invocations.Count);
-                Assert.AreEqual(1, handlerLoad.Binds.Count);
+                Assert.Equal(1, handlerNull.Invocations.Count);
+                Assert.Equal(0, handlerNull.Binds.Count);
+                Assert.Equal(1, handlerLoad.Invocations.Count);
+                Assert.Equal(1, handlerLoad.Binds.Count);
                 return new BindOperation()
                 {
                     AssemblyName = assemblyName,
@@ -283,7 +283,7 @@ namespace BinderTracingTests
             Assembly asm = Assembly.LoadFrom(assemblyPath);
             Type t = asm.GetType(DependentAssemblyTypeName);
             MethodInfo method = t.GetMethod("UseDependentAssembly", BindingFlags.Public | BindingFlags.Static);
-            Assert.Throws<TargetInvocationException, FileNotFoundException>(() => method.Invoke(null, new object[0]));
+            AssertExtensions.ThrowsWithInnerException<TargetInvocationException, FileNotFoundException>(() => method.Invoke(null, new object[0]));
 
             var assemblyName = new AssemblyName(asm.FullName);
             assemblyName.Name = "AssemblyToLoadDependency";
index 4ab8fc3..7801628 100644 (file)
@@ -7,7 +7,7 @@ using System.IO;
 using System.Reflection;
 using System.Runtime.Loader;
 
-using TestLibrary;
+using Xunit;
 
 using ResolutionStage = BinderTracingTests.ResolutionAttempt.ResolutionStage;
 using ResolutionResult = BinderTracingTests.ResolutionAttempt.ResolutionResult;
@@ -250,7 +250,7 @@ namespace BinderTracingTests
             var assemblyPath = Helpers.GetAssemblyInSubdirectoryPath(assemblyName.Name);
             CustomALC alc = new CustomALC(nameof(AssemblyLoadContextLoad), true /*throwOnLoad*/);
 
-            Assert.Throws<FileLoadException, Exception>(() => alc.LoadFromAssemblyName(assemblyName));
+            AssertExtensions.ThrowsWithInnerException<FileLoadException, Exception>(() => alc.LoadFromAssemblyName(assemblyName));
 
             return new BindOperation()
             {
@@ -412,7 +412,7 @@ namespace BinderTracingTests
             CustomALC alc = new CustomALC(nameof(AssemblyLoadContextResolvingEvent_CustomALC_Exception));
             using (var handlers = new Handlers(HandlerReturn.Exception, alc))
             {
-                Assert.Throws<FileLoadException, BinderTestException>(() => alc.LoadFromAssemblyName(assemblyName));
+                AssertExtensions.ThrowsWithInnerException<FileLoadException, BinderTestException>(() => alc.LoadFromAssemblyName(assemblyName));
 
                 return new BindOperation()
                 {
@@ -444,7 +444,7 @@ namespace BinderTracingTests
             var assemblyName = new AssemblyName(SubdirectoryAssemblyName);
             using (var handlers = new Handlers(HandlerReturn.Exception, AssemblyLoadContext.Default))
             {
-                Assert.Throws<FileLoadException, BinderTestException>(() => AssemblyLoadContext.Default.LoadFromAssemblyName(assemblyName));
+                AssertExtensions.ThrowsWithInnerException<FileLoadException, BinderTestException>(() => AssemblyLoadContext.Default.LoadFromAssemblyName(assemblyName));
 
                 return new BindOperation()
                 {
@@ -551,7 +551,7 @@ namespace BinderTracingTests
             CustomALC alc = new CustomALC(nameof(AppDomainAssemblyResolveEvent_Exception));
             using (var handlers = new Handlers(HandlerReturn.Exception))
             {
-                Assert.Throws<FileLoadException, BinderTestException>(() => alc.LoadFromAssemblyName(assemblyName));
+                AssertExtensions.ThrowsWithInnerException<FileLoadException, BinderTestException>(() => alc.LoadFromAssemblyName(assemblyName));
 
                 return new BindOperation()
                 {
@@ -585,7 +585,7 @@ namespace BinderTracingTests
 
             Assembly asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyPath);
 
-            Assert.AreNotEqual(assemblyPath, asm.Location);
+            Assert.NotEqual(assemblyPath, asm.Location);
             return new BindOperation()
             {
                 AssemblyName = asm.GetName(),
index 8eb4c93..d3f1fd8 100644 (file)
@@ -10,7 +10,7 @@ using System.Linq;
 using System.Reflection;
 using System.Runtime.Loader;
 
-using TestLibrary;
+using Xunit;
 
 namespace BinderTracingTests
 {
@@ -110,7 +110,7 @@ namespace BinderTracingTests
                     // Run specific test - first argument should be the test method name
                     MethodInfo method = typeof(BinderTracingTest)
                         .GetMethod(args[0], BindingFlags.Public | BindingFlags.Static);
-                    Assert.IsTrue(method != null && method.GetCustomAttribute<BinderTestAttribute>() != null && method.ReturnType == typeof(BindOperation), "Invalid test method specified");
+                    Assert.True(method != null && method.GetCustomAttribute<BinderTestAttribute>() != null && method.ReturnType == typeof(BindOperation));
                     success = RunSingleTest(method);
                 }
             }
@@ -150,7 +150,7 @@ namespace BinderTracingTests
                 {
                     MethodInfo setupMethod = method.DeclaringType
                         .GetMethod(attribute.TestSetup, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
-                    Assert.IsTrue(setupMethod != null);
+                    Assert.True(setupMethod != null);
                     setupMethod.Invoke(null, new object[0]);
                 }
 
@@ -209,7 +209,7 @@ namespace BinderTracingTests
         private static void ValidateSingleBind(BinderEventListener listener, AssemblyName assemblyName, BindOperation expected)
         {
             BindOperation[] binds = listener.WaitAndGetEventsForAssembly(assemblyName);
-            Assert.IsTrue(binds.Length == 1, $"Bind event count for {assemblyName} - expected: 1, actual: {binds.Length}");
+            Assert.True(binds.Length == 1, $"Bind event count for {assemblyName} - expected: 1, actual: {binds.Length}");
             BindOperation actual = binds[0];
 
             Helpers.ValidateBindOperation(expected, actual);
index caebad9..aee1dc1 100644 (file)
@@ -9,7 +9,7 @@ using System.Linq;
 using System.Reflection;
 using System.Runtime.Loader;
 
-using TestLibrary;
+using Xunit;
 
 namespace BinderTracingTests
 {
@@ -18,14 +18,14 @@ namespace BinderTracingTests
         public static void ValidateBindOperation(BindOperation expected, BindOperation actual)
         {
             ValidateAssemblyName(expected.AssemblyName, actual.AssemblyName, nameof(BindOperation.AssemblyName));
-            Assert.AreEqual(expected.AssemblyPath ?? string.Empty, actual.AssemblyPath, $"Unexpected value for {nameof(BindOperation.AssemblyPath)} on event");
-            Assert.AreEqual(expected.AssemblyLoadContext, actual.AssemblyLoadContext, $"Unexpected value for {nameof(BindOperation.AssemblyLoadContext)} on event");
-            Assert.AreEqual(expected.RequestingAssemblyLoadContext ?? string.Empty, actual.RequestingAssemblyLoadContext, $"Unexpected value for {nameof(BindOperation.RequestingAssemblyLoadContext)} on event");
+            Assert.Equal(expected.AssemblyPath ?? string.Empty, actual.AssemblyPath);
+            Assert.Equal(expected.AssemblyLoadContext, actual.AssemblyLoadContext);
+            Assert.Equal(expected.RequestingAssemblyLoadContext ?? string.Empty, actual.RequestingAssemblyLoadContext);
             ValidateAssemblyName(expected.RequestingAssembly, actual.RequestingAssembly, nameof(BindOperation.RequestingAssembly));
 
-            Assert.AreEqual(expected.Success, actual.Success, $"Unexpected value for {nameof(BindOperation.Success)} on event");
-            Assert.AreEqual(expected.ResultAssemblyPath ?? string.Empty, actual.ResultAssemblyPath, $"Unexpected value for {nameof(BindOperation.ResultAssemblyPath)} on event");
-            Assert.AreEqual(expected.Cached, actual.Cached, $"Unexpected value for {nameof(BindOperation.Cached)} on event");
+            Assert.Equal(expected.Success, actual.Success);
+            Assert.Equal(expected.ResultAssemblyPath ?? string.Empty, actual.ResultAssemblyPath);
+            Assert.Equal(expected.Cached, actual.Cached);
             ValidateAssemblyName(expected.ResultAssemblyName, actual.ResultAssemblyName, nameof(BindOperation.ResultAssemblyName));
 
             ValidateResolutionAttempts(expected.ResolutionAttempts, actual.ResolutionAttempts);
@@ -101,14 +101,13 @@ namespace BinderTracingTests
 
         private static void ValidateAssemblyName(AssemblyName expected, AssemblyName actual, string propertyName)
         {
-            Assert.IsTrue(AssemblyNamesMatch(expected, actual), $"Unexpected value for {propertyName} on event - expected: {expected}, actual: {actual}");
+            Assert.True(AssemblyNamesMatch(expected, actual), $"Unexpected value for {propertyName} on event - expected: {expected}, actual: {actual}");
         }
 
         private static void ValidateResolutionAttempts(List<ResolutionAttempt> expected, List<ResolutionAttempt> actual)
         {
             if (expected.Count > 0)
-                Assert.AreEqual(expected.Count, actual.Count,
-                    $"Unexpected resolution attempt count. Actual events:{Environment.NewLine}{string.Join(Environment.NewLine, actual.Select(a => a.ToString()))}");
+                Assert.Equal(expected.Count, actual.Count);
 
             for (var i = 0; i < expected.Count; i++)
             {
@@ -117,18 +116,18 @@ namespace BinderTracingTests
 
                 string expectedActualMessage = $"{Environment.NewLine}Expected resolution attempt:{Environment.NewLine}{e.ToString()}{Environment.NewLine}Actual resolution attempt:{Environment.NewLine}{a.ToString()}";
                 ValidateAssemblyName(e.AssemblyName, a.AssemblyName, nameof(ResolutionAttempt.AssemblyName));
-                Assert.AreEqual(e.Stage, a.Stage, $"Unexpected value for {nameof(ResolutionAttempt.Stage)} {expectedActualMessage}");
-                Assert.AreEqual(e.AssemblyLoadContext, a.AssemblyLoadContext, $"Unexpected value for {nameof(ResolutionAttempt.AssemblyLoadContext)} {expectedActualMessage}");
-                Assert.AreEqual(e.Result, a.Result, $"Unexpected value for {nameof(ResolutionAttempt.Result)} {expectedActualMessage}");
+                Assert.Equal(e.Stage, a.Stage);
+                Assert.Equal(e.AssemblyLoadContext, a.AssemblyLoadContext);
+                Assert.Equal(e.Result, a.Result);
                 ValidateAssemblyName(e.ResultAssemblyName, a.ResultAssemblyName, nameof(ResolutionAttempt.ResultAssemblyName));
-                Assert.AreEqual(e.ResultAssemblyPath ?? string.Empty, a.ResultAssemblyPath, $"Unexpected value for {nameof(ResolutionAttempt.ResultAssemblyPath)} {expectedActualMessage}");
-                Assert.AreEqual(e.ErrorMessage ?? string.Empty, a.ErrorMessage, $"Unexpected value for {nameof(ResolutionAttempt.ErrorMessage)} {expectedActualMessage}");
+                Assert.Equal(e.ResultAssemblyPath ?? string.Empty, a.ResultAssemblyPath);
+                Assert.Equal(e.ErrorMessage ?? string.Empty, a.ErrorMessage);
             }
         }
 
         private static void ValidateHandlerInvocations(List<HandlerInvocation> expected, List<HandlerInvocation> actual, string eventName)
         {
-            Assert.AreEqual(expected.Count, actual.Count, $"Unexpected handler invocation count for {eventName}");
+            Assert.Equal(expected.Count, actual.Count);
 
             foreach (var match in expected)
             {
@@ -138,7 +137,7 @@ namespace BinderTracingTests
                         && h.AssemblyLoadContext == match.AssemblyLoadContext
                         && AssemblyNamesMatch(h.ResultAssemblyName, match.ResultAssemblyName)
                         && (h.ResultAssemblyPath == match.ResultAssemblyPath || h.ResultAssemblyPath == "NULL" && match.ResultAssemblyPath == null);
-                Assert.IsTrue(actual.Exists(pred), $"Handler invocation not found: {match.ToString()}");
+                Assert.True(actual.Exists(pred), $"Handler invocation not found: {match.ToString()}");
             }
         }
 
@@ -146,22 +145,22 @@ namespace BinderTracingTests
         {
             if (expected == null || actual == null)
             {
-                Assert.IsNull(expected);
-                Assert.IsNull(actual);
+                Assert.Null(expected);
+                Assert.Null(actual);
                 return;
             }
 
             ValidateAssemblyName(expected.AssemblyName, actual.AssemblyName, nameof(LoadFromHandlerInvocation.AssemblyName));
-            Assert.AreEqual(expected.IsTrackedLoad, actual.IsTrackedLoad, $"Unexpected value for {nameof(LoadFromHandlerInvocation.IsTrackedLoad)} on event");
-            Assert.AreEqual(expected.RequestingAssemblyPath, actual.RequestingAssemblyPath, $"Unexpected value for {nameof(LoadFromHandlerInvocation.RequestingAssemblyPath)} on event");
+            Assert.Equal(expected.IsTrackedLoad, actual.IsTrackedLoad);
+            Assert.Equal(expected.RequestingAssemblyPath, actual.RequestingAssemblyPath);
 
             if (expected.ComputedRequestedAssemblyPath == null)
             {
-                Assert.AreEqual("NULL", actual.ComputedRequestedAssemblyPath, $"Unexpected value for {nameof(LoadFromHandlerInvocation.ComputedRequestedAssemblyPath)} on event");
+                Assert.Equal("NULL", actual.ComputedRequestedAssemblyPath);
             }
             else
             {
-                Assert.AreEqual(expected.ComputedRequestedAssemblyPath, actual.ComputedRequestedAssemblyPath, $"Unexpected value for {nameof(LoadFromHandlerInvocation.ComputedRequestedAssemblyPath)} on event");
+                Assert.Equal(expected.ComputedRequestedAssemblyPath, actual.ComputedRequestedAssemblyPath);
             }
         }
 
@@ -172,7 +171,7 @@ namespace BinderTracingTests
                 Predicate<ProbedPath> pred = p => p.FilePath == match.FilePath
                     && p.Source == match.Source
                     && p.Result == match.Result;
-                Assert.IsTrue(actual.Exists(pred), $"Probed path not found: {match.ToString()}");
+                Assert.True(actual.Exists(pred), $"Probed path not found: {match.ToString()}");
             }
         }
 
@@ -182,7 +181,7 @@ namespace BinderTracingTests
             {
                 ValidateBindOperation(bind1, bind2);
             }
-            catch (AssertTestException e)
+            catch (Xunit.Sdk.XunitException e)
             {
                 return false;
             }
@@ -195,7 +194,7 @@ namespace BinderTracingTests
             foreach (var match in expected)
             {
                 Predicate<BindOperation> pred = b => BindOperationsMatch(match, b);
-                Assert.IsTrue(actual.Exists(pred), $"Nested bind operation not found: {match.ToString()}");
+                Assert.True(actual.Exists(pred), $"Nested bind operation not found: {match.ToString()}");
             }
         }
     }
index cf51edf..0080960 100644 (file)
@@ -8,7 +8,7 @@ using System.Diagnostics;
 using System.Collections.Generic;
 using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
-using TestLibrary;
+using Xunit;
 
 class TestType1<T> { }
 class TestType2<T> { }
@@ -116,19 +116,19 @@ public class GenClass<T> : GenBase
     {
         Console.WriteLine("TEST: FuncOnGenClass<{0}>", typeof(T1).Name);
         for (int i = 0; i < max; i++)
-            Assert.AreEqual(o1.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T1)}" : $"TestType{i}`1[{typeof(T1)}]");
+            Assert.Equal(o1.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T1)}" : $"TestType{i}`1[{typeof(T1)}]");
 
         Console.WriteLine("TEST: FuncOnGenClass<{0}>", typeof(T2).Name);
         for (int i = 0; i < max; i++)
-            Assert.AreEqual(o2.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T2)}" : $"TestType{i}`1[{typeof(T2)}]");
+            Assert.Equal(o2.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T2)}" : $"TestType{i}`1[{typeof(T2)}]");
 
         Console.WriteLine("TEST: FuncOnGenClass2<{0}>", typeof(T2).Name);
         for (int i = 0; i < max; i++)
-            Assert.AreEqual(o2.FuncOnGenClass2(i).ToString(), i == 0 ? $"{typeof(T2)}" : $"TestType{i}`1[{typeof(T2)}]");
+            Assert.Equal(o2.FuncOnGenClass2(i).ToString(), i == 0 ? $"{typeof(T2)}" : $"TestType{i}`1[{typeof(T2)}]");
 
         Console.WriteLine("TEST: FuncOnGenClass<{0}>", typeof(T3).Name);
         for (int i = 0; i < max; i++)
-            Assert.AreEqual(o3.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T3)}" : $"TestType{i}`1[{typeof(T3)}]");
+            Assert.Equal(o3.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T3)}" : $"TestType{i}`1[{typeof(T3)}]");
     }
 
     public static void DoTest_GenClass(int max)
@@ -167,8 +167,8 @@ public class GenClass<T> : GenBase
     [MethodImpl(MethodImplOptions.NoInlining)]
     public override void VFunc()
     {
-        Assert.AreEqual(typeof(KeyValuePair<T, string>).ToString(), "System.Collections.Generic.KeyValuePair`2[System.Object,System.String]");
-        Assert.AreEqual(typeof(KeyValuePair<T, string>).ToString(), "System.Collections.Generic.KeyValuePair`2[System.Object,System.String]");
+        Assert.Equal(typeof(KeyValuePair<T, string>).ToString(), "System.Collections.Generic.KeyValuePair`2[System.Object,System.String]");
+        Assert.Equal(typeof(KeyValuePair<T, string>).ToString(), "System.Collections.Generic.KeyValuePair`2[System.Object,System.String]");
     }
 }
 
@@ -223,7 +223,7 @@ public class Test_DictionaryExpansion
             case 25: default: return typeof(TestType25<T>);
         }
     }
-    
+
     [MethodImpl(MethodImplOptions.NoInlining)]
     public static Type GFunc2<T>(int level)
     {
@@ -263,25 +263,25 @@ public class Test_DictionaryExpansion
     {
         Console.WriteLine("TEST: GFunc<string>");
         for(int i = 0; i < max; i++)
-            Assert.AreEqual(GFunc<string>(i).ToString(), i == 0 ? "System.String" : $"TestType{i}`1[System.String]");
+            Assert.Equal(GFunc<string>(i).ToString(), i == 0 ? "System.String" : $"TestType{i}`1[System.String]");
 
         Console.WriteLine("TEST: GFunc<object>(i)");
         for (int i = 0; i < max; i++)
-            Assert.AreEqual(GFunc<object>(i).ToString(), i == 0 ? "System.Object" : $"TestType{i}`1[System.Object]");
+            Assert.Equal(GFunc<object>(i).ToString(), i == 0 ? "System.Object" : $"TestType{i}`1[System.Object]");
 
         Console.WriteLine("TEST: GFunc2<object>(i)");
         for (int i = 0; i < max; i++)
-            Assert.AreEqual(GFunc2<object>(i).ToString(), i == 0 ? "System.Object" : $"TestType{i}`1[System.Object]");
+            Assert.Equal(GFunc2<object>(i).ToString(), i == 0 ? "System.Object" : $"TestType{i}`1[System.Object]");
 
         Console.WriteLine("TEST: GFunc<Test_DictionaryExpansion>(i)");
         for (int i = 0; i < max; i++)
-            Assert.AreEqual(GFunc<Test_DictionaryExpansion>(i).ToString(), i == 0 ? "Test_DictionaryExpansion" : $"TestType{i}`1[Test_DictionaryExpansion]");
+            Assert.Equal(GFunc<Test_DictionaryExpansion>(i).ToString(), i == 0 ? "Test_DictionaryExpansion" : $"TestType{i}`1[Test_DictionaryExpansion]");
     }
-    
+
     public static int Main()
     {
         GenBase deriv4 = new GenDerived4();
-        
+
         for(int i = 5; i <= 25; i += 5)
         {
             // Test for generic classes
@@ -304,7 +304,7 @@ public class Test_DictionaryExpansion
 
             // Test for generic methods
             DoTest(i);
-            
+
             {
                 AssemblyBuilder ab = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("CollectibleAsm"+i), AssemblyBuilderAccess.RunAndCollect);
                 var tb = ab.DefineDynamicModule("CollectibleMod" + i).DefineType("CollectibleGenDerived"+i, TypeAttributes.Public, typeof(GenDerived2));
@@ -323,7 +323,7 @@ public class Test_DictionaryExpansion
                 }
             }
         }
-        
+
         // After all expansions to existing dictionaries, use GenDerived4. GenDerived4 was allocated before any of its
         // base type dictionaries were expanded.
         for(int i = 0; i < 5; i++)
index 6ad86cf..b624c5a 100644 (file)
@@ -6,7 +6,7 @@ using System.IO;
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-using TestLibrary;
+using Xunit;
 
 unsafe class Program
 {
@@ -52,65 +52,64 @@ unsafe class Program
             // No modopt
             Console.WriteLine($" -- unmanaged");
             int b = CallFunctionPointers.CallUnmanagedIntInt(cbDefault, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged cdecl");
             int b = CallFunctionPointers.CallUnmanagedCdeclIntInt(cbCdecl, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged stdcall");
             int b = CallFunctionPointers.CallUnmanagedStdcallIntInt(cbStdcall, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged modopt(cdecl)");
             int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptCdecl(cbCdecl, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged modopt(stdcall)");
             int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall(cbStdcall, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             // Value in modopt is not a recognized calling convention
             Console.WriteLine($" -- unmanaged modopt unrecognized");
             int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptUnknown(cbDefault, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             // Multiple modopts with calling conventions
             Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(cdecl)");
             var ex = Assert.Throws<InvalidProgramException>(
-                () => CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall_ModOptCdecl(cbCdecl, a),
-                "Multiple modopts with calling conventions should fail");
-            Assert.AreEqual("Multiple unmanaged calling conventions are specified. Only a single calling convention is supported.", ex.Message);
+                () => CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall_ModOptCdecl(cbCdecl, a));
+            Assert.Equal("Multiple unmanaged calling conventions are specified. Only a single calling convention is supported.", ex.Message);
         }
 
         {
             Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(unrecognized)");
             int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall_ModOptUnknown(cbStdcall, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged cdecl modopt(stdcall)");
             int b = CallFunctionPointers.CallUnmanagedCdeclIntInt_ModOptStdcall(cbCdecl, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged stdcall modopt(cdecl)");
             int b = CallFunctionPointers.CallUnmanagedStdcallIntInt_ModOptCdecl(cbStdcall, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
     }
 
@@ -130,65 +129,64 @@ unsafe class Program
             // No modopt
             Console.WriteLine($" -- unmanaged");
             var b = CallFunctionPointers.CallUnmanagedCharChar(cbDefault, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged cdecl");
             var b = CallFunctionPointers.CallUnmanagedCdeclCharChar(cbCdecl, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged stdcall");
             var b = CallFunctionPointers.CallUnmanagedStdcallCharChar(cbStdcall, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged modopt(cdecl)");
             var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptCdecl(cbCdecl, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged modopt(stdcall)");
             var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall(cbStdcall, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             // Value in modopt is not a recognized calling convention
             Console.WriteLine($" -- unmanaged modopt(unrecognized)");
             var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptUnknown(cbDefault, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             // Multiple modopts with calling conventions
             Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(cdecl)");
             var ex = Assert.Throws<InvalidProgramException>(
-                () => CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall_ModOptCdecl(cbCdecl, a),
-                "Multiple modopts with calling conventions should fail");
-            Assert.AreEqual("Multiple unmanaged calling conventions are specified. Only a single calling convention is supported.", ex.Message);
+                () => CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall_ModOptCdecl(cbCdecl, a));
+            Assert.Equal("Multiple unmanaged calling conventions are specified. Only a single calling convention is supported.", ex.Message);
         }
 
         {
             Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(unrecognized)");
             var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall_ModOptUnknown(cbStdcall, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged cdecl modopt(stdcall)");
             var b = CallFunctionPointers.CallUnmanagedCdeclCharChar_ModOptStdcall(cbCdecl, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
 
         {
             Console.WriteLine($" -- unmanaged stdcall modopt(cdecl)");
             var b = CallFunctionPointers.CallUnmanagedStdcallCharChar_ModOptCdecl(cbStdcall, a);
-            Assert.AreEqual(expected, b);
+            Assert.Equal(expected, b);
         }
     }
 
index a65866e..047aa5d 100644 (file)
@@ -7,7 +7,7 @@ using System.Text;
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-using TestLibrary;
+using Xunit;
 using TypeEquivalenceTypes;
 
 public class Simple
@@ -33,7 +33,7 @@ public class Simple
 
         void AreNotSameObject(IEmptyType a, IEmptyType b)
         {
-            Assert.AreNotEqual(a, b);
+            Assert.NotEqual(a, b);
         }
     }
 
@@ -47,22 +47,22 @@ public class Simple
         Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType));
 
         // Sanity checks
-        Assert.IsTrue(inAsmInterfaceType == inAsmInterfaceType);
-        Assert.IsTrue(inAsmInterfaceType.IsEquivalentTo(inAsmInterfaceType));
-        Assert.IsFalse(inAsmInterfaceType.IsEquivalentTo(inAsm.GetType()));
-        Assert.IsTrue(otherAsmInterfaceType == otherAsmInterfaceType);
-        Assert.IsTrue(otherAsmInterfaceType.IsEquivalentTo(otherAsmInterfaceType));
-        Assert.IsFalse(otherAsmInterfaceType.IsEquivalentTo(otherAsm.GetType()));
+        Assert.True(inAsmInterfaceType == inAsmInterfaceType);
+        Assert.True(inAsmInterfaceType.IsEquivalentTo(inAsmInterfaceType));
+        Assert.False(inAsmInterfaceType.IsEquivalentTo(inAsm.GetType()));
+        Assert.True(otherAsmInterfaceType == otherAsmInterfaceType);
+        Assert.True(otherAsmInterfaceType.IsEquivalentTo(otherAsmInterfaceType));
+        Assert.False(otherAsmInterfaceType.IsEquivalentTo(otherAsm.GetType()));
 
         // The intrinsic equality operations should fail
-        Assert.IsFalse(inAsmInterfaceType == otherAsmInterfaceType);
-        Assert.IsFalse(inAsmInterfaceType.Equals(otherAsmInterfaceType));
-        Assert.IsFalse(otherAsmInterfaceType == inAsmInterfaceType);
-        Assert.IsFalse(otherAsmInterfaceType.Equals(inAsmInterfaceType));
+        Assert.False(inAsmInterfaceType == otherAsmInterfaceType);
+        Assert.False(inAsmInterfaceType.Equals(otherAsmInterfaceType));
+        Assert.False(otherAsmInterfaceType == inAsmInterfaceType);
+        Assert.False(otherAsmInterfaceType.Equals(inAsmInterfaceType));
 
         // Determination of equal types requires API call
-        Assert.IsTrue(inAsmInterfaceType.IsEquivalentTo(otherAsmInterfaceType));
-        Assert.IsTrue(otherAsmInterfaceType.IsEquivalentTo(inAsmInterfaceType));
+        Assert.True(inAsmInterfaceType.IsEquivalentTo(otherAsmInterfaceType));
+        Assert.True(otherAsmInterfaceType.IsEquivalentTo(inAsmInterfaceType));
     }
 
     private class MethodTestDerived : MethodTestBase
@@ -120,8 +120,8 @@ public class Simple
             int expectedBaseValue = input * baseScale;
             int expectedDerivedValue = expectedBaseValue * derivedScale;
 
-            Assert.AreEqual(expectedBaseValue, baseInterface.ScaleInt(input));
-            Assert.AreEqual(expectedDerivedValue, derivedBase.ScaleInt(input));
+            Assert.Equal(expectedBaseValue, baseInterface.ScaleInt(input));
+            Assert.Equal(expectedDerivedValue, derivedBase.ScaleInt(input));
         }
 
         {
@@ -129,8 +129,8 @@ public class Simple
             string expectedBaseValue = string.Concat(Enumerable.Repeat(input, baseScale));
             string expectedDerivedValue = string.Concat(Enumerable.Repeat(expectedBaseValue, derivedScale));
 
-            Assert.AreEqual(expectedBaseValue, baseInterface.ScaleString(input));
-            Assert.AreEqual(expectedDerivedValue, derivedBase.ScaleString(input));
+            Assert.Equal(expectedBaseValue, baseInterface.ScaleString(input));
+            Assert.Equal(expectedDerivedValue, derivedBase.ScaleString(input));
         }
     }
 
@@ -139,14 +139,14 @@ public class Simple
         Console.WriteLine($"{nameof(CallSparseInterface)}");
 
         int sparseTypeMethodCount = typeof(ISparseType).GetMethods(BindingFlags.Public | BindingFlags.Instance).Length;
-        Assert.AreEqual(2, sparseTypeMethodCount, "Should have limited method metadata");
+        Assert.Equal(2, sparseTypeMethodCount);
 
         var sparseType = (ISparseType)SparseTest.Create();
-        Assert.AreEqual(20, SparseTest.GetSparseInterfaceMethodCount(), "Should have all method metadata");
+        Assert.Equal(20, SparseTest.GetSparseInterfaceMethodCount());
 
         int input = 63;
-        Assert.AreEqual(input * 7, sparseType.MultiplyBy7(input));
-        Assert.AreEqual(input * 18, sparseType.MultiplyBy18(input));
+        Assert.Equal(input * 7, sparseType.MultiplyBy7(input));
+        Assert.Equal(input * 18, sparseType.MultiplyBy18(input));
     }
 
     private static void TestArrayEquivalence()
@@ -158,12 +158,12 @@ public class Simple
         Type inAsmInterfaceType = inAsm.GetType().GetInterface(nameof(IEmptyType));
         Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType));
 
-        Assert.IsTrue(inAsmInterfaceType.MakeArrayType().IsEquivalentTo(otherAsmInterfaceType.MakeArrayType()));
-        Assert.IsTrue(inAsmInterfaceType.MakeArrayType(1).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(1)));
-        Assert.IsTrue(inAsmInterfaceType.MakeArrayType(2).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(2)));
+        Assert.True(inAsmInterfaceType.MakeArrayType().IsEquivalentTo(otherAsmInterfaceType.MakeArrayType()));
+        Assert.True(inAsmInterfaceType.MakeArrayType(1).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(1)));
+        Assert.True(inAsmInterfaceType.MakeArrayType(2).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(2)));
 
-        Assert.IsFalse(inAsmInterfaceType.MakeArrayType().IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(1)));
-        Assert.IsFalse(inAsmInterfaceType.MakeArrayType(1).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(2)));
+        Assert.False(inAsmInterfaceType.MakeArrayType().IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(1)));
+        Assert.False(inAsmInterfaceType.MakeArrayType(1).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(2)));
     }
 
     private static void TestByRefEquivalence()
@@ -175,7 +175,7 @@ public class Simple
         Type inAsmInterfaceType = inAsm.GetType().GetInterface(nameof(IEmptyType));
         Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType));
 
-        Assert.IsTrue(inAsmInterfaceType.MakeByRefType().IsEquivalentTo(otherAsmInterfaceType.MakeByRefType()));
+        Assert.True(inAsmInterfaceType.MakeByRefType().IsEquivalentTo(otherAsmInterfaceType.MakeByRefType()));
     }
 
     interface IGeneric<in T>
@@ -199,7 +199,7 @@ public class Simple
         Type inAsmInterfaceType = inAsm.GetType().GetInterface(nameof(IEmptyType));
         Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType));
 
-        Assert.IsFalse(typeof(Generic<>).MakeGenericType(inAsmInterfaceType).IsEquivalentTo(typeof(Generic<>).MakeGenericType(otherAsmInterfaceType)));
+        Assert.False(typeof(Generic<>).MakeGenericType(inAsmInterfaceType).IsEquivalentTo(typeof(Generic<>).MakeGenericType(otherAsmInterfaceType)));
     }
 
     private static void TestGenericInterfaceEquivalence()
@@ -211,7 +211,7 @@ public class Simple
         Type inAsmInterfaceType = inAsm.GetType().GetInterface(nameof(IEmptyType));
         Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType));
 
-        Assert.IsTrue(typeof(IGeneric<>).MakeGenericType(inAsmInterfaceType).IsEquivalentTo(typeof(IGeneric<>).MakeGenericType(otherAsmInterfaceType)));
+        Assert.True(typeof(IGeneric<>).MakeGenericType(inAsmInterfaceType).IsEquivalentTo(typeof(IGeneric<>).MakeGenericType(otherAsmInterfaceType)));
     }
 
     public static int Main(string[] noArgs)