# NordigenApiClient
-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:
+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:
- Token
- Institutions
@@ -12,7 +14,9 @@ This library provides a .NET client for the [GoCardless Bank Account Data API](h
- Requisitions
- Accounts
-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).
+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).
## Quickstart Guide
@@ -61,11 +65,13 @@ You can get started with the Quickstart Guide below or take a look at the [full
Console.WriteLine($"Requisition couldn't be created: {requisitionResponse.Error.Summary}");
```
-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:
+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:
![authentication-flow](docs/static/img/authentication_flow.png)
-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.
+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.
```cs
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
Console.WriteLine($"Accounts couldn't be retrieved: {accountsResponse.Error.Summary}");
```
-7. Now you can retrieve details about your bank account and the balances/transactions using the account ID(s) we just acquired:
+7. Now you can retrieve details about your bank account and the balances/transactions using the account ID(s) we just
+ acquired:
```cs
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
});
```
-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/).
+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/).
diff --git a/docs/docs/api-reference/responses/api-rate-limits.md b/docs/docs/api-reference/responses/api-rate-limits.md
new file mode 100644
index 0000000..af22d8d
--- /dev/null
+++ b/docs/docs/api-reference/responses/api-rate-limits.md
@@ -0,0 +1,64 @@
+---
+title: ApiRateLimits
+---
+
+The `ApiRateLimits` class represents the rate limits of the GoCardless API.
+
+## Properties
+
+### `RequestLimit` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
+
+Indicates the maximum number of allowed requests within the defined time window. Usually populated in every response.
+
+### `RemainingRequests` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
+
+Indicates the number of remaining requests you can make in the current time window. Usually populated in every response.
+
+### `RemainingSecondsInTimeWindow` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
+
+Indicates the time remaining in the current time window (in seconds). Usually populated in every response.
+
+### `RequestLimitAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
+
+Indicates the maximum number of allowed requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint) within the defined time window. Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
+
+### `RemainingRequestsAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
+
+Indicates the number of remaining requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint) you can make in the current time window. Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
+
+### `RemainingSecondsInTimeWindowAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)
+
+Indicates the time remaining in the current time window (in seconds) for requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint). Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
+
+## Constructor
+
+```csharp
+public ApiRateLimits(int requestLimit, int remainingRequests, int remainingTimeInTimeWindow,
+ int maxAccountRequests, int remainingAccountRequests, int remainingTimeInAccountTimeWindow)
+```
+
+### Parameters
+
+#### `requestLimit` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
+
+Indicates the maximum number of allowed requests within the defined time window. Usually populated in every response.
+
+#### `remainingRequests` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
+
+Indicates the number of remaining requests you can make in the current time window. Usually populated in every response.
+
+#### `remainingSecondsInTimeWindow` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
+
+Indicates the time remaining in the current time window (in seconds). Usually populated in every response.
+
+#### `requestLimitAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
+
+Indicates the maximum number of allowed requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint) within the defined time window. Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
+
+#### `remainingRequestsAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
+
+Indicates the number of remaining requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint) you can make in the current time window. Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
+
+#### `remainingSecondsInTimeWindowAccountsEndpoint` - [int](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-int32)?
+
+Indicates the time remaining in the current time window (in seconds) for requests to the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint). Only populated in responses from the [AccountsEndpoint](/docs/api-reference/endpoints/accounts-endpoint).
diff --git a/docs/docs/api-reference/responses/nordigen-api-response.md b/docs/docs/api-reference/responses/nordigen-api-response.md
index 617519d..9dfbe74 100644
--- a/docs/docs/api-reference/responses/nordigen-api-response.md
+++ b/docs/docs/api-reference/responses/nordigen-api-response.md
@@ -22,10 +22,15 @@ The result returned by the API. Null if the the HTTP response was not successful
The error returned by the API. Null if the HTTP response was successful.
+### `RateLimits` - [ApiRateLimits](/docs/api-reference/responses/api-rate-limits)
+
+The rate limits of the GoCardless API.
+
## Constructor
```csharp
-public NordigenApiResponse(HttpStatusCode statusCode, bool isSuccess, TResult? result, TError? apiError)
+public NordigenApiResponse(HttpStatusCode statusCode, bool isSuccess,
+ TResult? result, TError? apiError, ApiRateLimits rateLimits)
```
### Parameters
@@ -46,6 +51,10 @@ The result returned by the API. Null if the the HTTP response was not successful
The error returned by the API. Null if the HTTP response was successful.
+#### `rateLimits` - [ApiRateLimits](/docs/api-reference/responses/api-rate-limits)
+
+The rate limits of the GoCardless API.
+
## Handling the `NordigenApiResponse` type
To learn more about how to best work with the `NordigenApiResponse` type see the [Handling API responses](/docs/handling-api-responses) guide.
diff --git a/docs/docs/handling-rate-limits.md b/docs/docs/handling-rate-limits.md
new file mode 100644
index 0000000..07ea907
--- /dev/null
+++ b/docs/docs/handling-rate-limits.md
@@ -0,0 +1,31 @@
+---
+title: Handling Rate Limits
+---
+
+The GoCardless API has [rate limits](https://bankaccountdata.zendesk.com/hc/en-gb/articles/11529637772188-Bank-Account-Data-API-Rate-Limits) depending on the endpoint you are using. With most endpoints you shouldn't run into problems since these limits are usually high enough for most uses.
+
+The [Accounts endpoint](/docs/api-reference/endpoints/accounts-endpoint) has very tight limitations though. It currently has a limit of 10 requests a day per access scope. That means 10 requests to each of the [details](/docs/api-reference/endpoints/accounts-endpoint#getaccountdetails), [balances](/docs/api-reference/endpoints/accounts-endpoint#getbalances) and [transactions](/docs/api-reference/endpoints/accounts-endpoint#gettransactions) endpoints. In the future this limit will be lowered to 4 per day (no date on this as of now).
+
+Unsuccessful requests to the API will count towards the general rate limits but not the more stringent limits of the [Accounts endpoint](/docs/api-reference/endpoints/accounts-endpoint). Only successful requests will count towards those.
+
+## Checking API rate limits
+
+You can check the rate limits as well as remaining requests with each request you make to the API. The property [`NordigenApiResponse.RateLimits`](/docs/api-reference/responses/nordigen-api-response#ratelimits---apiratelimits) will hold the returned information about the current API limits.
+
+You can check the limits as follows:
+
+```csharp
+// Execute the request you want to make:
+var bankAccountDetailsResponse = await client.AccountsEndpoint.GetAccountDetails(accountId);
+
+Console.WriteLine(bankAccountDetailsResponse.RateLimits.RequestLimit);
+Console.WriteLine(bankAccountDetailsResponse.RateLimits.RemainingRequests);
+Console.WriteLine(bankAccountDetailsResponse.RateLimits.RemainingSecondsInTimeWindow);
+Console.WriteLine(bankAccountDetailsResponse.RateLimits.RequestLimitAccountsEndpoint);
+Console.WriteLine(bankAccountDetailsResponse.RateLimits.RemainingRequestsAccountsEndpoint);
+Console.WriteLine(bankAccountDetailsResponse.RateLimits.RemainingSecondsInTimeWindowAccountsEndpoint);
+```
+
+It's important to handle these limits so your applications user experience isn't degraded. Refreshing data from bank accounts should be handled consciously, so you don't use up all your requests in a short time frame and aren't able to update for the rest of the day.
+
+If you are a company with a contract with GoCardless you can probably get in contact with their team about increasing these limits.
diff --git a/docs/release-notes/v10_0_0.md b/docs/release-notes/v10_0_0.md
index 83a0167..cea4c17 100644
--- a/docs/release-notes/v10_0_0.md
+++ b/docs/release-notes/v10_0_0.md
@@ -39,8 +39,8 @@ public async Task, BasicResponse>> GetInst
The `TokenPairUpdated` event is now raised whenever the `JsonWebTokenPair` property is successfully updated. Not only when it was automatically updated but also when done so by the user.
-**Full Changelog**: [v9.0.0...v10.0.0](https://github.com/RobinTTY/NordigenApiClient/compare/v9.0.0...v10.0.0)
-
## Other improvements
A full documentation of the library is now available at: [https://robintty.github.io/NordigenApiClient/](https://robintty.github.io/NordigenApiClient/)
+
+**Full Changelog**: [v9.0.0...v10.0.0](https://github.com/RobinTTY/NordigenApiClient/compare/v9.0.0...v10.0.0)
diff --git a/docs/release-notes/v10_1_0.md b/docs/release-notes/v10_1_0.md
new file mode 100644
index 0000000..e8cb6a4
--- /dev/null
+++ b/docs/release-notes/v10_1_0.md
@@ -0,0 +1,11 @@
+---
+slug: v10.1.0
+title: v10.1.0
+date: 2024-08-19T00:00
+---
+
+Added the ability to check newly introduced rate limits in the GoCardless API.
+
+Please refer to the [documentation](/docs/handling-rate-limits) for more information. You can also see the [announcement from GoCardless](https://bankaccountdata.zendesk.com/hc/en-gb/articles/11529584398236-Bank-API-Rate-Limits-and-Rate-Limit-Headers).
+
+**Full Changelog**: [v10.0.0...v10.1.0](https://github.com/RobinTTY/NordigenApiClient/compare/v10.0.0...v10.1.0)
diff --git a/docs/sidebars.ts b/docs/sidebars.ts
index eb9e3fa..2cb5bbe 100644
--- a/docs/sidebars.ts
+++ b/docs/sidebars.ts
@@ -6,6 +6,7 @@ const sidebars: SidebarsConfig = {
"quickstart-guide",
"handling-api-responses",
"handling-authentication-tokens",
+ "handling-rate-limits",
"using-a-different-base-address",
"usage-with-older-dotnet-versions",
"testing",
@@ -38,6 +39,7 @@ const sidebars: SidebarsConfig = {
"api-reference/responses/address",
"api-reference/responses/agreement",
"api-reference/responses/amount-currency-pair",
+ "api-reference/responses/api-rate-limits",
"api-reference/responses/balance",
"api-reference/responses/balance-type",
"api-reference/responses/bank-account",
diff --git a/src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs b/src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs
index 7fb9570..f5f959f 100644
--- a/src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs
+++ b/src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs
@@ -72,4 +72,4 @@
Console.WriteLine($"Remittance: {transaction.RemittanceInformationUnstructured}");
Console.WriteLine($"Booking date:{transaction.ValueDate}");
Console.WriteLine($"Amount: {transactionAmount.Amount} {transactionAmount.Currency}");
- });
+ });
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/.gitignore b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/.gitignore
new file mode 100644
index 0000000..6898b60
--- /dev/null
+++ b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/.gitignore
@@ -0,0 +1,13 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Rider ignored files
+/modules.xml
+/.idea.RobinTTY.NordigenApiClient.iml
+/contentModel.xml
+/projectSettingsUpdater.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/.name b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/.name
new file mode 100644
index 0000000..611320e
--- /dev/null
+++ b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/.name
@@ -0,0 +1 @@
+RobinTTY.NordigenApiClient
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/encodings.xml b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/encodings.xml
new file mode 100644
index 0000000..df87cf9
--- /dev/null
+++ b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/indexLayout.xml b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/indexLayout.xml
new file mode 100644
index 0000000..7b08163
--- /dev/null
+++ b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/vcs.xml b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/vcs.xml
new file mode 100644
index 0000000..b2bdec2
--- /dev/null
+++ b/src/RobinTTY.NordigenApiClient.Tests/.idea/.idea.RobinTTY.NordigenApiClient.dir/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/AuthenticationTests.cs b/src/RobinTTY.NordigenApiClient.Tests/AuthenticationTests.cs
index c778001..9eafc69 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/AuthenticationTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/AuthenticationTests.cs
@@ -75,4 +75,4 @@ public void CheckForTokenExpiry()
Assert.That(token.IsExpired(diffInvalid), Is.True);
});
}
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/EnumDescriptionConverterTests.cs b/src/RobinTTY.NordigenApiClient.Tests/EnumDescriptionConverterTests.cs
index 885a63f..00669e1 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/EnumDescriptionConverterTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/EnumDescriptionConverterTests.cs
@@ -66,4 +66,4 @@ public void DeserializeEnum(string descriptor, T expectedDeserializedValue)
var enumValue = JsonSerializer.Deserialize($"\"{descriptor}\"");
Assert.That(enumValue, Is.EqualTo(expectedDeserializedValue));
}
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/CredentialTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/CredentialTests.cs
index 92a98f1..7085e5a 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/CredentialTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/CredentialTests.cs
@@ -17,7 +17,8 @@ public void Setup()
#region RequestsWithSuccessfulResponse
///
- /// Tests that is populated after the first authenticated request is made.
+ /// Tests that is populated after the first authenticated request is
+ /// made.
///
[Test]
public async Task CheckValidTokensAfterRequest()
@@ -105,4 +106,4 @@ public async Task ExecuteRequestWithUnauthorizedIp()
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs
index a2608a4..ec5b3b9 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs
@@ -210,7 +210,8 @@ public async Task GetTransactionRangeInFuture()
}
///
- /// 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.
+ /// 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.
///
[Test]
public void GetTransactionRangeWithIncorrectRange()
@@ -237,4 +238,4 @@ await _apiClient.AccountsEndpoint.GetTransactions(_accountId, DateOnly.FromDateT
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs
index 015b1b1..bb0d1c4 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs
@@ -201,7 +201,8 @@ await _apiClient.AgreementsEndpoint.CreateAgreement(null!, uint.MaxValue, uint.M
}
///
- /// Tests the creation of an end user agreement with invalid accessValidForDays and maxHistoricalDays for that particular institution.
+ /// Tests the creation of an end user agreement with invalid accessValidForDays and maxHistoricalDays for that
+ /// particular institution.
///
[Test]
public async Task CreateAgreementWithInvalidArgumentsForInstitution()
@@ -237,11 +238,12 @@ await _apiClient.AgreementsEndpoint.CreateAgreement("PKO_BPKOPLPW",
Assert.That(response.Error!.AccessScopeError!.Detail,
Is.EqualTo("For this institution the following scopes are required together: ['details', 'balances']"));
- Assert.That(response.Error!.AccessScopeError.Summary, Is.EqualTo("Institution access scope dependencies error"));
+ Assert.That(response.Error!.AccessScopeError.Summary,
+ Is.EqualTo("Institution access scope dependencies error"));
Assert.That(new[] {response.Error!.InstitutionIdError, response.Error!.AgreementError}, Has.All.Null);
});
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs
index 5a91c64..cfcc3b4 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs
@@ -144,4 +144,4 @@ public async Task GetNonExistingInstitution()
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/RequisitionsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/RequisitionsEndpointTests.cs
index 75de8d1..c005721 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/RequisitionsEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/RequisitionsEndpointTests.cs
@@ -208,4 +208,4 @@ await _apiClient.RequisitionsEndpoint.CreateRequisition("", redirect, agreementI
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/TokenEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/TokenEndpointTests.cs
index cf48537..5e62447 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/TokenEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/TokenEndpointTests.cs
@@ -48,8 +48,8 @@ public async Task ReuseExpiredToken()
}
///
- /// Tests whether the event is raised when the token pair is updated
- /// automatically by the client itself.
+ /// Tests whether the event is raised when the token pair is updated
+ /// automatically by the client itself.
///
[Test]
public async Task TokenPairUpdateIsRaisedOnInternalUpdate()
@@ -68,10 +68,10 @@ public async Task TokenPairUpdateIsRaisedOnInternalUpdate()
Assert.That(eventArgs.JsonWebTokenPair.RefreshToken.EncodedToken, Is.Not.Empty);
});
}
-
+
///
- /// Tests whether the event is raised when the token pair is updated
- /// by the user.
+ /// Tests whether the event is raised when the token pair is updated
+ /// by the user.
///
[Test]
public void TokenPairUpdateIsRaisedOnManualUpdate()
@@ -117,4 +117,4 @@ public async Task GetTokenWithInvalidCredentials()
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs
index 7895e27..db1fcd3 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs
@@ -71,4 +71,4 @@ private async Task ExecuteExampleRequest(NordigenClient apiClient)
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/CredentialTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/CredentialTests.cs
index b12c819..a0bfd95 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/CredentialTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/CredentialTests.cs
@@ -9,7 +9,8 @@ public class CredentialTests
#region RequestsWithSuccessfulResponse
///
- /// Tests that is populated after the first authenticated request is made.
+ /// Tests that is populated after the first authenticated request is
+ /// made.
///
[Test]
public async Task CheckValidTokensAfterRequest()
@@ -29,8 +30,8 @@ public async Task CheckValidTokensAfterRequest()
}
///
- /// Tests whether the event is raised when the token pair is updated
- /// automatically by the client itself.
+ /// Tests whether the event is raised when the token pair is updated
+ /// automatically by the client itself.
///
[Test]
public async Task TokenPairUpdateIsRaisedOnInternalUpdate()
@@ -52,8 +53,8 @@ public async Task TokenPairUpdateIsRaisedOnInternalUpdate()
}
///
- /// Tests whether the event is raised when the token pair is updated
- /// by the user.
+ /// Tests whether the event is raised when the token pair is updated
+ /// by the user.
///
[Test]
public void TokenPairUpdateIsRaisedOnManualUpdate()
@@ -120,4 +121,4 @@ public async Task ExecuteRequestWithUnauthorizedIp()
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AccountsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AccountsEndpointTests.cs
index 116a243..6969572 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AccountsEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AccountsEndpointTests.cs
@@ -234,7 +234,8 @@ public async Task GetTransactionRangeInFuture()
}
///
- /// 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.
+ /// 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.
///
[Test]
public void GetTransactionRangeWithIncorrectRange()
@@ -262,4 +263,4 @@ await apiClient.AccountsEndpoint.GetTransactions(A.Dummy(), DateOnly.FromD
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AgreementsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AgreementsEndpointTests.cs
index 38bdad7..84a0a88 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AgreementsEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AgreementsEndpointTests.cs
@@ -268,4 +268,4 @@ public async Task CreateAgreementWithInvalidParamsAtPolishInstitution()
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs
index 023d426..905813c 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs
@@ -126,4 +126,4 @@ public async Task GetNonExistingInstitution()
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/RequisitionsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/RequisitionsEndpointTests.cs
index 0c040df..dbc00a6 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/RequisitionsEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/RequisitionsEndpointTests.cs
@@ -235,4 +235,4 @@ await apiClient.RequisitionsEndpoint.CreateRequisition("", redirect, agreementId
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/TokenEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/TokenEndpointTests.cs
index 025b788..bbb7521 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/TokenEndpointTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/TokenEndpointTests.cs
@@ -66,4 +66,4 @@ public async Task RefreshAccessToken()
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/FakeHttpMessageHandler.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/FakeHttpMessageHandler.cs
index b184a01..e898e68 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/FakeHttpMessageHandler.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/FakeHttpMessageHandler.cs
@@ -7,6 +7,6 @@ public abstract Task FakeSendAsync(
// sealed so FakeItEasy won't intercept calls to this method
protected sealed override Task SendAsync(
- HttpRequestMessage request, CancellationToken cancellationToken)
- => FakeSendAsync(request, cancellationToken);
-}
+ HttpRequestMessage request, CancellationToken cancellationToken) =>
+ FakeSendAsync(request, cancellationToken);
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs
index 3ea34b5..245de2d 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs
@@ -122,4 +122,4 @@ internal class CredentialMockData(BasicResponse noAccountForGivenCredentialsErro
{
public BasicResponse NoAccountForGivenCredentialsError { get; set; } = noAccountForGivenCredentialsError;
public BasicResponse IpNotWhitelistedError { get; set; } = ipNotWhitelistedError;
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/RobinTTY.NordigenApiClient.Tests.csproj b/src/RobinTTY.NordigenApiClient.Tests/RobinTTY.NordigenApiClient.Tests.csproj
index 08a954f..3c7eb42 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/RobinTTY.NordigenApiClient.Tests.csproj
+++ b/src/RobinTTY.NordigenApiClient.Tests/RobinTTY.NordigenApiClient.Tests.csproj
@@ -11,10 +11,10 @@
-
-
-
-
+
+
+
+
@@ -40,7 +40,7 @@
Always
- PreserveNewest
+ PreserveNewest
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Serialization/CreateAgreementErrorTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Serialization/CreateAgreementErrorTests.cs
index a76c792..ebde002 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Serialization/CreateAgreementErrorTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Serialization/CreateAgreementErrorTests.cs
@@ -32,4 +32,4 @@ public void DeserializeTransactionWithSingleCurrencyExchange()
"For this institution the following scopes are required together: ['details', 'balances']; Some Other Error Detail"));
});
}
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Serialization/TransactionTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Serialization/TransactionTests.cs
index 252df09..818adfa 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Serialization/TransactionTests.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Serialization/TransactionTests.cs
@@ -90,4 +90,4 @@ public async Task DeserializeWithException()
"The following JSON content caused the problem: { \"transactionId\": \"AB123456789\", \"entryReference\": \"123456789\", \"bookingDate\": \"2023-03-20\", \"bookingDateTime\":"));
}
}
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Shared/AssertionHelpers.cs b/src/RobinTTY.NordigenApiClient.Tests/Shared/AssertionHelpers.cs
index 3d5a5b1..8bf4952 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Shared/AssertionHelpers.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Shared/AssertionHelpers.cs
@@ -51,4 +51,4 @@ internal static void AssertBasicResponseMatchesExpectations(BasicResponse? respo
Assert.That(response?.Detail, Is.EqualTo(detail));
});
}
-}
+}
\ No newline at end of file
diff --git a/src/RobinTTY.NordigenApiClient.Tests/Shared/TestHelpers.cs b/src/RobinTTY.NordigenApiClient.Tests/Shared/TestHelpers.cs
index e83b96f..5d58e7e 100644
--- a/src/RobinTTY.NordigenApiClient.Tests/Shared/TestHelpers.cs
+++ b/src/RobinTTY.NordigenApiClient.Tests/Shared/TestHelpers.cs
@@ -12,6 +12,7 @@ namespace RobinTTY.NordigenApiClient.Tests.Shared;
internal static class TestHelpers
{
private static readonly JsonSerializerOptions JsonSerializerOptions;
+
public static TestSecrets Secrets { get; }
public static MockResponsesModel MockData { get; }
@@ -41,8 +42,9 @@ internal static NordigenClient GetConfiguredClient(string? baseAddress = null)
}
internal static NordigenClient GetMockClient(object? value, HttpStatusCode statusCode,
- bool addDefaultAuthToken = true) => GetMockClient([new ValueTuple