Skip to content

Commit

Permalink
Merge pull request #504 from XeroAPI/XeroOpenAPI-PETOSS-345
Browse files Browse the repository at this point in the history
Fixes the tests for the IdempotencyKey changes
  • Loading branch information
thomas-anu authored Feb 7, 2024
2 parents e1b8af2 + 46b7a88 commit d7e6dc1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public async Task CreateBankTransactionsTest()
bankTransactions._BankTransactions = new List<BankTransaction> { new BankTransaction() };
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.CreateBankTransactionsAsync(accessToken, xeroTenantId, bankTransactions, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.CreateBankTransactionsAsync(accessToken, xeroTenantId, bankTransactions, summarizeErrors, null, idempotencyKey ).ConfigureAwait(false);
Assert.IsType<BankTransactions>(response);
}

Expand Down Expand Up @@ -304,7 +304,7 @@ public async Task CreateContactsTest()
Contacts contacts = new Contacts();
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.CreateContactsAsync(accessToken, xeroTenantId, contacts, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.CreateContactsAsync(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey).ConfigureAwait(false);
Assert.IsType<Contacts>(response);
}

Expand Down Expand Up @@ -362,7 +362,7 @@ public async Task CreateCreditNotesTest()
CreditNotes creditNotes = new CreditNotes();
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.CreateCreditNotesAsync(accessToken, xeroTenantId, creditNotes, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.CreateCreditNotesAsync(accessToken, xeroTenantId, creditNotes, summarizeErrors, null, idempotencyKey).ConfigureAwait(false);
Assert.IsType<CreditNotes>(response);
}

Expand Down Expand Up @@ -465,7 +465,7 @@ public async Task CreateInvoicesTest()
invoices._Invoices = invList;
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.CreateInvoicesAsync(accessToken, xeroTenantId, invoices, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.CreateInvoicesAsync(accessToken, xeroTenantId, invoices, summarizeErrors, null, idempotencyKey).ConfigureAwait(false);
Assert.IsType<Invoices>(response);
}

Expand Down Expand Up @@ -494,7 +494,7 @@ public async Task CreateItemsTest()
Items items = new Items();
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.CreateItemsAsync(accessToken, xeroTenantId, items, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.CreateItemsAsync(accessToken, xeroTenantId, items, summarizeErrors, null, idempotencyKey).ConfigureAwait(false);
Assert.IsType<Items>(response);
}

Expand Down Expand Up @@ -689,7 +689,7 @@ public async Task CreatePurchaseOrdersTest()
PurchaseOrders purchaseOrders = new PurchaseOrders();
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.CreatePurchaseOrdersAsync(accessToken, xeroTenantId, purchaseOrders, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.CreatePurchaseOrdersAsync(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey).ConfigureAwait(false);
Assert.IsType<PurchaseOrders>(response);
}

Expand Down Expand Up @@ -2742,7 +2742,7 @@ public async Task UpdateOrCreateBankTransactionsTest()
BankTransactions bankTransactions = new BankTransactions();
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.UpdateOrCreateBankTransactionsAsync(accessToken, xeroTenantId, bankTransactions, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.UpdateOrCreateBankTransactionsAsync(accessToken, xeroTenantId, bankTransactions, summarizeErrors, null, idempotencyKey).ConfigureAwait(false);
Assert.IsType<BankTransactions>(response);
}

Expand All @@ -2757,7 +2757,7 @@ public async Task UpdateOrCreateContactsTest()
string idempotencyKey = AutoFaker.Generate<string>();
Contacts contacts = new Contacts();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.UpdateOrCreateContactsAsync(accessToken, xeroTenantId, contacts, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.UpdateOrCreateContactsAsync(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey).ConfigureAwait(false);
Assert.IsType<Contacts>(response);
}

Expand All @@ -2772,7 +2772,7 @@ public async Task UpdateOrCreateCreditNotesTest()
CreditNotes creditNotes = new CreditNotes();
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.UpdateOrCreateCreditNotesAsync(accessToken, xeroTenantId, creditNotes, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.UpdateOrCreateCreditNotesAsync(accessToken, xeroTenantId, creditNotes, summarizeErrors, null, idempotencyKey).ConfigureAwait(false);
Assert.IsType<CreditNotes>(response);
}

Expand All @@ -2787,7 +2787,7 @@ public async Task UpdateOrCreateInvoicesTest()
Invoices invoices = new Invoices();
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.UpdateOrCreateInvoicesAsync(accessToken, xeroTenantId, invoices, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.UpdateOrCreateInvoicesAsync(accessToken, xeroTenantId, invoices, summarizeErrors, null, idempotencyKey).ConfigureAwait(false);
Assert.IsType<Invoices>(response);
}

