Skip to content

Commit d592b2c

Browse files
committed
Merge branch 'release/1.14.1'
2 parents 01e8ccf + 150356c commit d592b2c

File tree

309 files changed

+10111
-6010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+10111
-6010
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[//]: # (If there is a traceback please share it in a quote! You can do this by pasting the traceback text, highlighting it and pressing the quote button.)
1212

1313
## SDK version and environment
14-
- Tested on [0.12.4](https://github.com/bunq/sdk_csharp/releases/tag/0.12.4)
14+
- Tested on [1.14.0](https://github.com/bunq/sdk_csharp/releases/tag/1.14.0)
1515
- [ ] Sandbox
1616
- [ ] Production
1717

.idea/.idea.BunqSdk/.idea/contentModel.xml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BunqSdk.Tests/BunqSdkTestBase.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using System.Collections.Generic;
2-
using System.IO;
1+
using System.IO;
32
using System.Linq;
43
using System.Net.Http;
4+
using System.Threading;
55
using Bunq.Sdk.Context;
66
using Bunq.Sdk.Exception;
77
using Bunq.Sdk.Json;
@@ -37,39 +37,39 @@ public class BunqSdkTestBase
3737
/// Constants for monetary account.
3838
/// </summary>
3939
protected const string MonetaryAccountDescription = "Test C# monetary account";
40-
40+
4141
/// <summary>
4242
/// Image constants.
4343
/// </summary>
4444
protected const string PathAttachment = "../../../Resources";
4545
protected const string ContentType = "image/png";
4646
protected const string AttachmentDescription = "C# sdk image test.";
4747
protected const string AttachmentPathIn = "/vader.png";
48-
48+
4949
/// <summary>
5050
/// Device registration constants.
5151
/// </summary>
5252
private const string DeviceDescription = "Csharp test device";
53-
53+
5454
/// <summary>
5555
/// Pointer type constants.
5656
/// </summary>
5757
private const string PointerTypeEmail = "EMAIL";
58-
58+
5959
/// <summary>
6060
/// Email constants.
6161
/// </summary>
6262
private const string EmailBravo = "[email protected]";
6363
private const string EmailSuggarDaddy = "[email protected]";
64-
64+
6565
/// <summary>
6666
/// Spending money constants.
6767
/// </summary>
6868
private const string SpendingMoneyAmount = "50.00";
6969
private const string SpendingMoneyRequestDescription = "sdk c# test, thanks daddy.";
7070

7171
protected static MonetaryAccountBank SecondMonetaryAccountBank;
72-
72+
7373
/// <summary>
7474
/// Gets an Api Context, re-creates if needed and returns it.
7575
/// </summary>
@@ -78,7 +78,7 @@ protected static void SetUpTestCase()
7878
SetUpApiContext();
7979
SecondMonetaryAccountBank = SetUpSecondMonetaryAccount();
8080
RequestSpendingMoney();
81-
System.Threading.Thread.Sleep(500); // ensure requests are auto accepted.
81+
Thread.Sleep(500); // ensure requests are auto accepted.
8282
BunqContext.UserContext.RefreshUserContext();
8383
}
8484

@@ -96,12 +96,12 @@ protected static ApiContext SetUpApiContext()
9696
var sandboxUser = GenerateNewSandboxUser();
9797
apiContext = ApiContext.Create(ApiEnvironmentType.SANDBOX, sandboxUser.ApiKey, DeviceDescription);
9898
}
99-
99+
100100
BunqContext.LoadApiContext(apiContext);
101101

102102
return apiContext;
103103
}
104-
104+
105105
private static SandboxUser GenerateNewSandboxUser()
106106
{
107107
var httpClient = new HttpClient();
@@ -117,7 +117,7 @@ private static SandboxUser GenerateNewSandboxUser()
117117

118118
var responseString = requestTask.Result.Content.ReadAsStringAsync().Result;
119119
var responseJson = BunqJsonConvert.DeserializeObject<JObject>(responseString);
120-
120+
121121
return BunqJsonConvert.DeserializeObject<SandboxUser>(responseJson.First.First.First.First.First
122122
.ToString());
123123
}
@@ -136,38 +136,38 @@ private static void RequestSpendingMoney()
136136
new Pointer(PointerTypeEmail, EmailSuggarDaddy),
137137
SpendingMoneyRequestDescription,
138138
false
139-
);
140-
139+
);
140+
141141
RequestInquiry.Create(
142142
new Amount(SpendingMoneyAmount, PaymentCurrency),
143143
new Pointer(PointerTypeEmail, EmailSuggarDaddy),
144144
SpendingMoneyRequestDescription,
145145
false,
146146
SecondMonetaryAccountBank.Id
147-
);
147+
);
148148
}
149149

