Skip to content

Commit c5dd0a9

Browse files
authored
[xUnit3] Bump xUnit version (#8052)
1 parent f978022 commit c5dd0a9

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
</PropertyGroup>
2020
<PropertyGroup>
2121
<XunitVersion>2.8.1</XunitVersion>
22-
<Xunit3Version>2.0.1</Xunit3Version>
23-
<Xunit3RunnerVersion>3.0.2</Xunit3RunnerVersion>
22+
<Xunit3Version>3.2.2</Xunit3Version>
23+
<Xunit3RunnerVersion>3.1.5</Xunit3RunnerVersion>
2424
<XunitRunnerVersion>2.8.1</XunitRunnerVersion>
2525
<TestSdkVersion>17.9.0</TestSdkVersion>
2626
<HyperionVersion>0.12.2</HyperionVersion>

src/contrib/testkits/Akka.TestKit.Xunit/Attributes/LocalFactAttribute.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//-----------------------------------------------------------------------
77

88
using System;
9+
using System.Runtime.CompilerServices;
910
using Xunit;
1011
using Xunit.v3;
1112

@@ -24,7 +25,9 @@ namespace Akka.TestKit.Xunit.Attributes;
2425
/// </summary>
2526
[XunitTestCaseDiscoverer(typeof(FactDiscoverer))]
2627
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
27-
public class LocalFactAttribute: Attribute, IFactAttribute
28+
public class LocalFactAttribute(
29+
[CallerFilePath] string? sourceFilePath = null,
30+
[CallerLineNumber] int sourceLineNumber = -1): Attribute, IFactAttribute
2831
{
2932
private const string EnvironmentVariableName = "XUNIT_SKIP_LOCAL_FACT";
3033

@@ -48,6 +51,12 @@ public class LocalFactAttribute: Attribute, IFactAttribute
4851
/// <inheritdoc/>
4952
public string? SkipWhen { get; set; }
5053

54+
/// <inheritdoc/>
55+
public string? SourceFilePath { get; } = sourceFilePath;
56+
57+
/// <inheritdoc/>
58+
public int? SourceLineNumber { get; } = sourceLineNumber < 1 ? null : sourceLineNumber;
59+
5160
/// <inheritdoc/>
5261
public int Timeout { get; set; }
5362

src/contrib/testkits/Akka.TestKit.Xunit/Attributes/WindowsFactAttribute.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//-----------------------------------------------------------------------
77

88
using System;
9+
using System.Runtime.CompilerServices;
910
using Xunit.v3;
1011

1112
namespace Akka.TestKit.Xunit.Attributes
@@ -20,7 +21,9 @@ namespace Akka.TestKit.Xunit.Attributes
2021
/// set will always be skipped, regardless of the environment variable content.
2122
/// </para>
2223
/// </summary>
23-
public class WindowsFactAttribute : Attribute, IFactAttribute
24+
public class WindowsFactAttribute(
25+
[CallerFilePath] string? sourceFilePath = null,
26+
[CallerLineNumber] int sourceLineNumber = -1) : Attribute, IFactAttribute
2427
{
2528
private string? _skip;
2629

@@ -43,6 +46,12 @@ public class WindowsFactAttribute : Attribute, IFactAttribute
4346
/// <inheritdoc/>
4447
public string? SkipWhen { get; set; }
4548

49+
/// <inheritdoc/>
50+
public string? SourceFilePath { get; } = sourceFilePath;
51+
52+
/// <inheritdoc/>
53+
public int? SourceLineNumber { get; } = sourceLineNumber < 1 ? null : sourceLineNumber;
54+
4655
/// <inheritdoc/>
4756
public int Timeout { get; set; }
4857

0 commit comments

Comments
 (0)