Expand All @@ -2802,7 +2802,7 @@ public async Task UpdateOrCreateItemsTest()
Items items = new Items();
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.UpdateOrCreateItemsAsync(accessToken, xeroTenantId, items, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.UpdateOrCreateItemsAsync(accessToken, xeroTenantId, items, summarizeErrors, null, idempotencyKey).ConfigureAwait(false);
Assert.IsType<Items>(response);
}

Expand All @@ -2817,7 +2817,7 @@ public async Task UpdateOrCreatePurchaseOrdersTest()
PurchaseOrders purchaseOrders = new PurchaseOrders();
string idempotencyKey = AutoFaker.Generate<string>();
bool? summarizeErrors = AutoFaker.Generate<bool?>();
var response = await instance.UpdateOrCreatePurchaseOrdersAsync(accessToken, xeroTenantId, purchaseOrders, idempotencyKey, summarizeErrors).ConfigureAwait(false);
var response = await instance.UpdateOrCreatePurchaseOrdersAsync(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey).ConfigureAwait(false);
Assert.IsType<PurchaseOrders>(response);
}

Expand Down
2 changes: 1 addition & 1 deletion Xero.NetStandard.OAuth2.Test/Api/BankFeedsApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public async Task CreateStatementsTest()
{
Statements statements = new Statements();
string idempotencyKey = AutoFaker.Generate<string>();
var response = await instance.CreateStatementsAsync(accessToken, xeroTenantId, idempotencyKey, statements);
var response = await instance.CreateStatementsAsync(accessToken, xeroTenantId, statements, idempotencyKey);
Assert.IsType<Statements>(response);
}

Expand Down
10 changes: 5 additions & 5 deletions Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public async Task UpdateEmployeeTest()
Guid employeeId = AutoFaker.Generate<Guid>();
List<Employee> employee = new List<Employee> { new Employee() };
string idempotencyKey = AutoFaker.Generate<string>();
var response = await instance.UpdateEmployeeAsync(accessToken, xeroTenantId, employeeId, idempotencyKey, employee);
var response = await instance.UpdateEmployeeAsync(accessToken, xeroTenantId, employeeId, employee, idempotencyKey);
Assert.IsType<Employees>(response);
}

Expand All @@ -382,7 +382,7 @@ public async Task UpdatePayRunTest()
Guid payRunID = AutoFaker.Generate<Guid>();
string idempotencyKey = AutoFaker.Generate<string>();
List<PayRun> payRun = new List<PayRun> { new PayRun() };
var response = await instance.UpdatePayRunAsync(accessToken, xeroTenantId, payRunID, idempotencyKey, payRun);
var response = await instance.UpdatePayRunAsync(accessToken, xeroTenantId, payRunID, payRun, idempotencyKey);
Assert.IsType<PayRuns>(response);
}

Expand All @@ -395,7 +395,7 @@ public async Task UpdatePayslipTest()
Guid payslipID = AutoFaker.Generate<Guid>();
string idempotencyKey = AutoFaker.Generate<string>();
List<PayslipLines> payslipLines = new List<PayslipLines> { new PayslipLines() };
var response = await instance.UpdatePayslipAsync(accessToken, xeroTenantId, payslipID, idempotencyKey, payslipLines);
var response = await instance.UpdatePayslipAsync(accessToken, xeroTenantId, payslipID, payslipLines, idempotencyKey);
Assert.IsType<Payslips>(response);
}

Expand All @@ -408,7 +408,7 @@ public async Task UpdateSuperfundTest()
Guid superFundID = AutoFaker.Generate<Guid>();
string idempotencyKey = AutoFaker.Generate<string>();
List<SuperFund> superFund = new List<SuperFund> { new SuperFund() };
var response = await instance.UpdateSuperfundAsync(accessToken, xeroTenantId, superFundID, idempotencyKey, superFund);
var response = await instance.UpdateSuperfundAsync(accessToken, xeroTenantId, superFundID, superFund, idempotencyKey);
Assert.IsType<SuperFunds>(response);
}

Expand All @@ -421,7 +421,7 @@ public async Task UpdateTimesheetTest()
Guid timesheetID = AutoFaker.Generate<Guid>();
string idempotencyKey = AutoFaker.Generate<string>();
List<Timesheet> timesheet = new List<Timesheet> { new Timesheet() };
var response = await instance.UpdateTimesheetAsync(accessToken, xeroTenantId, timesheetID, idempotencyKey, timesheet);
var response = await instance.UpdateTimesheetAsync(accessToken, xeroTenantId, timesheetID, timesheet, idempotencyKey);
Assert.IsType<Timesheets>(response);
}

Expand Down

0 comments on commit d7e6dc1

Please sign in to comment.