Skip to content

Commit feba57e

Browse files
committed
Apply code formatting
1 parent 2d3bb6a commit feba57e

File tree

88 files changed

+306
-201
lines changed

Some content is hidden

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

88 files changed

+306
-201
lines changed

README.md

+15-6
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44

55
# NordigenApiClient
66

7-
This library provides a .NET client for the [GoCardless Bank Account Data API](https://gocardless.com/bank-account-data/) (formerly Nordigen API). The following API endpoints are supported:
7+
This library provides a .NET client for
8+
the [GoCardless Bank Account Data API](https://gocardless.com/bank-account-data/) (formerly Nordigen API). The following
9+
API endpoints are supported:
810

911
- Token
1012
- Institutions
1113
- Agreements
1214
- Requisitions
1315
- Accounts
1416

15-
You can get started with the Quickstart Guide below or take a look at the [full documentation](https://robintty.github.io/NordigenApiClient/). You can find the nuget package [here](https://www.nuget.org/packages/RobinTTY.NordigenApiClient).
17+
You can get started with the Quickstart Guide below or take a look at
18+
the [full documentation](https://robintty.github.io/NordigenApiClient/). You can find the nuget
19+
package [here](https://www.nuget.org/packages/RobinTTY.NordigenApiClient).
1620

1721
## Quickstart Guide
1822

@@ -61,11 +65,13 @@ You can get started with the Quickstart Guide below or take a look at the [full
6165
Console.WriteLine($"Requisition couldn't be created: {requisitionResponse.Error.Summary}");
6266
```
6367

64-
5. You will now need to accept the end user agreement by following the authentication link you got in the last step. The authentication flow will roughly look like this:
68+
5. You will now need to accept the end user agreement by following the authentication link you got in the last step. The
69+
authentication flow will roughly look like this:
6570

6671
![authentication-flow](docs/static/img/authentication_flow.png)
6772

68-
6. Now that you have accepted the agreement we once again need to retrieve the requisition we created in step 4. This time the response will include the accounts you are now able to access.
73+
6. Now that you have accepted the agreement we once again need to retrieve the requisition we created in step 4. This
74+
time the response will include the accounts you are now able to access.
6975

7076
```cs
7177
var requisitionId = "your-requisition-id";
@@ -79,7 +85,8 @@ You can get started with the Quickstart Guide below or take a look at the [full
7985
Console.WriteLine($"Accounts couldn't be retrieved: {accountsResponse.Error.Summary}");
8086
```
8187

82-
7. Now you can retrieve details about your bank account and the balances/transactions using the account ID(s) we just acquired:
88+
7. Now you can retrieve details about your bank account and the balances/transactions using the account ID(s) we just
89+
acquired:
8390

8491
```cs
8592
var accountId = "your-account-id";
@@ -110,4 +117,6 @@ You can get started with the Quickstart Guide below or take a look at the [full
110117
});
111118
```
112119

113-
That's it! You are now able to retrieve the account details, balances and transactions of your bank account. If you wanna learn more about this library please refer to the [full documentation](https://robintty.github.io/NordigenApiClient/).
120+
That's it! You are now able to retrieve the account details, balances and transactions of your bank account. If you
121+
wanna learn more about this library please refer to
122+
the [full documentation](https://robintty.github.io/NordigenApiClient/).

src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@
7272
Console.WriteLine($"Remittance: {transaction.RemittanceInformationUnstructured}");
7373
Console.WriteLine($"Booking date:{transaction.ValueDate}");
7474
Console.WriteLine($"Amount: {transactionAmount.Amount} {transactionAmount.Currency}");
75-
});
75+
});

src/RobinTTY.NordigenApiClient.Tests/AuthenticationTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ public void CheckForTokenExpiry()
7575
Assert.That(token.IsExpired(diffInvalid), Is.True);
7676
});
7777
}
78-
}
78+
}

src/RobinTTY.NordigenApiClient.Tests/EnumDescriptionConverterTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ public void DeserializeEnum<T>(string descriptor, T expectedDeserializedValue)
6666
var enumValue = JsonSerializer.Deserialize<T>($"\"{descriptor}\"");
6767
Assert.That(enumValue, Is.EqualTo(expectedDeserializedValue));
6868
}
69-
}
69+
}

src/RobinTTY.NordigenApiClient.Tests/LiveApi/CredentialTests.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public void Setup()
1717
#region RequestsWithSuccessfulResponse
1818

1919
/// <summary>
20-
/// Tests that <see cref="NordigenClient.JsonWebTokenPair" /> is populated after the first authenticated request is made.
20+
/// Tests that <see cref="NordigenClient.JsonWebTokenPair" /> is populated after the first authenticated request is
21+
/// made.
2122
/// </summary>
2223
[Test]
2324
public async Task CheckValidTokensAfterRequest()
@@ -105,4 +106,4 @@ public async Task ExecuteRequestWithUnauthorizedIp()
105106
}
106107

107108
#endregion
108-
}
109+
}

src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ public async Task GetTransactionRangeInFuture()
210210
}
211211

212212
/// <summary>
213-
/// Tests the retrieval of transactions within a specific time frame where the date range is incorrect, since the endDate is before the startDate. This should throw an exception.
213+
/// Tests the retrieval of transactions within a specific time frame where the date range is incorrect, since the
214+
/// endDate is before the startDate. This should throw an exception.
214215
/// </summary>
215216
[Test]
216217
public void GetTransactionRangeWithIncorrectRange()
@@ -237,4 +238,4 @@ await _apiClient.AccountsEndpoint.GetTransactions(_accountId, DateOnly.FromDateT
237238
}
238239

239240
#endregion
240-
}
241+
}

src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ await _apiClient.AgreementsEndpoint.CreateAgreement(null!, uint.MaxValue, uint.M
201201
}
202202

203203
/// <summary>
204-
/// Tests the creation of an end user agreement with invalid accessValidForDays and maxHistoricalDays for that particular institution.
204+
/// Tests the creation of an end user agreement with invalid accessValidForDays and maxHistoricalDays for that
205+
/// particular institution.
205206
/// </summary>
206207
[Test]
207208
public async Task CreateAgreementWithInvalidArgumentsForInstitution()
@@ -237,11 +238,12 @@ await _apiClient.AgreementsEndpoint.CreateAgreement("PKO_BPKOPLPW",
237238

238239
Assert.That(response.Error!.AccessScopeError!.Detail,
239240
Is.EqualTo("For this institution the following scopes are required together: ['details', 'balances']"));
240-
Assert.That(response.Error!.AccessScopeError.Summary, Is.EqualTo("Institution access scope dependencies error"));
241+
Assert.That(response.Error!.AccessScopeError.Summary,
242+
Is.EqualTo("Institution access scope dependencies error"));
241243

242244
Assert.That(new[] {response.Error!.InstitutionIdError, response.Error!.AgreementError}, Has.All.Null);
243245
});
244246
}
245247

246248
#endregion
247-
}
249+
}

src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,4 @@ public async Task GetNonExistingInstitution()
144144
}
145145

146146
#endregion
147-
}
147+
}

src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/RequisitionsEndpointTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,4 @@ await _apiClient.RequisitionsEndpoint.CreateRequisition("", redirect, agreementI
208208
}
209209

210210
#endregion
211-
}
211+
}

src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/TokenEndpointTests.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public async Task ReuseExpiredToken()
4848
}
4949

5050
/// <summary>
51-
/// Tests whether the <see cref="NordigenClient.TokenPairUpdated"/> event is raised when the token pair is updated
52-
/// automatically by the client itself.
51+
/// Tests whether the <see cref="NordigenClient.TokenPairUpdated" /> event is raised when the token pair is updated
52+
/// automatically by the client itself.
5353
/// </summary>
5454
[Test]
5555
public async Task TokenPairUpdateIsRaisedOnInternalUpdate()
@@ -68,10 +68,10 @@ public async Task TokenPairUpdateIsRaisedOnInternalUpdate()
6868
Assert.That(eventArgs.JsonWebTokenPair.RefreshToken.EncodedToken, Is.Not.Empty);
6969
});
7070
}
71-
71+
7272
/// <summary>
73-
/// Tests whether the <see cref="NordigenClient.TokenPairUpdated"/> event is raised when the token pair is updated
74-
/// by the user.
73+
/// Tests whether the <see cref="NordigenClient.TokenPairUpdated" /> event is raised when the token pair is updated
74+
/// by the user.
7575
/// </summary>
7676
[Test]
7777
public void TokenPairUpdateIsRaisedOnManualUpdate()
@@ -117,4 +117,4 @@ public async Task GetTokenWithInvalidCredentials()
117117
}
118118

119119
#endregion
120-
}
120+
}

src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ private async Task ExecuteExampleRequest(NordigenClient apiClient)
7171
}
7272

7373
#endregion
74-
}
74+
}

src/RobinTTY.NordigenApiClient.Tests/Mocks/CredentialTests.cs

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ public class CredentialTests
99
#region RequestsWithSuccessfulResponse
1010

1111
/// <summary>
12-
/// Tests that <see cref="NordigenClient.JsonWebTokenPair" /> is populated after the first authenticated request is made.
12+
/// Tests that <see cref="NordigenClient.JsonWebTokenPair" /> is populated after the first authenticated request is
13+
/// made.
1314
/// </summary>
1415
[Test]
1516
public async Task CheckValidTokensAfterRequest()
@@ -29,8 +30,8 @@ public async Task CheckValidTokensAfterRequest()
2930
}
3031

3132
/// <summary>
32-
/// Tests whether the <see cref="NordigenClient.TokenPairUpdated"/> event is raised when the token pair is updated
33-
/// automatically by the client itself.
33+
/// Tests whether the <see cref="NordigenClient.TokenPairUpdated" /> event is raised when the token pair is updated
34+
/// automatically by the client itself.
3435
/// </summary>
3536
[Test]
3637
public async Task TokenPairUpdateIsRaisedOnInternalUpdate()
@@ -52,8 +53,8 @@ public async Task TokenPairUpdateIsRaisedOnInternalUpdate()
5253
}
5354

5455
/// <summary>
55-
/// Tests whether the <see cref="NordigenClient.TokenPairUpdated"/> event is raised when the token pair is updated
56-
/// by the user.
56+
/// Tests whether the <see cref="NordigenClient.TokenPairUpdated" /> event is raised when the token pair is updated
57+
/// by the user.
5758
/// </summary>
5859
[Test]
5960
public void TokenPairUpdateIsRaisedOnManualUpdate()
@@ -120,4 +121,4 @@ public async Task ExecuteRequestWithUnauthorizedIp()
120121
}
121122

122123
#endregion
123-
}
124+
}

src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AccountsEndpointTests.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ public async Task GetTransactionRangeInFuture()
234234
}
235235

236236
/// <summary>
237-
/// Tests the retrieval of transactions within a specific time frame where the date range is incorrect, since the endDate is before the startDate. This should throw an exception.
237+
/// Tests the retrieval of transactions within a specific time frame where the date range is incorrect, since the
238+
/// endDate is before the startDate. This should throw an exception.
238239
/// </summary>
239240
[Test]
240241
public void GetTransactionRangeWithIncorrectRange()
@@ -262,4 +263,4 @@ await apiClient.AccountsEndpoint.GetTransactions(A.Dummy<Guid>(), DateOnly.FromD
262263
}
263264

264265
#endregion
265-
}
266+
}

src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AgreementsEndpointTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,4 @@ public async Task CreateAgreementWithInvalidParamsAtPolishInstitution()
268268
}
269269

270270
#endregion
271-
}
271+
}

src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@ public async Task GetNonExistingInstitution()
126126
}
127127

128128
#endregion
129-
}
129+
}

src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/RequisitionsEndpointTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,4 @@ await apiClient.RequisitionsEndpoint.CreateRequisition("", redirect, agreementId
235235
}
236236

237237
#endregion
238-
}
238+
}

src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/TokenEndpointTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ public async Task RefreshAccessToken()
6666
}
6767

6868
#endregion
69-
}
69+
}

src/RobinTTY.NordigenApiClient.Tests/Mocks/FakeHttpMessageHandler.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ public abstract Task<HttpResponseMessage> FakeSendAsync(
77

88
// sealed so FakeItEasy won't intercept calls to this method
99
protected sealed override Task<HttpResponseMessage> SendAsync(
10-
HttpRequestMessage request, CancellationToken cancellationToken)
11-
=> FakeSendAsync(request, cancellationToken);
12-
}
10+
HttpRequestMessage request, CancellationToken cancellationToken) =>
11+
FakeSendAsync(request, cancellationToken);
12+
}

src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ internal class CredentialMockData(BasicResponse noAccountForGivenCredentialsErro
122122
{
123123
public BasicResponse NoAccountForGivenCredentialsError { get; set; } = noAccountForGivenCredentialsError;
124124
public BasicResponse IpNotWhitelistedError { get; set; } = ipNotWhitelistedError;
125-
}
125+
}

src/RobinTTY.NordigenApiClient.Tests/RobinTTY.NordigenApiClient.Tests.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="FakeItEasy" Version="8.2.0"/>
14-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
15-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
16-
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
17-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0"/>
15+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0"/>
16+
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0"/>
17+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0"/>
1818
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0"/>
1919
<PackageReference Include="NUnit" Version="4.1.0"/>
2020
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
@@ -40,7 +40,7 @@
4040
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
4141
</None>
4242
<None Update="appsettings.test.json">
43-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
43+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4444
</None>
4545
</ItemGroup>
4646

src/RobinTTY.NordigenApiClient.Tests/Serialization/CreateAgreementErrorTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ public void DeserializeTransactionWithSingleCurrencyExchange()
3232
"For this institution the following scopes are required together: ['details', 'balances']; Some Other Error Detail"));
3333
});
3434
}
35-
}
35+
}

src/RobinTTY.NordigenApiClient.Tests/Serialization/TransactionTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ public async Task DeserializeWithException()
9090
"The following JSON content caused the problem: { \"transactionId\": \"AB123456789\", \"entryReference\": \"123456789\", \"bookingDate\": \"2023-03-20\", \"bookingDateTime\":"));
9191
}
9292
}
93-
}
93+
}

src/RobinTTY.NordigenApiClient.Tests/Shared/AssertionHelpers.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ internal static void AssertBasicResponseMatchesExpectations(BasicResponse? respo
5151
Assert.That(response?.Detail, Is.EqualTo(detail));
5252
});
5353
}
54-
}
54+
}

src/RobinTTY.NordigenApiClient.Tests/Shared/TestHelpers.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace RobinTTY.NordigenApiClient.Tests.Shared;
1212
internal static class TestHelpers
1313
{
1414
private static readonly JsonSerializerOptions JsonSerializerOptions;
15+
1516
public static TestSecrets Secrets { get; }
1617
public static MockResponsesModel MockData { get; }
1718

@@ -41,8 +42,9 @@ internal static NordigenClient GetConfiguredClient(string? baseAddress = null)
4142
}
4243

4344
internal static NordigenClient GetMockClient(object? value, HttpStatusCode statusCode,
44-
bool addDefaultAuthToken = true) => GetMockClient([new ValueTuple<object?, HttpStatusCode>(value, statusCode)],
45-
addDefaultAuthToken);
45+
bool addDefaultAuthToken = true) =>
46+
GetMockClient([new ValueTuple<object?, HttpStatusCode>(value, statusCode)],
47+
addDefaultAuthToken);
4648

4749
private static NordigenClient GetMockClient(List<(object? Value, HttpStatusCode StatusCode)> responses,
4850
bool addDefaultAuthToken = true)
@@ -79,10 +81,10 @@ private static NordigenClient GetMockClient(List<(object? Value, HttpStatusCode
7981
var credentials = new NordigenClientCredentials(Secrets.ValidSecretId, Secrets.ValidSecretKey);
8082
return new NordigenClient(mockHttpClient, credentials);
8183
}
82-
84+
8385
private static TestSecrets? GetSecrets() =>
8486
new ConfigurationBuilder()
8587
.AddJsonFile("appsettings.test.json")
8688
.AddUserSecrets<TestSecrets>()
8789
.Build().Get<TestSecrets>();
88-
}
90+
}

src/RobinTTY.NordigenApiClient.Tests/Shared/TestSecrets.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ public class TestSecrets(
1818
public string ValidSecretIdWithWhitelist { get; init; } = validSecretIdWithWhitelist;
1919
public string ValidSecretKeyWithWhitelist { get; init; } = validSecretKeyWithWhitelist;
2020
public string UnauthorizedJwtToken { get; init; } = unauthorizedJwtToken;
21-
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
global using System.Net;
22
global using System.Net.Http;
3-
global using NUnit.Framework;
3+
global using NUnit.Framework;

0 commit comments

Comments
 (0)