diff --git a/BTCPayServer.Plugins.Test/Views/Shared/TestExtensionNavExtension.cshtml b/BTCPayServer.Plugins.Test/Views/Shared/TestExtensionNavExtension.cshtml
index 37530f946..9a7c63ae5 100644
--- a/BTCPayServer.Plugins.Test/Views/Shared/TestExtensionNavExtension.cshtml
+++ b/BTCPayServer.Plugins.Test/Views/Shared/TestExtensionNavExtension.cshtml
@@ -1,2 +1,2 @@
-
Dear Nicolas Dorier
+Dear Nicolas Dorier
diff --git a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs
index 5e7598f76..8167d685c 100644
--- a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs
+++ b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs
@@ -69,7 +69,7 @@ namespace BTCPayServer.Tests
Assert.Equal(3, invoice.CryptoInfo.Length);
- var controller = user.GetController();
+ var controller = user.GetController();
var lightningVm = (LightningNodeViewModel)Assert.IsType(await controller.SetupLightningNode(user.StoreId, cryptoCode)).Model;
Assert.True(lightningVm.Enabled);
var response = await controller.SetLightningNodeEnabled(user.StoreId, cryptoCode, false);
@@ -200,7 +200,7 @@ namespace BTCPayServer.Tests
invoice = user.BitPay.GetInvoice(invoice.Id);
Assert.Equal("paid", invoice.Status);
});
- var wallet = tester.PayTester.GetController();
+ var wallet = tester.PayTester.GetController();
var psbt = wallet.CreatePSBT(btcNetwork, onchainBTC,
new WalletSendModel()
{
@@ -310,7 +310,7 @@ namespace BTCPayServer.Tests
Assert.Single(invoice.CryptoInfo); // Only BTC should be presented
- var controller = tester.PayTester.GetController(null);
+ var controller = tester.PayTester.GetController(null);
var checkout =
(Models.InvoicingModels.PaymentModel)((JsonResult)controller.GetStatus(invoice.Id)
.GetAwaiter().GetResult()).Value;
@@ -493,7 +493,7 @@ namespace BTCPayServer.Tests
Assert.Single(invoice.CryptoInfo); // Only BTC should be presented
- var controller = tester.PayTester.GetController(null);
+ var controller = tester.PayTester.GetController(null);
var checkout =
(Models.InvoicingModels.PaymentModel)((JsonResult)controller.GetStatus(invoice.Id, null)
.GetAwaiter().GetResult()).Value;
@@ -555,7 +555,7 @@ namespace BTCPayServer.Tests
Assert.False((bool)((JValue)invoice.ExceptionStatus).Value);
});
- controller = tester.PayTester.GetController(null);
+ controller = tester.PayTester.GetController(null);
checkout = (Models.InvoicingModels.PaymentModel)((JsonResult)controller.GetStatus(invoice.Id, "LTC")
.GetAwaiter().GetResult()).Value;
Assert.Equal(2, checkout.AvailableCryptos.Count);
@@ -608,7 +608,7 @@ namespace BTCPayServer.Tests
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
user.RegisterDerivationScheme("LTC");
- var apps = user.GetController();
+ var apps = user.GetController();
var vm = Assert.IsType(Assert.IsType(apps.CreateApp(user.StoreId)).Model);
vm.AppName = "test";
vm.SelectedAppType = AppType.PointOfSale.ToString();
@@ -639,7 +639,7 @@ donation:
.IsType(apps.UpdatePointOfSale(app.Id)).Model);
Assert.Equal("hello", vmpos.Title);
- var publicApps = user.GetController();
+ var publicApps = user.GetController();
var vmview =
Assert.IsType(Assert
.IsType(publicApps.ViewPointOfSale(app.Id, PosViewType.Cart).Result).Model);
@@ -673,7 +673,7 @@ donation:
// testing custom amount
var action = Assert.IsType(publicApps
.ViewPointOfSale(app.Id, PosViewType.Cart, 6.6m, null, null, null, null, "donation").Result);
- Assert.Equal(nameof(InvoiceController.Checkout), action.ActionName);
+ Assert.Equal(nameof(UIInvoiceController.Checkout), action.ActionName);
invoices = user.BitPay.GetInvoices();
var donationInvoice = invoices.Single(i => i.Price == 6.6m);
Assert.NotNull(donationInvoice);
@@ -711,7 +711,7 @@ donation:
custom: true
";
Assert.IsType(apps.UpdatePointOfSale(app.Id, vmpos).Result);
- publicApps = user.GetController();
+ publicApps = user.GetController();
vmview = Assert.IsType(Assert
.IsType(publicApps.ViewPointOfSale(app.Id, PosViewType.Cart).Result).Model);
Assert.Equal(test.Code, vmview.CurrencyCode);
@@ -768,7 +768,7 @@ noninventoryitem:
Assert.NotNull(inventoryItemInvoice);
//let's mark the inventoryitem invoice as invalid, this should return the item to back in stock
- var controller = tester.PayTester.GetController(user.UserId, user.StoreId);
+ var controller = tester.PayTester.GetController(user.UserId, user.StoreId);
var appService = tester.PayTester.GetService();
var eventAggregator = tester.PayTester.GetService();
Assert.IsType(await controller.ChangeInvoiceState(inventoryItemInvoice.Id, "invalid"));
diff --git a/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs b/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs
index 39bf31e29..bf48dc56f 100644
--- a/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs
+++ b/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs
@@ -40,7 +40,7 @@ namespace BTCPayServer.Tests
user.RegisterDerivationScheme("BTC");
user.RegisterDerivationScheme("USDT");
- Assert.Equal(3, Assert.IsType(Assert.IsType(await user.GetController().ListWallets()).Model).Wallets.Count);
+ Assert.Equal(3, Assert.IsType(Assert.IsType(await user.GetController().ListWallets()).Model).Wallets.Count);
}
}
diff --git a/BTCPayServer.Tests/CrowdfundTests.cs b/BTCPayServer.Tests/CrowdfundTests.cs
index 98fa79c7c..0f6454579 100644
--- a/BTCPayServer.Tests/CrowdfundTests.cs
+++ b/BTCPayServer.Tests/CrowdfundTests.cs
@@ -33,8 +33,8 @@ namespace BTCPayServer.Tests
await user.GrantAccessAsync();
var user2 = tester.NewAccount();
await user2.GrantAccessAsync();
- var apps = user.GetController();
- var apps2 = user2.GetController();
+ var apps = user.GetController();
+ var apps2 = user2.GetController();
var vm = Assert.IsType(Assert.IsType(apps.CreateApp(user.StoreId)).Model);
Assert.NotNull(vm.SelectedAppType);
Assert.Null(vm.AppName);
@@ -72,7 +72,7 @@ namespace BTCPayServer.Tests
var user = tester.NewAccount();
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
- var apps = user.GetController();
+ var apps = user.GetController();
var vm = Assert.IsType(Assert.IsType(apps.CreateApp(user.StoreId)).Model);
vm.AppName = "test";
vm.SelectedAppType = AppType.Crowdfund.ToString();
@@ -90,8 +90,8 @@ namespace BTCPayServer.Tests
Assert.IsType(apps.UpdateCrowdfund(app.Id, crowdfundViewModel, "save").Result);
- var anonAppPubsController = tester.PayTester.GetController();
- var publicApps = user.GetController();
+ var anonAppPubsController = tester.PayTester.GetController();
+ var publicApps = user.GetController();
Assert.IsType(await anonAppPubsController.ContributeToCrowdfund(app.Id, new ContributeToCrowdfund()
{
@@ -162,7 +162,7 @@ namespace BTCPayServer.Tests
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
await user.SetNetworkFeeMode(NetworkFeeMode.Never);
- var apps = user.GetController();
+ var apps = user.GetController();
var vm = Assert.IsType(Assert.IsType(apps.CreateApp(user.StoreId)).Model);
vm.AppName = "test";
vm.SelectedAppType = AppType.Crowdfund.ToString();
@@ -182,8 +182,8 @@ namespace BTCPayServer.Tests
crowdfundViewModel.EnforceTargetAmount = true;
Assert.IsType(apps.UpdateCrowdfund(app.Id, crowdfundViewModel, "save").Result);
- var anonAppPubsController = tester.PayTester.GetController();
- var publicApps = user.GetController();
+ var anonAppPubsController = tester.PayTester.GetController();
+ var publicApps = user.GetController();
var model = Assert.IsType(Assert
.IsType(publicApps.ViewCrowdfund(app.Id, String.Empty).Result).Model);
diff --git a/BTCPayServer.Tests/FastTests.cs b/BTCPayServer.Tests/FastTests.cs
index cbda65097..fda520e03 100644
--- a/BTCPayServer.Tests/FastTests.cs
+++ b/BTCPayServer.Tests/FastTests.cs
@@ -1208,7 +1208,7 @@ namespace BTCPayServer.Tests
testCases.ForEach(tuple =>
{
- Assert.Equal(tuple.expectedOutput, InvoiceController.PosDataParser.ParsePosData(tuple.input));
+ Assert.Equal(tuple.expectedOutput, UIInvoiceController.PosDataParser.ParsePosData(tuple.input));
});
}
[Fact]
diff --git a/BTCPayServer.Tests/GreenfieldAPITests.cs b/BTCPayServer.Tests/GreenfieldAPITests.cs
index aa63f320d..386e18295 100644
--- a/BTCPayServer.Tests/GreenfieldAPITests.cs
+++ b/BTCPayServer.Tests/GreenfieldAPITests.cs
@@ -977,7 +977,7 @@ namespace BTCPayServer.Tests
var paymentTestPaymentRequest = await client.CreatePaymentRequest(user.StoreId,
new CreatePaymentRequestRequest() { Amount = 0.1m, Currency = "BTC", Title = "Payment test title" });
- var invoiceId = Assert.IsType(Assert.IsType(await user.GetController()
+ var invoiceId = Assert.IsType(Assert.IsType(await user.GetController()
.PayPaymentRequest(paymentTestPaymentRequest.Id, false)).Value);
var invoice = user.BitPay.GetInvoice(invoiceId);
await tester.WaitForEvent(async () =>
@@ -1332,7 +1332,7 @@ namespace BTCPayServer.Tests
}
});
Assert.EndsWith($"/i/{newInvoice.Id}", newInvoice.CheckoutLink);
- var controller = tester.PayTester.GetController(user.UserId, user.StoreId);
+ var controller = tester.PayTester.GetController(user.UserId, user.StoreId);
var model = (PaymentModel)((ViewResult)await controller.Checkout(newInvoice.Id)).Model;
Assert.Equal("it-IT", model.DefaultLang);
Assert.Equal("http://toto.com/lol", model.MerchantRefLink);
diff --git a/BTCPayServer.Tests/POSTests.cs b/BTCPayServer.Tests/POSTests.cs
index 34d8817fd..603345419 100644
--- a/BTCPayServer.Tests/POSTests.cs
+++ b/BTCPayServer.Tests/POSTests.cs
@@ -28,7 +28,7 @@ namespace BTCPayServer.Tests
var user = tester.NewAccount();
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
- var apps = user.GetController();
+ var apps = user.GetController();
var vm = Assert.IsType(Assert.IsType(apps.CreateApp(user.StoreId)).Model);
vm.AppName = "test";
vm.SelectedAppType = AppType.PointOfSale.ToString();
@@ -52,7 +52,7 @@ donation:
Assert.IsType(apps.UpdatePointOfSale(app.Id, vmpos).Result);
vmpos = Assert.IsType(Assert
.IsType(apps.UpdatePointOfSale(app.Id)).Model);
- var publicApps = user.GetController();
+ var publicApps = user.GetController();
var vmview =
Assert.IsType(Assert
.IsType(publicApps.ViewPointOfSale(app.Id, PosViewType.Cart).Result).Model);
diff --git a/BTCPayServer.Tests/PSBTTests.cs b/BTCPayServer.Tests/PSBTTests.cs
index bc594bc38..e240753d9 100644
--- a/BTCPayServer.Tests/PSBTTests.cs
+++ b/BTCPayServer.Tests/PSBTTests.cs
@@ -47,7 +47,7 @@ namespace BTCPayServer.Tests
Assert.Equal("paid", invoice.Status);
});
- var walletController = user.GetController();
+ var walletController = user.GetController();
var walletId = new WalletId(user.StoreId, "BTC");
var sendDestination = new Key().PubKey.Hash.GetAddress(user.SupportedNetwork.NBitcoinNetwork).ToString();
var sendModel = new WalletSendModel()
diff --git a/BTCPayServer.Tests/PayJoinTests.cs b/BTCPayServer.Tests/PayJoinTests.cs
index c6c64527d..f2f599f1a 100644
--- a/BTCPayServer.Tests/PayJoinTests.cs
+++ b/BTCPayServer.Tests/PayJoinTests.cs
@@ -469,7 +469,7 @@ namespace BTCPayServer.Tests
changeIndex = i;
}
- var derivationSchemeSettings = alice.GetController().GetDerivationSchemeSettings(new WalletId(alice.StoreId, "BTC"));
+ var derivationSchemeSettings = alice.GetController().GetDerivationSchemeSettings(new WalletId(alice.StoreId, "BTC"));
var signingAccount = derivationSchemeSettings.GetSigningAccountKeySettings();
psbt.SignAll(derivationSchemeSettings.AccountDerivation, alice.GenerateWalletResponseV.AccountHDKey, signingAccount.GetRootedKeyPath());
using var fakeServer = new FakeServer();
diff --git a/BTCPayServer.Tests/PaymentRequestTests.cs b/BTCPayServer.Tests/PaymentRequestTests.cs
index 265a0afab..8c1746b7b 100644
--- a/BTCPayServer.Tests/PaymentRequestTests.cs
+++ b/BTCPayServer.Tests/PaymentRequestTests.cs
@@ -35,8 +35,8 @@ namespace BTCPayServer.Tests
await user2.GrantAccessAsync();
- var paymentRequestController = user.GetController();
- var guestpaymentRequestController = user2.GetController();
+ var paymentRequestController = user.GetController();
+ var guestpaymentRequestController = user2.GetController();
var request = new UpdatePaymentRequestViewModel
{
@@ -104,7 +104,7 @@ namespace BTCPayServer.Tests
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
- var paymentRequestController = user.GetController();
+ var paymentRequestController = user.GetController();
Assert.IsType(
await paymentRequestController.PayPaymentRequest(Guid.NewGuid().ToString()));
@@ -132,7 +132,7 @@ namespace BTCPayServer.Tests
await paymentRequestController.PayPaymentRequest(response.Value.ToString()));
Assert.Equal("Checkout", actionResult.ActionName);
- Assert.Equal("Invoice", actionResult.ControllerName);
+ Assert.Equal("UIInvoice", actionResult.ControllerName);
Assert.Contains(actionResult.RouteValues,
pair => pair.Key == "Id" && pair.Value.ToString() == invoiceId);
@@ -170,7 +170,7 @@ namespace BTCPayServer.Tests
user.GrantAccess();
user.RegisterDerivationScheme("BTC");
- var paymentRequestController = user.GetController();
+ var paymentRequestController = user.GetController();
Assert.IsType(await
paymentRequestController.CancelUnpaidPendingInvoice(Guid.NewGuid().ToString(), false));
@@ -209,7 +209,7 @@ namespace BTCPayServer.Tests
await paymentRequestController.PayPaymentRequest(response.Value.ToString()));
Assert.Equal("Checkout", actionResult.ActionName);
- Assert.Equal("Invoice", actionResult.ControllerName);
+ Assert.Equal("UIInvoice", actionResult.ControllerName);
Assert.Contains(actionResult.RouteValues,
pair => pair.Key == "Id" && pair.Value.ToString() == invoiceId);
diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs
index 100ec9cb4..24e166302 100644
--- a/BTCPayServer.Tests/SeleniumTests.cs
+++ b/BTCPayServer.Tests/SeleniumTests.cs
@@ -150,8 +150,8 @@ namespace BTCPayServer.Tests
s.Driver.AssertNoError();
Assert.Contains("/login", s.Driver.Url);
- s.GoToUrl("/Manage/Index");
- Assert.Contains("ReturnUrl=%2FManage%2FIndex", s.Driver.Url);
+ s.GoToUrl("/UIManage/Index");
+ Assert.Contains("ReturnUrl=%2FUIManage%2FIndex", s.Driver.Url);
// We should be redirected to login
//Same User Can Log Back In
@@ -160,7 +160,7 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("LoginButton")).Click();
// We should be redirected to invoice
- Assert.EndsWith("/Manage/Index", s.Driver.Url);
+ Assert.EndsWith("/UIManage/Index", s.Driver.Url);
// Should not be able to reach server settings
s.GoToUrl("/server/users");
@@ -668,6 +668,8 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("Amount")).SendKeys("700");
s.Driver.FindElement(By.Id("Currency")).SendKeys("BTC");
s.Driver.FindElement(By.Id("SaveButton")).Click();
+ var aaa = s.Driver.PageSource;
+ var url = s.Driver.Url;
s.Driver.FindElement(By.Id("ViewAppButton")).Click();
s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last());
Assert.Equal("Amount due", s.Driver.FindElement(By.CssSelector("[data-test='amount-due-title']")).Text);
diff --git a/BTCPayServer.Tests/TestAccount.cs b/BTCPayServer.Tests/TestAccount.cs
index 0abe095b5..275665494 100644
--- a/BTCPayServer.Tests/TestAccount.cs
+++ b/BTCPayServer.Tests/TestAccount.cs
@@ -70,9 +70,9 @@ namespace BTCPayServer.Tests
public async Task CreateClient(params string[] permissions)
{
- var manageController = parent.PayTester.GetController(UserId, StoreId, IsAdmin);
+ var manageController = parent.PayTester.GetController(UserId, StoreId, IsAdmin);
var x = Assert.IsType(await manageController.AddApiKey(
- new ManageController.AddApiKeyViewModel()
+ new UIManageController.AddApiKeyViewModel()
{
PermissionValues = permissions.Select(s =>
{
@@ -82,11 +82,11 @@ namespace BTCPayServer.Tests
{
var stores = p.Where(permission => !string.IsNullOrEmpty(permission.Scope))
.Select(permission => permission.Scope).ToList();
- return new ManageController.AddApiKeyViewModel.PermissionValueItem()
+ return new UIManageController.AddApiKeyViewModel.PermissionValueItem()
{
Permission = p.Key,
Forbidden = false,
- StoreMode = stores.Any() ? ManageController.AddApiKeyViewModel.ApiKeyStoreMode.Specific : ManageController.AddApiKeyViewModel.ApiKeyStoreMode.AllStores,
+ StoreMode = stores.Any() ? UIManageController.AddApiKeyViewModel.ApiKeyStoreMode.Specific : UIManageController.AddApiKeyViewModel.ApiKeyStoreMode.AllStores,
SpecificStores = stores,
Value = true
};
@@ -109,7 +109,7 @@ namespace BTCPayServer.Tests
{
await RegisterAsync(isAdmin);
await CreateStoreAsync();
- var store = GetController();
+ var store = GetController();
var pairingCode = BitPay.RequestClientAuthorization("test", Facade.Merchant);
Assert.IsType(await store.RequestPairing(pairingCode.ToString()));
await store.Pair(pairingCode.ToString(), StoreId);
@@ -135,7 +135,7 @@ namespace BTCPayServer.Tests
public async Task ModifyPayment(Action modify)
{
- var storeController = GetController();
+ var storeController = GetController();
var response = storeController.PaymentMethods();
PaymentMethodsViewModel paymentMethods = (PaymentMethodsViewModel)((ViewResult)response).Model;
modify(paymentMethods);
@@ -144,7 +144,7 @@ namespace BTCPayServer.Tests
public async Task ModifyWalletSettings(Action modify)
{
- var storeController = GetController();
+ var storeController = GetController();
var response = await storeController.WalletSettings(StoreId, "BTC");
WalletSettingsViewModel walletSettings = (WalletSettingsViewModel)((ViewResult)response).Model;
modify(walletSettings);
@@ -153,7 +153,7 @@ namespace BTCPayServer.Tests
public async Task ModifyOnchainPaymentSettings(Action modify)
{
- var storeController = GetController();
+ var storeController = GetController();
var response = await storeController.WalletSettings(StoreId, "BTC");
WalletSettingsViewModel walletSettings = (WalletSettingsViewModel)((ViewResult)response).Model;
modify(walletSettings);
@@ -172,7 +172,7 @@ namespace BTCPayServer.Tests
{
await RegisterAsync();
}
- var store = GetController();
+ var store = GetController();
await store.CreateStore(new CreateStoreViewModel { Name = "Test Store" });
StoreId = store.CreatedStoreId;
parent.Stores.Add(StoreId);
@@ -191,7 +191,7 @@ namespace BTCPayServer.Tests
if (StoreId is null)
await CreateStoreAsync();
SupportedNetwork = parent.NetworkProvider.GetNetwork(cryptoCode);
- var store = parent.PayTester.GetController(UserId, StoreId, true);
+ var store = parent.PayTester.GetController(UserId, StoreId, true);
var generateRequest = new WalletSetupRequest
{
@@ -215,7 +215,7 @@ namespace BTCPayServer.Tests
private async Task RegisterAsync(bool isAdmin = false)
{
- var account = parent.PayTester.GetController();
+ var account = parent.PayTester.GetController();
RegisterDetails = new RegisterViewModel()
{
Email = Guid.NewGuid() + "@toto.com",
@@ -271,7 +271,7 @@ namespace BTCPayServer.Tests
}
public async Task RegisterLightningNodeAsync(string cryptoCode, LightningConnectionType? connectionType, bool isMerchant = true, string storeId = null)
{
- var storeController = GetController();
+ var storeController = GetController();
var connectionString = parent.GetLightningConnectionString(connectionType, isMerchant);
var nodeType = connectionString == LightningSupportedPaymentMethod.InternalNode ? LightningNodeType.Internal : LightningNodeType.Custom;
@@ -285,7 +285,7 @@ namespace BTCPayServer.Tests
public async Task RegisterInternalLightningNodeAsync(string cryptoCode, string storeId = null)
{
- var storeController = GetController();
+ var storeController = GetController();
var vm = new LightningNodeViewModel { ConnectionString = "", LightningNodeType = LightningNodeType.Internal, SkipPortTest = true };
await storeController.SetupLightningNode(storeId ?? StoreId,
vm, "save", cryptoCode);
diff --git a/BTCPayServer.Tests/ThirdPartyTests.cs b/BTCPayServer.Tests/ThirdPartyTests.cs
index 484461a6d..49fc997cd 100644
--- a/BTCPayServer.Tests/ThirdPartyTests.cs
+++ b/BTCPayServer.Tests/ThirdPartyTests.cs
@@ -42,7 +42,7 @@ namespace BTCPayServer.Tests
await tester.StartAsync();
var user = tester.NewAccount();
user.GrantAccess();
- var controller = tester.PayTester.GetController(user.UserId, user.StoreId);
+ var controller = tester.PayTester.GetController(user.UserId, user.StoreId);
var azureBlobStorageConfiguration = Assert.IsType(Assert
.IsType(await controller.StorageProvider(StorageProvider.AzureBlobStorage.ToString()))
.Model);
@@ -362,7 +362,7 @@ namespace BTCPayServer.Tests
private static async Task CreateInvoice(ServerTester tester, TestAccount user, string exchange,
string currency = "USD")
{
- var storeController = user.GetController();
+ var storeController = user.GetController();
var vm = (RatesViewModel)((ViewResult)storeController.Rates()).Model;
vm.PreferredExchange = exchange;
await storeController.Rates(vm);
diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs
index bd2922f8e..fe83b3744 100644
--- a/BTCPayServer.Tests/UnitTest1.cs
+++ b/BTCPayServer.Tests/UnitTest1.cs
@@ -140,7 +140,7 @@ namespace BTCPayServer.Tests
var acc = tester.NewAccount();
var sresp = Assert
- .IsType(await tester.PayTester.GetController(acc.UserId, acc.StoreId)
+ .IsType(await tester.PayTester.GetController(acc.UserId, acc.StoreId)
.Swagger()).Value.ToJson();
JObject swagger = JObject.Parse(sresp);
var schema = JSchema.Parse(File.ReadAllText(TestUtils.GetTestDataFullPath("OpenAPI-Specification-schema.json")));
@@ -173,13 +173,13 @@ namespace BTCPayServer.Tests
"BTCPay Server supports authenticating and authorizing users through an API Key that is generated by them. Send the API Key as a header value to Authorization with the format: `token {token}`. For a smoother experience, you can generate a url that redirects users to an API key creation screen.\n\n The following permissions are available to the context of the user creating the API Key:\n\n#OTHERPERMISSIONS#\n\nThe following permissions are available if the user is an administrator:\n\n#SERVERPERMISSIONS#\n\nThe following permissions applies to all stores of the user, you can limit to a specific store with the following format: `btcpay.store.cancreateinvoice:6HSHAEU4iYWtjxtyRs9KyPjM9GAQp8kw2T9VWbGG1FnZ`:\n\n#STOREPERMISSIONS#\n\nNote that API Keys only limits permission of a user and can never expand it. If an API Key has the permission `btcpay.server.canmodifyserversettings` but that the user account creating this API Key is not administrator, the API Key will not be able to modify the server settings.\nSome permissions may include other permissions, see [this operation](#operation/permissionsMetadata).\n";
var storePolicies =
- ManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
+ UIManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
Policies.IsStorePolicy(pair.Key) && !pair.Key.EndsWith(":", StringComparison.InvariantCulture));
var serverPolicies =
- ManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
+ UIManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
Policies.IsServerPolicy(pair.Key));
var otherPolicies =
- ManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
+ UIManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
!Policies.IsStorePolicy(pair.Key) && !Policies.IsServerPolicy(pair.Key));
description = description.Replace("#OTHERPERMISSIONS#",
@@ -191,7 +191,7 @@ namespace BTCPayServer.Tests
TestLogs.LogInformation(description);
var sresp = Assert
- .IsType(await tester.PayTester.GetController(acc.UserId, acc.StoreId)
+ .IsType(await tester.PayTester.GetController(acc.UserId, acc.StoreId)
.Swagger()).Value.ToJson();
JObject json = JObject.Parse(sresp);
@@ -279,7 +279,7 @@ namespace BTCPayServer.Tests
user.RegisterDerivationScheme("BTC");
// Set tolerance to 50%
- var stores = user.GetController();
+ var stores = user.GetController();
var response = stores.PaymentMethods();
var vm = Assert.IsType(Assert.IsType(response).Model);
Assert.Equal(0.0, vm.PaymentTolerance);
@@ -425,7 +425,7 @@ namespace BTCPayServer.Tests
await tester.EnsureChannelsSetup();
var user = tester.NewAccount();
user.GrantAccess(true);
- var storeController = user.GetController();
+ var storeController = user.GetController();
var storeResponse = storeController.PaymentMethods();
Assert.IsType(storeResponse);
Assert.IsType(await storeController.SetupLightningNode(user.StoreId, "BTC"));
@@ -538,7 +538,7 @@ namespace BTCPayServer.Tests
acc.Register();
acc.CreateStore();
- var controller = acc.GetController();
+ var controller = acc.GetController();
var token = (RedirectToActionResult)await controller.CreateToken2(
new Models.StoreViewModels.CreateTokenViewModel()
{
@@ -635,14 +635,14 @@ namespace BTCPayServer.Tests
var acc = tester.NewAccount();
acc.Register();
acc.CreateStore();
- var store = acc.GetController();
+ var store = acc.GetController();
var pairingCode = acc.BitPay.RequestClientAuthorization("test", Facade.Merchant);
Assert.IsType(store.Pair(pairingCode.ToString(), acc.StoreId).GetAwaiter()
.GetResult());
pairingCode = acc.BitPay.RequestClientAuthorization("test1", Facade.Merchant);
acc.CreateStore();
- var store2 = acc.GetController();
+ var store2 = acc.GetController();
await store2.Pair(pairingCode.ToString(), store2.CurrentStore.Id);
Assert.Contains(nameof(PairingResult.ReusedKey),
(string)store2.TempData[WellKnownTempData.ErrorMessage], StringComparison.CurrentCultureIgnoreCase);
@@ -703,11 +703,11 @@ namespace BTCPayServer.Tests
acc.RegisterDerivationScheme("BTC", ScriptPubKeyType.Segwit);
var btcDerivationScheme = acc.DerivationScheme;
- var walletController = acc.GetController();
+ var walletController = acc.GetController();
var walletId = new WalletId(acc.StoreId, "BTC");
acc.IsAdmin = true;
- walletController = acc.GetController();
+ walletController = acc.GetController();
var rescan =
Assert.IsType(Assert
@@ -857,7 +857,7 @@ namespace BTCPayServer.Tests
acc.RegisterDerivationScheme("BTC");
const string newVersion = "1.0.4.4";
- var ctrl = acc.GetController();
+ var ctrl = acc.GetController();
var resp = await ctrl.Generate(newVersion);
var vm = Assert.IsType(
@@ -903,11 +903,11 @@ namespace BTCPayServer.Tests
// We don't have any default currencies, so this should be failing
Assert.Null(GetRatesResult?.Data);
- var store = acc.GetController();
+ var store = acc.GetController();
var ratesVM = (RatesViewModel)(Assert.IsType(store.Rates()).Model);
ratesVM.DefaultCurrencyPairs = "BTC_USD,LTC_USD";
await store.Rates(ratesVM);
- store = acc.GetController();
+ store = acc.GetController();
rateController = acc.GetController();
GetRatesResult = JObject.Parse(((JsonResult)rateController.GetRates(null, default)
.GetAwaiter().GetResult()).Value.ToJson()).ToObject>();
@@ -940,7 +940,7 @@ namespace BTCPayServer.Tests
private void AssertSearchInvoice(TestAccount acc, bool expected, string invoiceId, string filter, string storeId = null)
{
var result =
- (InvoicesModel)((ViewResult)acc.GetController()
+ (InvoicesModel)((ViewResult)acc.GetController()
.ListInvoices(new InvoicesModel { SearchTerm = filter, StoreId = storeId }).Result).Model;
Assert.Equal(expected, result.Invoices.Any(i => i.InvoiceId == invoiceId));
}
@@ -1124,7 +1124,7 @@ namespace BTCPayServer.Tests
var payments = Assert.IsType(
- Assert.IsType(await user.GetController().Invoice(invoice.Id)).Model)
+ Assert.IsType(await user.GetController().Invoice(invoice.Id)).Model)
.Payments;
Assert.Single(payments);
var paymentData = payments.First().GetCryptoPaymentData() as BitcoinLikePaymentData;
@@ -1181,7 +1181,7 @@ namespace BTCPayServer.Tests
Assert.True(user.BitPay.TestAccess(Facade.Merchant));
// Test request pairing code client side
- var storeController = user.GetController();
+ var storeController = user.GetController();
storeController
.CreateToken(user.StoreId, new CreateTokenViewModel() { Label = "test2", StoreId = user.StoreId })
.GetAwaiter().GetResult();
@@ -1201,14 +1201,14 @@ namespace BTCPayServer.Tests
// Can generate API Key
var repo = tester.PayTester.GetService();
Assert.Empty(repo.GetLegacyAPIKeys(user.StoreId).GetAwaiter().GetResult());
- Assert.IsType(user.GetController()
+ Assert.IsType(user.GetController()
.GenerateAPIKey(user.StoreId).GetAwaiter().GetResult());
var apiKey = Assert.Single(repo.GetLegacyAPIKeys(user.StoreId).GetAwaiter().GetResult());
///////
// Generating a new one remove the previous
- Assert.IsType(user.GetController()
+ Assert.IsType(user.GetController()
.GenerateAPIKey(user.StoreId).GetAwaiter().GetResult());
var apiKey2 = Assert.Single(repo.GetLegacyAPIKeys(user.StoreId).GetAwaiter().GetResult());
Assert.NotEqual(apiKey, apiKey2);
@@ -1320,7 +1320,7 @@ namespace BTCPayServer.Tests
}, Facade.Merchant);
Assert.Equal(Money.Coins(1.0m), invoice1.BtcPrice);
- var storeController = user.GetController();
+ var storeController = user.GetController();
var vm = (RatesViewModel)((ViewResult)storeController.Rates()).Model;
Assert.Equal(0.0, vm.Spread);
vm.Spread = 40;
@@ -1439,7 +1439,7 @@ namespace BTCPayServer.Tests
user.GrantAccess();
user.RegisterDerivationScheme("BTC");
- var store = user.GetController();
+ var store = user.GetController();
var rateVm = Assert.IsType(Assert.IsType(store.Rates()).Model);
Assert.False(rateVm.ShowScripting);
Assert.Equal(CoinGeckoRateProvider.CoinGeckoName, rateVm.PreferredExchange);
@@ -1453,7 +1453,7 @@ namespace BTCPayServer.Tests
rateVm.ScriptTest = "BTC_JPY,BTC_CAD";
rateVm.Spread = 10;
- store = user.GetController();
+ store = user.GetController();
rateVm = Assert.IsType(Assert.IsType(await store.Rates(rateVm, "Test"))
.Model);
Assert.NotNull(rateVm.TestRateRules);
@@ -1466,7 +1466,7 @@ namespace BTCPayServer.Tests
Assert.IsType(store.ShowRateRulesPost(true).Result);
Assert.IsType(await store.Rates(rateVm, "Save"));
- store = user.GetController();
+ store = user.GetController();
rateVm = Assert.IsType(Assert.IsType(store.Rates()).Model);
Assert.Equal(rateVm.StoreId, user.StoreId);
Assert.Equal(rateVm.DefaultScript, rateVm.Script);
@@ -1487,7 +1487,7 @@ namespace BTCPayServer.Tests
.Model);
Assert.True(rateVm.TestRateRules.All(t => !t.Error));
Assert.IsType(await store.Rates(rateVm, "Save"));
- store = user.GetController();
+ store = user.GetController();
rateVm = Assert.IsType(Assert.IsType(store.Rates()).Model);
Assert.Equal(50, rateVm.Spread);
Assert.True(rateVm.ShowScripting);
@@ -1522,7 +1522,7 @@ namespace BTCPayServer.Tests
Assert.Equal("EUR", invoice2.Currency);
// via UI
- var controller = user.GetController();
+ var controller = user.GetController();
var model = await controller.CreateInvoice();
(await controller.CreateInvoice(new CreateInvoiceModel(), default)).AssertType();
invoice = await client.GetInvoice(user.StoreId, controller.CreatedInvoiceId);
@@ -1530,7 +1530,7 @@ namespace BTCPayServer.Tests
Assert.Equal(InvoiceType.TopUp, invoice.Type);
// Check that the SendWallet use the default currency
- var walletController = user.GetController();
+ var walletController = user.GetController();
var walletSend = await walletController.WalletSend(new WalletId(user.StoreId, "BTC")).AssertViewModelAsync();
Assert.Equal("EUR", walletSend.Fiat);
}
@@ -1555,13 +1555,13 @@ namespace BTCPayServer.Tests
// We allow BTC and LN, but not BTC under 5 USD, so only LN should be in the invoice
var vm = Assert.IsType(Assert
- .IsType(user.GetController().CheckoutAppearance()).Model);
+ .IsType(user.GetController().CheckoutAppearance()).Model);
Assert.Equal(2, vm.PaymentMethodCriteria.Count);
var criteria = Assert.Single(vm.PaymentMethodCriteria.Where(m => m.PaymentMethod == btcMethod.ToString()));
Assert.Equal(new PaymentMethodId("BTC", BitcoinPaymentType.Instance).ToString(), criteria.PaymentMethod);
criteria.Value = "5 USD";
criteria.Type = PaymentMethodCriteriaViewModel.CriteriaType.GreaterThan;
- Assert.IsType(user.GetController().CheckoutAppearance(vm)
+ Assert.IsType(user.GetController().CheckoutAppearance(vm)
.Result);
var invoice = user.BitPay.CreateInvoice(
@@ -1582,7 +1582,7 @@ namespace BTCPayServer.Tests
// We allow BTC for more than 5 USD, and LN for less than 150. The default is LN, so the default
// payment method should be LN.
vm = Assert.IsType(Assert
- .IsType(user.GetController().CheckoutAppearance()).Model);
+ .IsType(user.GetController().CheckoutAppearance()).Model);
vm.DefaultPaymentMethod = lnMethod;
criteria = vm.PaymentMethodCriteria.First();
criteria.Value = "150 USD";
@@ -1590,7 +1590,7 @@ namespace BTCPayServer.Tests
criteria = vm.PaymentMethodCriteria.Skip(1).First();
criteria.Value = "5 USD";
criteria.Type = PaymentMethodCriteriaViewModel.CriteriaType.GreaterThan;
- Assert.IsType(user.GetController().CheckoutAppearance(vm)
+ Assert.IsType(user.GetController().CheckoutAppearance(vm)
.Result);
invoice = user.BitPay.CreateInvoice(
new Invoice()
@@ -1602,14 +1602,14 @@ namespace BTCPayServer.Tests
ItemDesc = "Some description",
FullNotifications = true
}, Facade.Merchant);
- var checkout = (await user.GetController().Checkout(invoice.Id)).AssertViewModel();
+ var checkout = (await user.GetController().Checkout(invoice.Id)).AssertViewModel();
Assert.Equal(lnMethod, checkout.PaymentMethodId);
// If we change store's default, it should change the checkout's default
vm.DefaultPaymentMethod = btcMethod;
- Assert.IsType(user.GetController().CheckoutAppearance(vm)
+ Assert.IsType(user.GetController().CheckoutAppearance(vm)
.Result);
- checkout = (await user.GetController().Checkout(invoice.Id)).AssertViewModel();
+ checkout = (await user.GetController().Checkout(invoice.Id)).AssertViewModel();
Assert.Equal(btcMethod, checkout.PaymentMethodId);
}
}
@@ -1641,7 +1641,7 @@ namespace BTCPayServer.Tests
}, Facade.Merchant);
// validate that invoice data model doesn't have lightning string initially
- var res = await user.GetController().Checkout(invoice.Id);
+ var res = await user.GetController().Checkout(invoice.Id);
var paymentMethodFirst = Assert.IsType(
Assert.IsType(res).Model
);
@@ -1649,15 +1649,15 @@ namespace BTCPayServer.Tests
// enable unified QR code in settings
var vm = Assert.IsType(Assert
- .IsType(await user.GetController().LightningSettings(user.StoreId, cryptoCode)).Model
+ .IsType(await user.GetController