Skip to content

Commit

Permalink
Apply code formatting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTTY committed May 17, 2024
1 parent 6cc5154 commit 0538380
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ArgumentException>(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."));
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -247,4 +248,4 @@ await _apiClient.AgreementsEndpoint.CreateAgreement("PKO_BPKOPLPW",
}

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task GetInstitutions()
Assert.That(result, Has.Count.GreaterThan(result2.Count));
});
}

/// <summary>
/// Tests the retrieving of institutions for a specific country.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task GetInstitutions()
Assert.That(institutions.Result!, Has.Count.EqualTo(2));
});
}

/// <summary>
/// Tests the retrieving of institutions for a specific country.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -121,4 +122,4 @@ internal class CredentialMockData(BasicResponse noAccountForGivenCredentialsErro
{
public BasicResponse NoAccountForGivenCredentialsError { get; set; } = noAccountForGivenCredentialsError;
public BasicResponse IpNotWhitelistedError { get; set; } = ipNotWhitelistedError;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ private async Task<NordigenApiResponse<Agreement, BasicResponse>> AcceptAgreemen
return await _nordigenClient.MakeRequest<Agreement, BasicResponse>(
$"{NordigenEndpointUrls.AgreementsEndpoint}{id}/accept/", HttpMethod.Put, cancellationToken, body: body);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task<NordigenApiResponse<Requisition, CreateRequisitionError>> Crea
agreementId, socialSecurityNumber, accountSelection, redirectImmediate);
var body = JsonContent.Create(requisition,
options: new JsonSerializerOptions {DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull});

return await _nordigenClient.MakeRequest<Requisition, CreateRequisitionError>(
NordigenEndpointUrls.RequisitionsEndpoint, HttpMethod.Post, cancellationToken, body: body);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ internal class CreateAgreementRequest
/// </summary>
[JsonPropertyName("institution_id")]
public string InstitutionId { get; set; }

/// <summary>
/// The access scope, which defines which information can be accessed, to request.
/// </summary>
[JsonPropertyName("access_scope")]
public List<AccessScope> AccessScope { get; set; }

/// <summary>
/// The length of the transaction history in days to request.
/// </summary>
Expand Down
106 changes: 53 additions & 53 deletions src/RobinTTY.NordigenApiClient/Models/Requests/SupportedCountry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,187 +12,187 @@ public enum SupportedCountry
{
/// <summary>
/// The country of Austria.
/// </summary>
/// </summary>
[Description("AT")]
Austria,

/// <summary>
/// The country of Belgium.
/// </summary>
/// </summary>
[Description("BE")]
Belgium,

/// <summary>
/// The country of Bulgaria.
/// </summary>
/// </summary>
[Description("BG")]
Bulgaria,

/// <summary>
/// The country of Croatia.
/// </summary>
/// </summary>
[Description("HR")]
Croatia,

/// <summary>
/// The country of Cyprus.
/// </summary>
/// </summary>
[Description("CY")]
Cyprus,

/// <summary>
/// The country of Czechia.
/// </summary>
/// </summary>
[Description("CZ")]
Czechia,

/// <summary>
/// The country of Germany.
/// </summary>
/// </summary>
[Description("DE")]
Germany,

/// <summary>
/// The country of Denmark.
/// </summary>
/// </summary>
[Description("DK")]
Denmark,

/// <summary>
/// The country of Estonia.
/// </summary>
/// </summary>
[Description("EE")]
Estonia,

/// <summary>
/// The country of Spain.
/// </summary>
/// </summary>
[Description("ES")]
Spain,

/// <summary>
/// The country of Finland.
/// </summary>
/// </summary>
[Description("FI")]
Finland,

/// <summary>
/// The country of France.
/// </summary>
/// </summary>
[Description("FR")]
France,

/// <summary>
/// The country of UnitedKingdom.
/// </summary>
/// </summary>
[Description("GB")]
UnitedKingdom,

/// <summary>
/// The country of Greece.
/// </summary>
/// </summary>
[Description("GR")]
Greece,

/// <summary>
/// The country of Hungary.
/// </summary>
/// </summary>
[Description("HU")]
Hungary,

/// <summary>
/// The country of Iceland.
/// </summary>
/// </summary>
[Description("IS")]
Iceland,

/// <summary>
/// The country of Ireland.
/// </summary>
/// </summary>
[Description("IE")]
Ireland,

/// <summary>
/// The country of Italy.
/// </summary>
/// </summary>
[Description("IT")]
Italy,

/// <summary>
/// The country of Latvia.
/// </summary>
/// </summary>
[Description("LV")]
Latvia,

/// <summary>
/// The country of Liechtenstein.
/// </summary>
/// </summary>
[Description("LI")]
Liechtenstein,

/// <summary>
/// The country of Lithuania.
/// </summary>
/// </summary>
[Description("LT")]
Lithuania,

/// <summary>
/// The country of Luxembourg.
/// </summary>
/// </summary>
[Description("LU")]
Luxembourg,

/// <summary>
/// The country of Malta.
/// </summary>
/// </summary>
[Description("MT")]
Malta,

/// <summary>
/// The country of Netherlands.
/// </summary>
/// </summary>
[Description("NL")]
Netherlands,

/// <summary>
/// The country of Norway.
/// </summary>
/// </summary>
[Description("NO")]
Norway,

/// <summary>
/// The country of Poland.
/// </summary>
/// </summary>
[Description("PL")]
Poland,

/// <summary>
/// The country of Portugal.
/// </summary>
/// </summary>
[Description("PT")]
Portugal,

/// <summary>
/// The country of Romania.
/// </summary>
/// </summary>
[Description("RO")]
Romania,

/// <summary>
/// The country of Sweden.
/// </summary>
/// </summary>
[Description("SE")]
Sweden,

/// <summary>
/// The country of Slovakia.
/// </summary>
/// </summary>
[Description("SK")]
Slovakia,

/// <summary>
/// The country of Slovenia.
/// </summary>
/// </summary>
[Description("SI")]
Slovenia
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace RobinTTY.NordigenApiClient.Models.Responses;

/// <summary>
/// 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 <see cref="Institution.SupportedFeatures"/> to verify if it is.
/// This feature is not supported by all banks, check <see cref="Institution.SupportedFeatures" /> to verify if it is.
/// </summary>
[JsonConverter(typeof(EnumDescriptionConverter<AccessScope>))]
public enum AccessScope
Expand All @@ -23,7 +23,7 @@ public enum AccessScope
Balances,

/// <summary>
/// Access scope required to access the transactions of an account.
/// Access scope required to access the transactions of an account.
/// </summary>
[Description("transactions")]
Transactions,
Expand Down
Loading

0 comments on commit 0538380

Please sign in to comment.