Skip to content

Commit

Permalink
Switch position of parameters in CreateAgreement
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTTY committed May 15, 2024
1 parent 1ca865b commit 4db7ca5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public async Task GetAccount()
{
Assert.That(account.Id, Is.EqualTo(_accountId));
Assert.That(account.Created, Is.EqualTo(DateTime.Parse("2023-07-30 23:23:47.958711Z").ToUniversalTime()));
Assert.That(account.LastAccessed, Is.EqualTo(DateTime.Parse("2024-05-04 09:35:36.74286Z").ToUniversalTime()));
Assert.That(account.Iban, Is.EqualTo("GL2010440000010445"));
Assert.That(account.InstitutionId, Is.EqualTo("SANDBOXFINANCE_SFIN0000"));
Assert.That(account.Status, Is.EqualTo(BankAccountStatus.Ready));
Expand Down Expand Up @@ -183,8 +182,9 @@ public async Task GetBalancesForAccountThatDoesNotExist()
[Test]
public async Task GetTransactionRangeInFuture()
{
var startDate = DateTime.Today.AddDays(1);
var endDate = DateTime.Today.AddMonths(1).AddDays(1);
var today = DateTime.UtcNow.Date;
var startDate = today.Date.AddDays(1);
var endDate = today.Date.AddMonths(1).AddDays(1);

// Returns AccountsError
#if NET6_0_OR_GREATER
Expand All @@ -202,10 +202,10 @@ public async Task GetTransactionRangeInFuture()
Assert.That(transactionsResponse.Error?.EndDateError, Is.Not.Null);
AssertionHelpers.AssertBasicResponseMatchesExpectations(transactionsResponse.Error?.StartDateError,
"Date can't be in future",
$"'{startDate:yyyy-MM-dd}' can't be greater than {DateTime.Today:yyyy-MM-dd}. Specify correct date range");
$"'{startDate:yyyy-MM-dd}' can't be greater than {today.Date:yyyy-MM-dd}. Specify correct date range");
AssertionHelpers.AssertBasicResponseMatchesExpectations(transactionsResponse.Error?.EndDateError,
"Date can't be in future",
$"'{endDate:yyyy-MM-dd}' can't be greater than {DateTime.Today:yyyy-MM-dd}. Specify correct date range");
$"'{endDate:yyyy-MM-dd}' can't be greater than {today.Date:yyyy-MM-dd}. Specify correct date range");
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ Task<NordigenApiResponse<Agreement, BasicResponse>> GetAgreement(string id,
/// Creates a new end user agreement which determines the scope and length of access to data provided by institutions.
/// </summary>
/// <param name="institutionId">The institution this agreement will refer to.</param>
/// <param name="maxHistoricalDays">The length of the transaction history in days to request.</param>
/// <param name="accessValidForDays">The length the access to the account will be valid for to request.</param>
/// <param name="maxHistoricalDays">The length of the transaction history in days to request.</param>
/// <param name="accessScope">The scope of information that will be available for access to request. By default all access scopes
/// (balances, transactions and details) will be requested.</param>
/// <param name="cancellationToken">Optional token to signal cancellation of the operation.</param>
/// <returns>A <see cref="NordigenApiResponse{TResponse, TError}" /> containing the created <see cref="Agreement" />.</returns>
public Task<NordigenApiResponse<Agreement, CreateAgreementError>> CreateAgreement(string institutionId,
uint maxHistoricalDays = 90, uint accessValidForDays = 90, List<AccessScope>? accessScope = null,
uint accessValidForDays = 90, uint maxHistoricalDays = 90, List<AccessScope>? accessScope = null,
CancellationToken cancellationToken = default);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task<NordigenApiResponse<Agreement, BasicResponse>> GetAgreement(st

/// <inheritdoc />
public async Task<NordigenApiResponse<Agreement, CreateAgreementError>> CreateAgreement(string institutionId,
uint maxHistoricalDays = 90, uint accessValidForDays = 90, List<AccessScope>? accessScope = null,
uint accessValidForDays = 90, uint maxHistoricalDays = 90, List<AccessScope>? accessScope = null,
CancellationToken cancellationToken = default)
{
var scope = accessScope ?? [AccessScope.Balances, AccessScope.Transactions, AccessScope.Details];
Expand Down

0 comments on commit 4db7ca5

Please sign in to comment.