diff --git a/BunqSdk.Tests/BunqSdkTestBase.cs b/BunqSdk.Tests/BunqSdkTestBase.cs index a26d190..e196845 100644 --- a/BunqSdk.Tests/BunqSdkTestBase.cs +++ b/BunqSdk.Tests/BunqSdkTestBase.cs @@ -27,6 +27,11 @@ public class BunqSdkTestBase protected const string PaymentCurrency = "EUR"; protected const string PaymentDescription = "C# test Payment"; + /// + /// Constants for monetary account. + /// + protected const string MonetaryAccountDescription = "Test C# monetary account"; + /// /// Image constants. /// @@ -35,10 +40,28 @@ public class BunqSdkTestBase protected const string AttachmentDescription = "C# sdk image test."; protected const string AttachmentPathIn = "/bunq_App_Icon_Square@4x.png"; - protected const string MonetaryAccountDescription = "Test C# monetary account"; - - protected const int IndexFirst = 0; + /// + /// Device registration constants. + /// + private const string DeviceDescription = "Csharp test device"; + /// + /// Pointer type constants. + /// + private const string PointerTypeEmail = "EMAIL"; + + /// + /// Email constants. + /// + private const string EmailBravo = "bravo@bunq.com"; + private const string EmailSuggarDaddy = "sugardaddy@bunq.com"; + + /// + /// Spending money constants. + /// + private const string SpendingMoneyAmount = "50.00"; + private const string SpendingMoneyRequestDescription = "sdk c# test, thanks daddy."; + protected static MonetaryAccountBank SecondMonetaryAccountBank; /// @@ -66,7 +89,7 @@ protected static ApiContext SetUpApiContext() else { var sandboxUser = GenerateNewSandboxUser(); - apiContext = ApiContext.Create(ApiEnvironmentType.SANDBOX, sandboxUser.ApiKey, "Csharp test device"); + apiContext = ApiContext.Create(ApiEnvironmentType.SANDBOX, sandboxUser.ApiKey, DeviceDescription); } BunqContext.LoadApiContext(apiContext); @@ -96,7 +119,7 @@ private static SandboxUser GenerateNewSandboxUser() private static MonetaryAccountBank SetUpSecondMonetaryAccount() { - var createdMonetaryAccountId = MonetaryAccountBank.Create("EUR", MonetaryAccountDescription); + var createdMonetaryAccountId = MonetaryAccountBank.Create(PaymentCurrency, MonetaryAccountDescription); return MonetaryAccountBank.Get(createdMonetaryAccountId.Value).Value; } @@ -104,24 +127,24 @@ private static MonetaryAccountBank SetUpSecondMonetaryAccount() private static void RequestSpendingMoney() { RequestInquiry.Create( - new Amount("50.00", "EUR"), - new Pointer("EMAIL", "sugardaddy@bunq.com"), - "sdk c# test, thanks daddy.", + new Amount(SpendingMoneyAmount, PaymentCurrency), + new Pointer(PointerTypeEmail, EmailSuggarDaddy), + SpendingMoneyRequestDescription, false ); RequestInquiry.Create( - new Amount("50.00", "EUR"), - new Pointer("EMAIL", "sugardaddy@bunq.com"), - "sdk c# test, thanks daddy.", + new Amount(SpendingMoneyAmount, PaymentCurrency), + new Pointer(PointerTypeEmail, EmailSuggarDaddy), + SpendingMoneyRequestDescription, false, SecondMonetaryAccountBank.Id ); } - protected Pointer GetPointerBravo() + protected static Pointer GetPointerBravo() { - return new Pointer("EMAIL", "bravo@bunq.com"); + return new Pointer(PointerTypeEmail, EmailBravo); } } } diff --git a/BunqSdk.Tests/Model/Generated/Endpoint/AvatarTest.cs b/BunqSdk.Tests/Model/Generated/Endpoint/AvatarTest.cs index 715e7cb..b4c1519 100644 --- a/BunqSdk.Tests/Model/Generated/Endpoint/AvatarTest.cs +++ b/BunqSdk.Tests/Model/Generated/Endpoint/AvatarTest.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.IO; +using System.Linq; using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Model.Generated.Endpoint; @@ -34,7 +35,7 @@ public void TestCreateAvatarAndRetrieval() var avatarUuid = Avatar.Create(attachmentUuid).Value; var attachmentUuidFromAvatar = Avatar.Get(avatarUuid).Value - .Image[IndexFirst].AttachmentPublicUuid; + .Image.First().AttachmentPublicUuid; var revievedFileContentByte = AttachmentPublicContent.List(attachmentUuidFromAvatar).Value; Assert.Equal(attachmentUuid, attachmentUuidFromAvatar); diff --git a/BunqSdk.Tests/Model/Generated/Endpoint/CardDebitTest.cs b/BunqSdk.Tests/Model/Generated/Endpoint/CardDebitTest.cs index 2181c76..f4878f1 100644 --- a/BunqSdk.Tests/Model/Generated/Endpoint/CardDebitTest.cs +++ b/BunqSdk.Tests/Model/Generated/Endpoint/CardDebitTest.cs @@ -65,7 +65,7 @@ public void TestOrderNewMaestroCard() private static string GetAnAllowedName() { - return CardName.List().Value[IndexFirst].PossibleCardNameArray[IndexFirst]; + return CardName.List().Value.First().PossibleCardNameArray.First(); } private static string GenerateRandomSecondLine()