diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs index 95378a5..45176dc 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs @@ -228,8 +228,8 @@ await _apiClient.AccountsEndpoint.GetTransactions(_accountId, DateOnly.FromDateT $"Starting date '{DateOnly.FromDateTime(startDate)}' is greater than end date '{DateOnly.FromDateTime(endDateBeforeStartDate)}'. When specifying date range, starting date must precede the end date.")); #else var exception = Assert.ThrowsAsync(async () => - await _apiClient.AccountsEndpoint.GetTransactions(_accountId, startDate, endDateBeforeStartDate)); - + await _apiClient.AccountsEndpoint.GetTransactions(_accountId, startDate, endDateBeforeStartDate)); + Assert.That(exception.Message, Is.EqualTo( $"Starting date '{startDate}' is greater than end date '{endDateBeforeStartDate}'. When specifying date range, starting date must precede the end date.")); diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs index c2fe3be..22f8db3 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs @@ -1,5 +1,4 @@ -using RobinTTY.NordigenApiClient.Models.Requests; -using RobinTTY.NordigenApiClient.Models.Responses; +using RobinTTY.NordigenApiClient.Models.Responses; using RobinTTY.NordigenApiClient.Tests.Shared; namespace RobinTTY.NordigenApiClient.Tests.LiveApi.Endpoints; @@ -121,7 +120,9 @@ public async Task CreateAcceptAndDeleteAgreement() }); // Accept the agreement (should fail) - var acceptResponse = await _apiClient.AgreementsEndpoint.AcceptAgreement(response.Result!.Id, "example_user_agent", "192.168.178.1"); + var acceptResponse = + await _apiClient.AgreementsEndpoint.AcceptAgreement(response.Result!.Id, "example_user_agent", + "192.168.178.1"); AssertionHelpers.AssertNordigenApiResponseIsUnsuccessful(acceptResponse, HttpStatusCode.Forbidden); Assert.That(acceptResponse.Error!.Detail, Is.EqualTo( @@ -247,4 +248,4 @@ await _apiClient.AgreementsEndpoint.CreateAgreement("PKO_BPKOPLPW", } #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 97640de..5a91c64 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs @@ -36,7 +36,7 @@ public async Task GetInstitutions() Assert.That(result, Has.Count.GreaterThan(result2.Count)); }); } - + /// /// Tests the retrieving of institutions for a specific country. /// diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs index 284e210..7895e27 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs @@ -31,7 +31,7 @@ public async Task ExecuteRequestsUntilRateLimitReached() #if NET6_0_OR_GREATER AssertionHelpers.AssertNordigenApiResponseIsUnsuccessful(unsuccessfulRequest, HttpStatusCode.TooManyRequests); #else - AssertionHelpers.AssertNordigenApiResponseIsUnsuccessful(unsuccessfulRequest, (HttpStatusCode)429); + AssertionHelpers.AssertNordigenApiResponseIsUnsuccessful(unsuccessfulRequest, (HttpStatusCode) 429); #endif Assert.That(unsuccessfulRequest.Error!.Summary, Is.EqualTo("Rate limit exceeded")); Assert.That(unsuccessfulRequest.Error!.Detail, diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs index fa7858a..023d426 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs @@ -25,7 +25,7 @@ public async Task GetInstitutions() Assert.That(institutions.Result!, Has.Count.EqualTo(2)); }); } - + /// /// Tests the retrieving of institutions for a specific country. /// diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs index a5881b7..3ea34b5 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs @@ -65,7 +65,8 @@ internal class AgreementsEndpointMockData( public CreateAgreementError CreateAgreementWithInvalidInstitutionId { get; set; } = createAgreementWithInvalidInstitutionId; - public CreateAgreementError CreateAgreementWithInvalidArgumentsForInstitution { get; set; } = createAgreementWithInvalidArgumentsForInstitution; + public CreateAgreementError CreateAgreementWithInvalidArgumentsForInstitution { get; set; } = + createAgreementWithInvalidArgumentsForInstitution; public CreateAgreementError CreateAgreementWithInvalidArguments { get; set; } = createAgreementWithInvalidArguments; @@ -121,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/Endpoints/AgreementsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Endpoints/AgreementsEndpoint.cs index 999fb48..d225e88 100644 --- a/src/RobinTTY.NordigenApiClient/Endpoints/AgreementsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Endpoints/AgreementsEndpoint.cs @@ -91,4 +91,4 @@ private async Task> AcceptAgreemen return await _nordigenClient.MakeRequest( $"{NordigenEndpointUrls.AgreementsEndpoint}{id}/accept/", HttpMethod.Put, cancellationToken, body: body); } -} \ No newline at end of file +} diff --git a/src/RobinTTY.NordigenApiClient/Endpoints/RequisitionsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Endpoints/RequisitionsEndpoint.cs index 165f6ae..3400bce 100644 --- a/src/RobinTTY.NordigenApiClient/Endpoints/RequisitionsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Endpoints/RequisitionsEndpoint.cs @@ -51,7 +51,7 @@ public async Task> Crea agreementId, socialSecurityNumber, accountSelection, redirectImmediate); var body = JsonContent.Create(requisition, options: new JsonSerializerOptions {DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull}); - + return await _nordigenClient.MakeRequest( NordigenEndpointUrls.RequisitionsEndpoint, HttpMethod.Post, cancellationToken, body: body); } diff --git a/src/RobinTTY.NordigenApiClient/Models/Requests/CreateAgreementRequest.cs b/src/RobinTTY.NordigenApiClient/Models/Requests/CreateAgreementRequest.cs index 161eb0c..c56a39d 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Requests/CreateAgreementRequest.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Requests/CreateAgreementRequest.cs @@ -14,13 +14,13 @@ internal class CreateAgreementRequest /// [JsonPropertyName("institution_id")] public string InstitutionId { get; set; } - + /// /// The access scope, which defines which information can be accessed, to request. /// [JsonPropertyName("access_scope")] public List AccessScope { get; set; } - + /// /// The length of the transaction history in days to request. /// diff --git a/src/RobinTTY.NordigenApiClient/Models/Requests/SupportedCountry.cs b/src/RobinTTY.NordigenApiClient/Models/Requests/SupportedCountry.cs index b7f0c0f..55e84fc 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Requests/SupportedCountry.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Requests/SupportedCountry.cs @@ -12,187 +12,187 @@ public enum SupportedCountry { /// /// The country of Austria. - /// + /// [Description("AT")] Austria, - + /// /// The country of Belgium. - /// + /// [Description("BE")] Belgium, - + /// /// The country of Bulgaria. - /// + /// [Description("BG")] Bulgaria, - + /// /// The country of Croatia. - /// + /// [Description("HR")] Croatia, - + /// /// The country of Cyprus. - /// + /// [Description("CY")] Cyprus, - + /// /// The country of Czechia. - /// + /// [Description("CZ")] Czechia, - + /// /// The country of Germany. - /// + /// [Description("DE")] Germany, - + /// /// The country of Denmark. - /// + /// [Description("DK")] Denmark, - + /// /// The country of Estonia. - /// + /// [Description("EE")] Estonia, - + /// /// The country of Spain. - /// + /// [Description("ES")] Spain, - + /// /// The country of Finland. - /// + /// [Description("FI")] Finland, - + /// /// The country of France. - /// + /// [Description("FR")] France, - + /// /// The country of UnitedKingdom. - /// + /// [Description("GB")] UnitedKingdom, - + /// /// The country of Greece. - /// + /// [Description("GR")] Greece, - + /// /// The country of Hungary. - /// + /// [Description("HU")] Hungary, - + /// /// The country of Iceland. - /// + /// [Description("IS")] Iceland, - + /// /// The country of Ireland. - /// + /// [Description("IE")] Ireland, - + /// /// The country of Italy. - /// + /// [Description("IT")] Italy, - + /// /// The country of Latvia. - /// + /// [Description("LV")] Latvia, - + /// /// The country of Liechtenstein. - /// + /// [Description("LI")] Liechtenstein, - + /// /// The country of Lithuania. - /// + /// [Description("LT")] Lithuania, /// /// The country of Luxembourg. - /// + /// [Description("LU")] Luxembourg, /// /// The country of Malta. - /// + /// [Description("MT")] Malta, /// /// The country of Netherlands. - /// + /// [Description("NL")] Netherlands, /// /// The country of Norway. - /// + /// [Description("NO")] Norway, /// /// The country of Poland. - /// + /// [Description("PL")] Poland, /// /// The country of Portugal. - /// + /// [Description("PT")] Portugal, /// /// The country of Romania. - /// + /// [Description("RO")] Romania, /// /// The country of Sweden. - /// + /// [Description("SE")] Sweden, - + /// /// The country of Slovakia. - /// + /// [Description("SK")] Slovakia, - + /// /// The country of Slovenia. - /// + /// [Description("SI")] Slovenia } diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/AccessScope.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/AccessScope.cs index d224d36..78bb9f8 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/AccessScope.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/AccessScope.cs @@ -6,7 +6,7 @@ namespace RobinTTY.NordigenApiClient.Models.Responses; /// /// Access scopes can be used to limit the access to the 3 major data blocks the GoCardless API is offering. -/// This feature is not supported by all banks, check to verify if it is. +/// This feature is not supported by all banks, check to verify if it is. /// [JsonConverter(typeof(EnumDescriptionConverter))] public enum AccessScope @@ -23,7 +23,7 @@ public enum AccessScope Balances, /// - /// Access scope required to access the transactions of an account. + /// Access scope required to access the transactions of an account. /// [Description("transactions")] Transactions, diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/AccountDetails.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/AccountDetails.cs index 84a5e6e..3df744f 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/AccountDetails.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/AccountDetails.cs @@ -19,25 +19,25 @@ public class AccountDetails /// [JsonPropertyName("bban")] public string? Bban { get; } - + /// /// Primary account number (unique identifier on credit cards, debit cards, and other types of payment cards). /// [JsonPropertyName("pan")] public string? Pan { get; } - + /// /// Masked primary account number (unique identifier on credit cards, debit cards, and other types of payment cards). /// [JsonPropertyName("maskedPan")] public string? MaskedPan { get; } - + /// /// An alias to a payment account via a registered mobile phone number. /// [JsonPropertyName("msisdn")] public string? Msisdn { get; } - + /// /// The currency the amount is denominated in. /// @@ -45,7 +45,7 @@ public class AccountDetails public string Currency { get; } /// - /// Creates a new instance of . + /// Creates a new instance of . /// /// The IBAN of the bank account. /// Basic Bank Account Number represents a country-specific bank account number. diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/Address.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/Address.cs index 701e487..d71e2ae 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/Address.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/Address.cs @@ -12,25 +12,25 @@ public class Address /// [JsonPropertyName("streetName")] public string? StreetName { get; } - + /// /// The number of the building. /// [JsonPropertyName("buildingNumber")] public string? BuildingNumber { get; } - + /// /// The postcode of the town. /// [JsonPropertyName("postCode")] public string? PostCode { get; } - + /// /// The name of the town. /// [JsonPropertyName("townName")] public string? TownName { get; } - + /// /// The name of the country. /// @@ -38,7 +38,7 @@ public class Address public string? Country { get; } /// - /// Creates a new instance of . + /// Creates a new instance of . /// /// The name of the street. /// The number of the building. diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/Agreement.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/Agreement.cs index a5f4e93..55c3b07 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/Agreement.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/Agreement.cs @@ -24,19 +24,19 @@ public class Agreement /// [JsonPropertyName("accepted")] public DateTime? Accepted { get; } - + /// /// The institution this agreement refers to. /// [JsonPropertyName("institution_id")] public string InstitutionId { get; set; } - + /// /// The scope of information that can be accessed. /// [JsonPropertyName("access_scope")] public List AccessScope { get; set; } - + /// /// The length of the transaction history in days. /// @@ -60,7 +60,8 @@ public class Agreement /// The length the access to the account will be valid for. /// The scope of information that can be accessed. [JsonConstructor] - public Agreement(Guid id, DateTime created, DateTime? accepted, string institutionId, uint maxHistoricalDays, uint accessValidForDays, List accessScope) + public Agreement(Guid id, DateTime created, DateTime? accepted, string institutionId, uint maxHistoricalDays, + uint accessValidForDays, List accessScope) { Id = id; Created = created;