diff --git a/Directory.Packages.props b/Directory.Packages.props index 2d1b48d475..19c47a054e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -26,7 +26,7 @@ - + diff --git a/Jint.Tests.PublicInterface/Jint.Tests.PublicInterface.csproj b/Jint.Tests.PublicInterface/Jint.Tests.PublicInterface.csproj index 7db90bf78c..637c97f157 100644 --- a/Jint.Tests.PublicInterface/Jint.Tests.PublicInterface.csproj +++ b/Jint.Tests.PublicInterface/Jint.Tests.PublicInterface.csproj @@ -6,6 +6,7 @@ false 612 true + Exe @@ -24,7 +25,7 @@ - + diff --git a/Jint.Tests/Jint.Tests.csproj b/Jint.Tests/Jint.Tests.csproj index 767e50304a..0dd9381982 100644 --- a/Jint.Tests/Jint.Tests.csproj +++ b/Jint.Tests/Jint.Tests.csproj @@ -7,6 +7,7 @@ true false $(NoWarn);612 + Exe @@ -26,7 +27,7 @@ - + diff --git a/Jint.Tests/ReplaceCulture.cs b/Jint.Tests/ReplaceCulture.cs index 869cc5371d..ce32bcafc0 100644 --- a/Jint.Tests/ReplaceCulture.cs +++ b/Jint.Tests/ReplaceCulture.cs @@ -3,7 +3,7 @@ using System.Globalization; using System.Reflection; -using Xunit.Sdk; +using Xunit.v3; namespace Jint.Tests; @@ -64,7 +64,7 @@ public ReplaceCultureAttribute(string currentCulture, string currentUICulture) #endif public CultureInfo UICulture { get; } - public override void Before(MethodInfo methodUnderTest) + public override void Before(MethodInfo methodUnderTest, IXunitTest test) { _originalCulture = CultureInfo.CurrentCulture; _originalUICulture = CultureInfo.CurrentUICulture; @@ -73,20 +73,20 @@ public override void Before(MethodInfo methodUnderTest) System.Threading.Thread.CurrentThread.CurrentCulture = Culture; System.Threading.Thread.CurrentThread.CurrentUICulture = UICulture; #else - CultureInfo.CurrentCulture = Culture; - CultureInfo.CurrentUICulture = UICulture; + CultureInfo.CurrentCulture = Culture; + CultureInfo.CurrentUICulture = UICulture; #endif } - public override void After(MethodInfo methodUnderTest) + public override void After(MethodInfo methodUnderTest, IXunitTest test) { #if NETFRAMEWORK System.Threading.Thread.CurrentThread.CurrentCulture = _originalCulture; System.Threading.Thread.CurrentThread.CurrentUICulture = _originalUICulture; #else - CultureInfo.CurrentCulture = _originalCulture; - CultureInfo.CurrentUICulture = _originalUICulture; + CultureInfo.CurrentCulture = _originalCulture; + CultureInfo.CurrentUICulture = _originalUICulture; #endif } -} \ No newline at end of file +} diff --git a/Jint.Tests/RunnableInDebugOnlyAttribute.cs b/Jint.Tests/RunnableInDebugOnlyAttribute.cs index 2c974bc9d5..2fa8ef114f 100644 --- a/Jint.Tests/RunnableInDebugOnlyAttribute.cs +++ b/Jint.Tests/RunnableInDebugOnlyAttribute.cs @@ -1,14 +1,17 @@ using System.Diagnostics; +using System.Runtime.CompilerServices; namespace Jint.Tests; public class RunnableInDebugOnlyAttribute : FactAttribute { - public RunnableInDebugOnlyAttribute() + public RunnableInDebugOnlyAttribute( + [CallerFilePath] string sourceFilePath = null, + [CallerLineNumber] int sourceLineNumber = -1) : base(sourceFilePath, sourceLineNumber) { if (!Debugger.IsAttached) { Skip = "Only running in interactive mode."; } } -} \ No newline at end of file +} diff --git a/Jint.Tests/Runtime/AsyncTests.cs b/Jint.Tests/Runtime/AsyncTests.cs index fe350fb7a6..d63c605b2d 100644 --- a/Jint.Tests/Runtime/AsyncTests.cs +++ b/Jint.Tests/Runtime/AsyncTests.cs @@ -357,7 +357,7 @@ async function run(i) { } await Task.WhenAll(tasks.Select(t => t.Task)); - await Task.Delay(100); + await Task.Delay(100, TestContext.Current.CancellationToken); } } diff --git a/Jint.Tests/Runtime/EngineTests.cs b/Jint.Tests/Runtime/EngineTests.cs index ffe3914775..f56c5cd7da 100644 --- a/Jint.Tests/Runtime/EngineTests.cs +++ b/Jint.Tests/Runtime/EngineTests.cs @@ -7,7 +7,6 @@ using Jint.Runtime; using Jint.Runtime.Debugger; using Jint.Tests.Runtime.Debugger; -using Xunit.Abstractions; #pragma warning disable 618 diff --git a/Jint.Tests/Runtime/TypeConverterTests.cs b/Jint.Tests/Runtime/TypeConverterTests.cs index 781c893995..e35a02355b 100644 --- a/Jint.Tests/Runtime/TypeConverterTests.cs +++ b/Jint.Tests/Runtime/TypeConverterTests.cs @@ -1,6 +1,5 @@ using Jint.Native; using Jint.Runtime; -using Xunit.Abstractions; namespace Jint.Tests.Runtime; @@ -17,7 +16,7 @@ public TypeConverterTests(ITestOutputHelper output) ; } - public static readonly IEnumerable ConvertNumberToInt32AndUint32TestData = new TheoryData() + public static readonly TheoryData ConvertNumberToInt32AndUint32TestData = new() { { 0.0, 0 }, { -0.0, 0 }, @@ -91,4 +90,4 @@ public void ToPrimitiveShouldEvaluateOnlyOnceDuringInExpression() equal(1, bval); "); } -} \ No newline at end of file +} diff --git a/Jint.Tests/Runtime/WeakSetMapTests.cs b/Jint.Tests/Runtime/WeakSetMapTests.cs index 03cc5017f6..582eda7951 100644 --- a/Jint.Tests/Runtime/WeakSetMapTests.cs +++ b/Jint.Tests/Runtime/WeakSetMapTests.cs @@ -21,7 +21,7 @@ public void WeakSetShouldThrowWhenCalledWithoutNew() Assert.Equal("Constructor WeakSet requires 'new'", e.Message); } - public static IEnumerable PrimitiveKeys = new TheoryData + public static TheoryData PrimitiveKeys = new() { JsValue.Null, JsValue.Undefined,