What changed, and why it matters
This commit updates the project's test framework from xUnit version 2 to xUnit version 3. It only changes test code, package references, and compiler warning suppressions. There is no change to the production application that users interact with, and no security issue is introduced or fixed.
No security action required. Treat as routine dependency maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit bumps the test project to xunit.v3 3.2.2, removes now-unnecessary Xunit.Abstractions using statements across test classes, adds xUnit1051 to NoWarn, and adjusts a custom FactWithSecretAttribute constructor to accept optional caller-info parameters. All modifications are confined to the BTCPayServer.Tests project and its build configuration. No runtime/production code is affected.
Changed components
BTCPayServer.Tests projectxUnit test framework dependencyInspect captured patch +5 / −35
diff --git a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs
index a343130..de6f110 100644
--- a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs
+++ b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs
@@ -22,7 +22,6 @@ using NBitcoin;
using NBitpayClient;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
using PosViewType = BTCPayServer.Plugins.PointOfSale.PosViewType;
using WalletSettingsViewModel = BTCPayServer.Models.StoreViewModels.WalletSettingsViewModel;
diff --git a/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs b/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs
index 0f3acd4..9ded6f2 100644
--- a/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs
+++ b/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs
@@ -10,7 +10,6 @@ using NBitcoin;
using NBitcoin.Payment;
using NBitpayClient;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
diff --git a/BTCPayServer.Tests/ApiKeysTests.cs b/BTCPayServer.Tests/ApiKeysTests.cs
index 015ba98..8bfbd9d 100644
--- a/BTCPayServer.Tests/ApiKeysTests.cs
+++ b/BTCPayServer.Tests/ApiKeysTests.cs
@@ -20,7 +20,6 @@ using Microsoft.Playwright;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
diff --git a/BTCPayServer.Tests/BTCPayServer.Tests.csproj b/BTCPayServer.Tests/BTCPayServer.Tests.csproj
index a2387d2..fc47089 100644
--- a/BTCPayServer.Tests/BTCPayServer.Tests.csproj
+++ b/BTCPayServer.Tests/BTCPayServer.Tests.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="../Build/Common.csproj" />
<PropertyGroup>
- <NoWarn>$(NoWarn),xUnit1031</NoWarn>
+ <NoWarn>$(NoWarn),xUnit1031,xUnit1051</NoWarn>
<IsPackable>false</IsPackable>
<UserSecretsId>AB0AC1DD-9D26-485B-9416-56A33F268117</UserSecretsId>
<!--https://devblogs.microsoft.com/aspnet/testing-asp-net-core-mvc-web-apps-in-memory/-->
@@ -44,7 +44,7 @@
<PackageReference Include="Microsoft.Playwright" Version="1.57.0" />
<PackageReference Include="Newtonsoft.Json.Schema" Version="4.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.6" />
- <PackageReference Include="xunit" Version="2.9.3" />
+ <PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
diff --git a/BTCPayServer.Tests/BitpayTests.cs b/BTCPayServer.Tests/BitpayTests.cs
index fb4b624..335fcaf 100644
--- a/BTCPayServer.Tests/BitpayTests.cs
+++ b/BTCPayServer.Tests/BitpayTests.cs
@@ -20,7 +20,6 @@ using NBitcoin.Payment;
using NBitpayClient;
using Newtonsoft.Json;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests;
diff --git a/BTCPayServer.Tests/CheckoutUITests.cs b/BTCPayServer.Tests/CheckoutUITests.cs
index fac203d..f9825b5 100644
--- a/BTCPayServer.Tests/CheckoutUITests.cs
+++ b/BTCPayServer.Tests/CheckoutUITests.cs
@@ -6,7 +6,6 @@ using NBitcoin;
using Microsoft.Playwright;
using static Microsoft.Playwright.Assertions;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
diff --git a/BTCPayServer.Tests/CrowdfundTests.cs b/BTCPayServer.Tests/CrowdfundTests.cs
index 90fc02d..e5225f3 100644
--- a/BTCPayServer.Tests/CrowdfundTests.cs
+++ b/BTCPayServer.Tests/CrowdfundTests.cs
@@ -19,7 +19,6 @@ using Microsoft.AspNetCore.Mvc;
using NBitcoin;
using NBitpayClient;
using Xunit;
-using Xunit.Abstractions;
using static BTCPayServer.Tests.UnitTest1;
namespace BTCPayServer.Tests
diff --git a/BTCPayServer.Tests/DatabaseTests.cs b/BTCPayServer.Tests/DatabaseTests.cs
index 5462bc0..11cc847 100644
--- a/BTCPayServer.Tests/DatabaseTests.cs
+++ b/BTCPayServer.Tests/DatabaseTests.cs
@@ -11,7 +11,6 @@ using Microsoft.Extensions.Logging.Abstractions;
using NBitcoin;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
diff --git a/BTCPayServer.Tests/EmailsTests.cs b/BTCPayServer.Tests/EmailsTests.cs
index 65ee9df..1af7962 100644
--- a/BTCPayServer.Tests/EmailsTests.cs
+++ b/BTCPayServer.Tests/EmailsTests.cs
@@ -14,7 +14,6 @@ using Microsoft.Playwright;
using MimeKit;
using Newtonsoft.Json;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests;
diff --git a/BTCPayServer.Tests/FactWithSecretAttribute.cs b/BTCPayServer.Tests/FactWithSecretAttribute.cs
index c76eb75..05579cc 100644
--- a/BTCPayServer.Tests/FactWithSecretAttribute.cs
+++ b/BTCPayServer.Tests/FactWithSecretAttribute.cs
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.CompilerServices;
using Microsoft.Extensions.Configuration;
using Xunit;
using Xunit.Sdk;
@@ -7,7 +8,7 @@ namespace BTCPayServer.Tests
{
public class FactWithSecretAttribute : FactAttribute
{
- public FactWithSecretAttribute(string secret)
+ public FactWithSecretAttribute(string secret, [CallerFilePath] string sourceFilePath = null, [CallerLineNumber] int sourceLineNumber = -1) : base()
{
try
{
diff --git a/BTCPayServer.Tests/FastTests.cs b/BTCPayServer.Tests/FastTests.cs
index 17b1623..ab5dcbf 100644
--- a/BTCPayServer.Tests/FastTests.cs
+++ b/BTCPayServer.Tests/FastTests.cs
@@ -42,7 +42,6 @@ using NBXplorer.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
diff --git a/BTCPayServer.Tests/FormTests.cs b/BTCPayServer.Tests/FormTests.cs
index 0447dce..8ca89f3 100644
--- a/BTCPayServer.Tests/FormTests.cs
+++ b/BTCPayServer.Tests/FormTests.cs
@@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests;
diff --git a/BTCPayServer.Tests/GlobalSearchTests.cs b/BTCPayServer.Tests/GlobalSearchTests.cs
index 9398cae..0062218 100644
--- a/BTCPayServer.Tests/GlobalSearchTests.cs
+++ b/BTCPayServer.Tests/GlobalSearchTests.cs
@@ -7,7 +7,6 @@ using BTCPayServer.Plugins.GlobalSearch.Views;
using NBitcoin;
using Newtonsoft.Json;
using Xunit;
-using Xunit.Abstractions;
using static Microsoft.Playwright.Assertions;
namespace BTCPayServer.Tests;
diff --git a/BTCPayServer.Tests/GreenfieldAPITests.cs b/BTCPayServer.Tests/GreenfieldAPITests.cs
index a8e7f4e..83b1f58 100644
--- a/BTCPayServer.Tests/GreenfieldAPITests.cs
+++ b/BTCPayServer.Tests/GreenfieldAPITests.cs
@@ -38,7 +38,6 @@ using NBitpayClient;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
using Xunit.Sdk;
using CreateApplicationUserRequest = BTCPayServer.Client.Models.CreateApplicationUserRequest;
using PosViewType = BTCPayServer.Plugins.PointOfSale.PosViewType;
diff --git a/BTCPayServer.Tests/ImpersonationTests.cs b/BTCPayServer.Tests/ImpersonationTests.cs
index 16bf904..9bd06e9 100644
--- a/BTCPayServer.Tests/ImpersonationTests.cs
+++ b/BTCPayServer.Tests/ImpersonationTests.cs
@@ -3,7 +3,6 @@ using BTCPayServer.Views.Manage;
using BTCPayServer.Views.Server;
using BTCPayServer.Views.Stores;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests;
diff --git a/BTCPayServer.Tests/LanguageServiceTests.cs b/BTCPayServer.Tests/LanguageServiceTests.cs
index 42e5712..8513221 100644
--- a/BTCPayServer.Tests/LanguageServiceTests.cs
+++ b/BTCPayServer.Tests/LanguageServiceTests.cs
@@ -16,7 +16,6 @@ using Microsoft.Playwright;
using Newtonsoft.Json.Linq;
using static Microsoft.Playwright.Assertions;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
diff --git a/BTCPayServer.Tests/LightningTests.cs b/BTCPayServer.Tests/LightningTests.cs
index 06a433b..c299c02 100644
--- a/BTCPayServer.Tests/LightningTests.cs
+++ b/BTCPayServer.Tests/LightningTests.cs
@@ -19,7 +19,6 @@ using NBitcoin;
using NBitpayClient;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
using static Microsoft.Playwright.Assertions;
using CreateInvoiceRequest = BTCPayServer.Client.Models.CreateInvoiceRequest;
using BTCPayServer.Data;
diff --git a/BTCPayServer.Tests/Logging/Logs.cs b/BTCPayServer.Tests/Logging/Logs.cs
index d8ffc53..e185f93 100644
--- a/BTCPayServer.Tests/Logging/Logs.cs
+++ b/BTCPayServer.Tests/Logging/Logs.cs
@@ -1,7 +1,7 @@
using System;
using System.Text;
using Microsoft.Extensions.Logging;
-using Xunit.Abstractions;
+using Xunit;
namespace BTCPayServer.Tests.Logging
{
diff --git a/BTCPayServer.Tests/MonetizationTests.cs b/BTCPayServer.Tests/MonetizationTests.cs
index ce7bc92..3b81b07 100644
--- a/BTCPayServer.Tests/MonetizationTests.cs
+++ b/BTCPayServer.Tests/MonetizationTests.cs
@@ -8,7 +8,6 @@ using BTCPayServer.Services;
using BTCPayServer.Views.Server;
using Microsoft.Playwright;
using Xunit;
-using Xunit.Abstractions;
using static BTCPayServer.Tests.SubscriptionTests;
using static Microsoft.Playwright.Assertions;
diff --git a/BTCPayServer.Tests/MultisigTests.cs b/BTCPayServer.Tests/MultisigTests.cs
index 84d2fb7..46e0da6 100644
--- a/BTCPayServer.Tests/MultisigTests.cs
+++ b/BTCPayServer.Tests/MultisigTests.cs
@@ -6,7 +6,6 @@ using NBitcoin;
using NBXplorer.DerivationStrategy;
using NBXplorer.Models;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests;
diff --git a/BTCPayServer.Tests/POSTests.cs b/BTCPayServer.Tests/POSTests.cs
index c015c4c..9a7cd2e 100644
--- a/BTCPayServer.Tests/POSTests.cs
+++ b/BTCPayServer.Tests/POSTests.cs
@@ -26,7 +26,6 @@ using NBitcoin;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
using static BTCPayServer.Tests.UnitTest1;
using static Microsoft.Playwright.Assertions;
using PosViewType = BTCPayServer.Plugins.PointOfSale.PosViewType;
diff --git a/BTCPayServer.Tests/PSBTTests.cs b/BTCPayServer.Tests/PSBTTests.cs
index e1052dd..4585e02 100644
--- a/BTCPayServer.Tests/PSBTTests.cs
+++ b/BTCPayServer.Tests/PSBTTests.cs
@@ -1,7 +1,6 @@
using System.Threading.Tasks;
using NBitcoin;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
diff --git a/BTCPayServer.Tests/PayJoinTests.cs b/BTCPayServer.Tests/PayJoinTests.cs
index 4a180b4..5a0056b 100644
--- a/BTCPayServer.Tests/PayJoinTests.cs
+++ b/BTCPayServer.Tests/PayJoinTests.cs
@@ -28,7 +28,6 @@ using NBXplorer.Models;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
diff --git a/BTCPayServer.Tests/PaymentRequestTests.cs b/BTCPayServer.Tests/PaymentRequestTests.cs
index 91d1b4d..d048488 100644
--- a/BTCPayServer.Tests/PaymentRequestTests.cs
+++ b/BTCPayServer.Tests/PaymentRequestTests.cs
@@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Mvc;
using NBitcoin;
using NBitpayClient;
using Xunit;
-using Xunit.Abstractions;
// ReSharper disable AccessToModifiedClosure
namespace BTCPayServer.Tests
diff --git a/BTCPayServer.Tests/PlaywrightTests.cs b/BTCPayServer.Tests/PlaywrightTests.cs
index 2a6d129..824cef9 100644
--- a/BTCPayServer.Tests/PlaywrightTests.cs
+++ b/BTCPayServer.Tests/PlaywrightTests.cs
@@ -34,7 +34,6 @@ using NBXplorer;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
using static Microsoft.Playwright.Assertions;
namespace BTCPayServer.Tests
diff --git a/BTCPayServer.Tests/PullPaymentsTests.cs b/BTCPayServer.Tests/PullPaymentsTests.cs
index 44b21ce..df09253 100644
--- a/BTCPayServer.Tests/PullPaymentsTests.cs
+++ b/BTCPayServer.Tests/PullPaymentsTests.cs
@@ -20,7 +20,6 @@ using Microsoft.EntityFrameworkCore;
using NBitcoin;
using NBitcoin.DataEncoders;
using Xunit;
-using Xunit.Abstractions;
using static Microsoft.Playwright.Assertions;
using PayoutData = BTCPayServer.Data.PayoutData;
diff --git a/BTCPayServer.Tests/RolesTests.cs b/BTCPayServer.Tests/RolesTests.cs
index bb4eb33..2e63eb7 100644
--- a/BTCPayServer.Tests/RolesTests.cs
+++ b/BTCPayServer.Tests/RolesTests.cs
@@ -16,7 +16,6 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Playwright;
using Xunit;
-using Xunit.Abstractions;
using static Microsoft.Playwright.Assertions;
namespace BTCPayServer.Tests;
diff --git a/BTCPayServer.Tests/SubscriptionTests.cs b/BTCPayServer.Tests/SubscriptionTests.cs
index ccb548a..5c47419 100644
--- a/BTCPayServer.Tests/SubscriptionTests.cs
+++ b/BTCPayServer.Tests/SubscriptionTests.cs
@@ -21,7 +21,6 @@ using NBitcoin;
using NBXplorer;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
using static Microsoft.Playwright.Assertions;
namespace BTCPayServer.Tests;
diff --git a/BTCPayServer.Tests/ThirdPartyTests.cs b/BTCPayServer.Tests/ThirdPartyTests.cs
index 74b2adc..4e5841c 100644
--- a/BTCPayServer.Tests/ThirdPartyTests.cs
+++ b/BTCPayServer.Tests/ThirdPartyTests.cs
@@ -24,7 +24,6 @@ using NBitcoin;
using NBitpayClient;
using Newtonsoft.Json;
using Xunit;
-using Xunit.Abstractions;
using Xunit.Sdk;
namespace BTCPayServer.Tests
diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs
index dc2764d..fcba51b 100644
--- a/BTCPayServer.Tests/UnitTest1.cs
+++ b/BTCPayServer.Tests/UnitTest1.cs
@@ -62,7 +62,6 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema;
using Xunit;
-using Xunit.Abstractions;
using Xunit.Sdk;
using CreateInvoiceRequest = BTCPayServer.Client.Models.CreateInvoiceRequest;
using RatesViewModel = BTCPayServer.Models.StoreViewModels.RatesViewModel;
diff --git a/BTCPayServer.Tests/UnitTestBase.cs b/BTCPayServer.Tests/UnitTestBase.cs
index 9356ac1..b35c0cf 100644
--- a/BTCPayServer.Tests/UnitTestBase.cs
+++ b/BTCPayServer.Tests/UnitTestBase.cs
@@ -8,7 +8,6 @@ using BTCPayServer.Plugins;
using BTCPayServer.Tests.Logging;
using Microsoft.Extensions.DependencyInjection;
using NBXplorer;
-using Xunit.Abstractions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Memory;
using NBitcoin;
diff --git a/BTCPayServer.Tests/UtilitiesTests.cs b/BTCPayServer.Tests/UtilitiesTests.cs
index 4a03e08..8f5ccde 100644
--- a/BTCPayServer.Tests/UtilitiesTests.cs
+++ b/BTCPayServer.Tests/UtilitiesTests.cs
@@ -17,7 +17,6 @@ using NBitcoin;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests
{
diff --git a/BTCPayServer.Tests/WalletTests.cs b/BTCPayServer.Tests/WalletTests.cs
index 19a006a..a10af7f 100644
--- a/BTCPayServer.Tests/WalletTests.cs
+++ b/BTCPayServer.Tests/WalletTests.cs
@@ -18,7 +18,6 @@ using NBitcoin;
using NBitcoin.Payment;
using NBXplorer.Models;
using Xunit;
-using Xunit.Abstractions;
namespace BTCPayServer.Tests;
diff --git a/BTCPayServer.Tests/WebhooksTests.cs b/BTCPayServer.Tests/WebhooksTests.cs
index f2d0193..5da9a07 100644
--- a/BTCPayServer.Tests/WebhooksTests.cs
+++ b/BTCPayServer.Tests/WebhooksTests.cs
@@ -14,7 +14,6 @@ using NBitcoin.Payment;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
-using Xunit.Abstractions;
using static Microsoft.Playwright.Assertions;
// ReSharper disable ParameterOnlyUsedForPreconditionCheck.Local
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.