150150
protected static Pointer GetPointerBravo()
151151
{
152152
return new Pointer(PointerTypeEmail, EmailBravo);
153153
}
154-
154+
155155
protected static Pointer GetAlias()
156156
{
157-
var userContex = BunqContext.UserContext;
157+
var userContext = BunqContext.UserContext;
158158

159-
if (userContex.IsOnlyUserPersonSet())
159+
if (userContext.IsOnlyUserPersonSet())
160160
{
161-
return userContex.UserPerson.Alias.First();
161+
return userContext.UserPerson.Alias.First();
162162
}
163-
else if (userContex.IsOnlyUserCompanySet())
163+
else if (userContext.IsOnlyUserCompanySet())
164164
{
165-
return userContex.UserCompany.Alias.First();
165+
return userContext.UserCompany.Alias.First();
166166
}
167167
else
168168
{
169169
throw new BunqException(ErrorCouldNotDetermineUserAlias);
170170
}
171171
}
172172
}
173-
}
173+
}

BunqSdk.Tests/Config.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ public static string[] GetPermittedIps()
8686
{
8787
var permittedIpsString = GetConfig()[FIELD_PERMITTED_IPS].ToString();
8888

89-
return permittedIpsString.Length == LENGTH_NONE ?
90-
new string[LENGTH_NONE] :
91-
permittedIpsString.Split(DELIMITER_IPS);
89+
return permittedIpsString.Length == LENGTH_NONE
90+
? new string[LENGTH_NONE]
91+
: permittedIpsString.Split(DELIMITER_IPS);
9292
}
9393

9494
public static string GetApiKey()
@@ -108,4 +108,4 @@ private static JObject GetConfig()
108108
return JObject.Parse(fileContentString);
109109
}
110110
}
111-
}
111+
}

BunqSdk.Tests/Context/ApiContextTest.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class ApiContextTest : BunqSdkTestBase, IClassFixture<ApiContextTest>
1717
private const string ContextFilenameTest = "context-save-restore-test.conf";
1818

1919
/// <summary>
20-
/// Field constatns.
20+
/// Field constants.
2121
/// </summary>
2222
private const string FieldSessionContext = "session_context";
2323
private const string FieldExpiryTime = "expiry_time";
@@ -62,16 +62,16 @@ public void TestAutoApiContextReLoad()
6262
contextJson.SelectToken(FieldSessionContext)[FieldExpiryTime] = expiredTime.ToString();
6363

6464
var expiredApiContext = ApiContext.FromJson(contextJson.ToString());
65-
65+
6666
Assert.NotEqual(apiContext, expiredApiContext);
67-
67+
6868
BunqContext.UpdateApiContext(expiredApiContext);
69-
69+
7070
Assert.Equal(expiredApiContext, BunqContext.ApiContext);
71-
71+
7272
BunqContext.UserContext.RefreshUserContext();
73-
73+
7474
Assert.True(BunqContext.ApiContext.IsSessionActive());
7575
}
7676
}
77-
}
77+
}

BunqSdk.Tests/Context/Psd2ApiContextTest.cs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.IO;
43
using Bunq.Sdk.Context;
@@ -7,19 +6,17 @@
76
using Bunq.Sdk.Security;
87
using Bunq.Sdk.Tests.Util;
98
using Xunit;
10-
using Assert = Xunit.Assert;
119

1210
namespace Bunq.Sdk.Tests.Context
1311
{
1412
[TestCaseOrderer("Bunq.Sdk.Tests.Util.TestPriorityOrderer", "Psd2ApiContextTest")]
15-
public class Psd2ApiContextTest: IClassFixture<Psd2ApiContextTest>
13+
public class Psd2ApiContextTest : IClassFixture<Psd2ApiContextTest>
1614
{
1715
/// <summary>
1816
/// File constants.
1917
/// </summary>
2018
private const string FILE_TEST_CONFIGURATION = "../../../Resources/bunq-psd2-test.conf";
2119
private const string FILE_TEST_OAUTH = "../../../Resources/bunq-oauth-test.conf";
22-
2320
private const string FILE_TEST_CREDENTIALS = "../../../Resources/credentials.pfx";
2421
private const string FILE_TEST_CERTIFICATE_CHAIN = "../../../Resources/chain.cert";
2522

@@ -37,11 +34,11 @@ public void TestCreatePsd2Context()
3734
{
3835
apiContext = ApiContext.Restore(FILE_TEST_CONFIGURATION);
3936
Assert.NotNull(apiContext);
40-
37+
4138
BunqContext.LoadApiContext(apiContext);
4239
return;
4340
}
44-
41+
4542
apiContext = CreateApiContext();
4643
BunqContext.LoadApiContext(apiContext);
4744

@@ -55,13 +52,13 @@ public void TestCreateOauthClient()
5552
{
5653
return;
5754
}
58-
55+
5956
int clientId = OauthClient.Create().Value;
6057
OauthClient oauthClient = OauthClient.Get(clientId).Value;
6158
Assert.NotNull(oauthClient);
6259

6360
File.WriteAllText(
64-
FILE_TEST_OAUTH,
61+
FILE_TEST_OAUTH,
6562
BunqJsonConvert.SerializeObject(oauthClient)
6663
);
6764
Assert.True(File.Exists(FILE_TEST_OAUTH));
@@ -70,13 +67,13 @@ public void TestCreateOauthClient()
7067
private ApiContext CreateApiContext()
7168
{
7269
ApiContext apiContext = ApiContext.CreateForPsd2(
73-
ApiEnvironmentType.SANDBOX,
74-
SecurityUtils.GetCertificateFromFile(FILE_TEST_CREDENTIALS, TEST_PASSPHRASE_CREDENTIALS),
75-
SecurityUtils.GetCertificateCollectionFromAllPath(
76-
new[] { FILE_TEST_CERTIFICATE_CHAIN }
77-
),
78-
TEST_DEVICE_DESCRIPTION,
79-
new List<string>()
70+
ApiEnvironmentType.SANDBOX,
71+
SecurityUtils.GetCertificateFromFile(FILE_TEST_CREDENTIALS, TEST_PASSPHRASE_CREDENTIALS),
72+
SecurityUtils.GetCertificateCollectionFromAllPath(
73+
new[] {FILE_TEST_CERTIFICATE_CHAIN}
74+
),
75+
TEST_DEVICE_DESCRIPTION,
76+
new List<string>()
8077
);
8178
apiContext.Save(FILE_TEST_CONFIGURATION);
8279

BunqSdk.Tests/Http/PaginationScenarioTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public class PaginationScenarioTest : BunqSdkTestBase
1717
/// Constants for scenario testing.
1818
/// </summary>
1919
private const int PaymentListingPageSize = 2;
20-
2120
private const int PaymentRequiredCountMinimum = PaymentListingPageSize * 2;
2221
private const int NumberZero = 0;
2322

BunqSdk.Tests/Http/PaginationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ public void TestGetUrlParamsNextPageFromPaginationWithNoNextPage()
166166
Assert.Throws<BunqException>(() => pagination.UrlParamsNextPage);
167167
}
168168
}
169-
}
169+
}

BunqSdk.Tests/Http/ResponseIdOnNotFoundRequestTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public class ResponseIdOnNotFoundRequestTest : BunqSdkTestBase
1010
public void TestBadRequestWithResponseId()
1111
{
1212
SetUpTestCase();
13-
13+
1414
var caughtException = Assert.Throws<NotFoundException>(
1515
() => Payment.Get(0)
1616
);
17-
17+
1818
Assert.NotNull(caughtException.ResponseId);
1919
}
2020
}
21-
}
21+
}

0 commit comments

Comments
 (0)