diff --git a/.github/actions/notify-slack/action.yml b/.github/actions/notify-slack/action.yml new file mode 100644 index 00000000..add9673f --- /dev/null +++ b/.github/actions/notify-slack/action.yml @@ -0,0 +1,103 @@ +name: slack-alert-action +description: "Action to send slack payload to public-sdk-events channel" + +inputs: + heading_text: + required: true + description: "Heading of the slack payload" + alert_type: + required: true + description: "type of the slack alert" + job_status: + required: true + description: "status of the job" + XERO_SLACK_WEBHOOK_URL: + required: true + description: "webhook url for channel - public-sdk-events" + job_url: + required: true + description: "job run id link" + button_type: + required: true + description: "color for the check logs button" + package_version: + required: true + description: "released package version" + repo_link: + required: true + description: "link of the repo" + + +runs: + using: "composite" + + steps: + + - name: Send slack notification + id: slack + uses: slackapi/slack-github-action@v1.27.0 + env: + SLACK_WEBHOOK_URL: ${{inputs.XERO_SLACK_WEBHOOK_URL}} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + with: + payload: | + { + "blocks": [ + { + "type": "rich_text", + "elements": [ + { + "type": "rich_text_section", + "elements": [ + { + "type": "text", + "text": "${{inputs.heading_text}} ", + "style": { + "bold": true + } + }, + { + "type": "emoji", + "name": "${{inputs.alert_type}}" + } + ] + } + ] + }, + { + "type": "divider" + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Repository:* \n ${{inputs.repo_link}}" + }, + { + "type": "mrkdwn", + "text": "*Status:*\n ${{inputs.job_status}}" + }, + { + "type": "mrkdwn", + "text": "*Package Version:*\n ${{inputs.package_version}}" + } + ] + }, + { + "type": "actions", + "elements": [ + { + "type": "button", + "text": { + "type": "plain_text", + "text": "Check the logs", + "emoji": true + }, + "style": "${{inputs.button_type}}", + "url": "${{inputs.job_url}}" + } + ] + } + ] + } diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index fd3d16cf..7628e7d4 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -23,10 +23,32 @@ jobs: run: dotnet build working-directory: Xero-NetStandard + - name: Check for Outdated Packages + run: | + dotnet list package --outdated + working-directory: Xero-NetStandard + # - name: Validate Lint # run: dotnet format --verify-no-changes # working-directory: Xero-NetStandard - # - name: Run Test - # run: dotnet test - # working-directory: Xero-NetStandard \ No newline at end of file + - name: Set up Node environment + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Install Prism + run: npm install -g @stoplight/prism-cli + + - name: Start PRISM Server + run: ./start-prism.sh & sleep 15 + working-directory: Xero-NetStandard/Xero.NetStandard.OAuth2.Test/util + + - name: Run Test + run: dotnet test + working-directory: Xero-NetStandard + + - name: Stop PRISM + if: success() || failure() + run: pkill -f prism + working-directory: Xero-NetStandard \ No newline at end of file diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 26ed96ca..e338830a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -9,17 +9,95 @@ jobs: runs-on: ubuntu-latest + outputs: + release_number: ${{steps.get_latest_release_number.outputs.release_tag}} + permissions: + contents: write + pull-requests: write + steps: - - uses: actions/checkout@v2 + + - name: checkout dotnet repo + uses: actions/checkout@v4 + with: + repository: XeroAPI/Xero-NetStandard + path: Xero-NetStandard + - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 3.1.x + dotnet-version: '3.1' + + - name: Restore dependencies run: dotnet restore + working-directory: Xero-NetStandard + + - name: Fetch Latest release number + id: get_latest_release_number + run: | + latest_version=$(gh release view --json tagName --jq '.tagName') + echo "Latest release version is - $latest_version" + echo "::set-output name=release_tag::$latest_version" + working-directory: Xero-NetStandard + env: + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Build run: dotnet build --no-restore + working-directory: Xero-NetStandard + - name: Create Package for Nuget.org\ run: dotnet pack + working-directory: Xero-NetStandard + - name: Publish Package to Nuget.org - run: dotnet nuget push ./Xero.NetStandard.OAuth2/bin/Debug/Xero.NetStandard.OAuth2.${{ github.event.release.name }}.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push ./Xero.NetStandard.OAuth2/bin/Release/Xero.NetStandard.OAuth2.${{ github.event.release.name }}.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json + working-directory: Xero-NetStandard + + + notify-slack-on-success: + runs-on: ubuntu-latest + needs: build + if: success() + steps: + - name: Checkout Xero-NetStandard repo + uses: actions/checkout@v4 + with: + repository: XeroAPI/Xero-NetStandard + path: Xero-NetStandard + + - name: Send slack notification on success + uses: ./Xero-NetStandard/.github/actions/notify-slack + with: + heading_text: "Publish job has succeeded !" + alert_type: "thumbsup" + job_status: "Success" + XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}} + job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" + button_type: "primary" + package_version: ${{needs.build.outputs.release_number}} + repo_link: ${{github.server_url}}/${{github.repository}} + + notify-slack-on-failure: + runs-on: ubuntu-latest + needs: build + if: failure() + steps: + - name: Checkout Xero-NetStandard repo + uses: actions/checkout@v4 + with: + repository: XeroAPI/Xero-NetStandard + path: Xero-NetStandard + + - name: Send slack notification on failure + uses: ./Xero-NetStandard/.github/actions/notify-slack + with: + heading_text: "Publish job has failed !" + alert_type: "alert" + job_status: "Failed" + XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}} + job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" + button_type: "danger" + package_version: ${{needs.build.outputs.release_number}} + repo_link: ${{github.server_url}}/${{github.repository}} diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..40b03f25 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,5 @@ + + + NU1901,NU1902,NU1903,NU1904,NU1905 + + diff --git a/Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs b/Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs index 29265fa5..4080d373 100755 --- a/Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs @@ -72,7 +72,7 @@ public async Task DisposeAsync() public void InstanceTest() { // TODO uncomment below to test 'IsInstanceOfType' AccountingApi - Assert.IsType(typeof(AccountingApi), instance); + Assert.IsType(instance); } /// @@ -131,7 +131,7 @@ public async Task CreateBankTransactionHistoryRecordTest() var historyRecordList = new List { historyRecord }; HistoryRecords historyRecords = new HistoryRecords(); historyRecords._HistoryRecords = historyRecordList; - var response = await instance.CreateBankTransactionHistoryRecordAsync(accessToken, xeroTenantId, bankTransactionID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateBankTransactionHistoryRecordAsync(accessToken, xeroTenantId, bankTransactionID, historyRecords); Assert.IsType(response); } @@ -171,7 +171,7 @@ public async Task CreateBankTransactionsTest() }; string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = false; - var response = await instance.CreateBankTransactionsAsync(accessToken, xeroTenantId, bankTransactions, summarizeErrors, null, idempotencyKey ).ConfigureAwait(false); + var response = await instance.CreateBankTransactionsAsync(accessToken, xeroTenantId, bankTransactions, summarizeErrors, null, idempotencyKey ); Assert.IsType(response); } @@ -226,7 +226,7 @@ public async Task CreateBankTransferTest() Reference = "SUB 098801" } }; - var response = await instance.CreateBankTransferAsync(accessToken, xeroTenantId, bankTransfers).ConfigureAwait(false); + var response = await instance.CreateBankTransferAsync(accessToken, xeroTenantId, bankTransfers); Assert.IsType(response); } @@ -255,7 +255,7 @@ public async Task CreateBankTransferHistoryRecordTest() string xeroTenantId = AutoFaker.Generate(); Guid bankTransferID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateBankTransferHistoryRecordAsync(accessToken, xeroTenantId, bankTransferID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateBankTransferHistoryRecordAsync(accessToken, xeroTenantId, bankTransferID, historyRecords); Assert.IsType(response); } @@ -324,7 +324,7 @@ public async Task CreateBatchPaymentTest() } }; bool? summarizeErrors = false; - var response = await instance.CreateBatchPaymentAsync(accessToken, xeroTenantId, batchPayments, summarizeErrors).ConfigureAwait(false); + var response = await instance.CreateBatchPaymentAsync(accessToken, xeroTenantId, batchPayments, summarizeErrors); Assert.IsType(response); } @@ -338,7 +338,7 @@ public async Task CreateBatchPaymentHistoryRecordTest() string xeroTenantId = AutoFaker.Generate(); Guid batchPaymentID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateBatchPaymentHistoryRecordAsync(accessToken, xeroTenantId, batchPaymentID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateBatchPaymentHistoryRecordAsync(accessToken, xeroTenantId, batchPaymentID, historyRecords); Assert.IsType(response); } @@ -352,7 +352,7 @@ public async Task CreateBrandingThemePaymentServicesTest() string xeroTenantId = AutoFaker.Generate(); Guid brandingThemeID = AutoFaker.Generate(); PaymentServices paymentServices = new PaymentServices(); - var response = await instance.CreateBrandingThemePaymentServicesAsync(accessToken, xeroTenantId, brandingThemeID, paymentServices).ConfigureAwait(false); + var response = await instance.CreateBrandingThemePaymentServicesAsync(accessToken, xeroTenantId, brandingThemeID, paymentServices); Assert.IsType(response); } @@ -380,7 +380,7 @@ public async Task CreateContactGroupTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); ContactGroups contactGroups = new ContactGroups(); - var response = await instance.CreateContactGroupAsync(accessToken, xeroTenantId, contactGroups).ConfigureAwait(false); + var response = await instance.CreateContactGroupAsync(accessToken, xeroTenantId, contactGroups); Assert.IsType(response); } @@ -394,7 +394,7 @@ public async Task CreateContactGroupContactsTest() string xeroTenantId = AutoFaker.Generate(); Guid contactGroupID = AutoFaker.Generate(); Contacts contacts = new Contacts(); - var response = await instance.CreateContactGroupContactsAsync(accessToken, xeroTenantId, contactGroupID, contacts).ConfigureAwait(false); + var response = await instance.CreateContactGroupContactsAsync(accessToken, xeroTenantId, contactGroupID, contacts); Assert.IsType(response); } @@ -408,7 +408,7 @@ public async Task CreateContactHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid contactID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateContactHistoryAsync(accessToken, xeroTenantId, contactID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateContactHistoryAsync(accessToken, xeroTenantId, contactID, historyRecords); Assert.IsType(response); } @@ -423,7 +423,7 @@ public async Task CreateContactsTest() Contacts contacts = new Contacts(); string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.CreateContactsAsync(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey).ConfigureAwait(false); + var response = await instance.CreateContactsAsync(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey); Assert.IsType(response); } @@ -437,7 +437,7 @@ public async Task CreateCreditNoteAllocationTest() string xeroTenantId = AutoFaker.Generate(); Guid creditNoteID = AutoFaker.Generate(); Allocations allocations = new Allocations(); - var response = await instance.CreateCreditNoteAllocationAsync(accessToken, xeroTenantId, creditNoteID, allocations).ConfigureAwait(false); + var response = await instance.CreateCreditNoteAllocationAsync(accessToken, xeroTenantId, creditNoteID, allocations); Assert.IsType(response); } @@ -452,7 +452,7 @@ public async Task CreateCreditNoteAllocationTest() // Guid creditNoteID = AutoFaker.Generate(); // string fileName = AutoFaker.Generate(); // byte[] body = AutoFaker.Generate(); - // var response = await instance.CreateCreditNoteAttachmentByFileNameAsync(accessToken, xeroTenantId, creditNoteID, fileName, body).ConfigureAwait(false); + // var response = await instance.CreateCreditNoteAttachmentByFileNameAsync(accessToken, xeroTenantId, creditNoteID, fileName, body); // Assert.IsType(response); // } @@ -466,7 +466,7 @@ public async Task CreateCreditNoteHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid creditNoteID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateCreditNoteHistoryAsync(accessToken, xeroTenantId, creditNoteID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateCreditNoteHistoryAsync(accessToken, xeroTenantId, creditNoteID, historyRecords); Assert.IsType(response); } @@ -481,7 +481,7 @@ public async Task CreateCreditNotesTest() CreditNotes creditNotes = new CreditNotes(); string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.CreateCreditNotesAsync(accessToken, xeroTenantId, creditNotes, summarizeErrors, null, idempotencyKey).ConfigureAwait(false); + var response = await instance.CreateCreditNotesAsync(accessToken, xeroTenantId, creditNotes, summarizeErrors, null, idempotencyKey); Assert.IsType(response); } @@ -494,7 +494,7 @@ public async Task CreateCurrencyTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Currency currency = new Currency(); - var response = await instance.CreateCurrencyAsync(accessToken, xeroTenantId, currency).ConfigureAwait(false); + var response = await instance.CreateCurrencyAsync(accessToken, xeroTenantId, currency); Assert.IsType(response); } @@ -508,7 +508,7 @@ public async Task CreateEmployeesTest() string xeroTenantId = AutoFaker.Generate(); Employees employees = new Employees(); employees._Employees = new List { new Employee() }; - var response = await instance.CreateEmployeesAsync(accessToken, xeroTenantId, employees).ConfigureAwait(false); + var response = await instance.CreateEmployeesAsync(accessToken, xeroTenantId, employees); Assert.IsType(response); } @@ -522,7 +522,7 @@ public async Task CreateExpenseClaimHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid expenseClaimID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateExpenseClaimHistoryAsync(accessToken, xeroTenantId, expenseClaimID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateExpenseClaimHistoryAsync(accessToken, xeroTenantId, expenseClaimID, historyRecords); Assert.IsType(response); } @@ -535,7 +535,7 @@ public async Task CreateExpenseClaimsTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); ExpenseClaims expenseClaims = new ExpenseClaims(); - var response = await instance.CreateExpenseClaimsAsync(accessToken, xeroTenantId, expenseClaims).ConfigureAwait(false); + var response = await instance.CreateExpenseClaimsAsync(accessToken, xeroTenantId, expenseClaims); Assert.IsType(response); } @@ -564,7 +564,7 @@ public async Task CreateInvoiceHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid invoiceID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateInvoiceHistoryAsync(accessToken, xeroTenantId, invoiceID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateInvoiceHistoryAsync(accessToken, xeroTenantId, invoiceID, historyRecords); Assert.IsType(response); } @@ -584,7 +584,7 @@ public async Task CreateInvoicesTest() invoices._Invoices = invList; string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.CreateInvoicesAsync(accessToken, xeroTenantId, invoices, summarizeErrors, null, idempotencyKey).ConfigureAwait(false); + var response = await instance.CreateInvoicesAsync(accessToken, xeroTenantId, invoices, summarizeErrors, null, idempotencyKey); Assert.IsType(response); } @@ -598,7 +598,7 @@ public async Task CreateItemHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid itemID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateItemHistoryAsync(accessToken, xeroTenantId, itemID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateItemHistoryAsync(accessToken, xeroTenantId, itemID, historyRecords); Assert.IsType(response); } @@ -613,7 +613,7 @@ public async Task CreateItemsTest() Items items = new Items(); string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.CreateItemsAsync(accessToken, xeroTenantId, items, summarizeErrors, null, idempotencyKey).ConfigureAwait(false); + var response = await instance.CreateItemsAsync(accessToken, xeroTenantId, items, summarizeErrors, null, idempotencyKey); Assert.IsType(response); } @@ -626,7 +626,7 @@ public async Task CreateLinkedTransactionTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); LinkedTransaction linkedTransaction = new LinkedTransaction(); - var response = await instance.CreateLinkedTransactionAsync(accessToken, xeroTenantId, linkedTransaction).ConfigureAwait(false); + var response = await instance.CreateLinkedTransactionAsync(accessToken, xeroTenantId, linkedTransaction); Assert.IsType(response); } @@ -672,7 +672,7 @@ public async Task CreateManualJournalsTest() Date = DateTime.Now, }, }; - var response = await instance.CreateManualJournalsAsync(accessToken, xeroTenantId, manualJournals).ConfigureAwait(false); + var response = await instance.CreateManualJournalsAsync(accessToken, xeroTenantId, manualJournals); Assert.IsType(response); } @@ -702,7 +702,7 @@ public async Task CreateOverpaymentAllocationsTest() Guid overpaymentID = AutoFaker.Generate(); Allocations allocations = new Allocations(); allocations._Allocations = new List { new Allocation() }; - var response = await instance.CreateOverpaymentAllocationsAsync(accessToken, xeroTenantId, overpaymentID, allocations).ConfigureAwait(false); + var response = await instance.CreateOverpaymentAllocationsAsync(accessToken, xeroTenantId, overpaymentID, allocations); Assert.IsType(response); } @@ -730,7 +730,7 @@ public async Task CreateOverpaymentHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid overpaymentID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateOverpaymentHistoryAsync(accessToken, xeroTenantId, overpaymentID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateOverpaymentHistoryAsync(accessToken, xeroTenantId, overpaymentID, historyRecords); Assert.IsType(response); } @@ -743,7 +743,7 @@ public async Task CreatePaymentTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Payment payment = new Payment(); - var response = await instance.CreatePaymentAsync(accessToken, xeroTenantId, payment).ConfigureAwait(false); + var response = await instance.CreatePaymentAsync(accessToken, xeroTenantId, payment); Assert.IsType(response); } @@ -757,7 +757,7 @@ public async Task CreatePaymentHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid paymentID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreatePaymentHistoryAsync(accessToken, xeroTenantId, paymentID, historyRecords).ConfigureAwait(false); + var response = await instance.CreatePaymentHistoryAsync(accessToken, xeroTenantId, paymentID, historyRecords); Assert.IsType(response); } @@ -770,7 +770,7 @@ public async Task CreatePaymentServiceTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); PaymentServices paymentServices = new PaymentServices(); - var response = await instance.CreatePaymentServiceAsync(accessToken, xeroTenantId, paymentServices).ConfigureAwait(false); + var response = await instance.CreatePaymentServiceAsync(accessToken, xeroTenantId, paymentServices); Assert.IsType(response); } @@ -783,7 +783,7 @@ public async Task CreatePaymentsTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Payments payments = new Payments(); - var response = await instance.CreatePaymentsAsync(accessToken, xeroTenantId, payments).ConfigureAwait(false); + var response = await instance.CreatePaymentsAsync(accessToken, xeroTenantId, payments); Assert.IsType(response); } @@ -797,7 +797,7 @@ public async Task CreatePrepaymentAllocationsTest() string xeroTenantId = AutoFaker.Generate(); Guid prepaymentID = AutoFaker.Generate(); Allocations allocations = new Allocations(); - var response = await instance.CreatePrepaymentAllocationsAsync(accessToken, xeroTenantId, prepaymentID, allocations).ConfigureAwait(false); + var response = await instance.CreatePrepaymentAllocationsAsync(accessToken, xeroTenantId, prepaymentID, allocations); Assert.IsType(response); } @@ -811,7 +811,7 @@ public async Task CreatePrepaymentHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid prepaymentID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreatePrepaymentHistoryAsync(accessToken, xeroTenantId, prepaymentID, historyRecords).ConfigureAwait(false); + var response = await instance.CreatePrepaymentHistoryAsync(accessToken, xeroTenantId, prepaymentID, historyRecords); Assert.IsType(response); } @@ -825,7 +825,7 @@ public async Task CreatePurchaseOrderHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid purchaseOrderID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreatePurchaseOrderHistoryAsync(accessToken, xeroTenantId, purchaseOrderID, historyRecords).ConfigureAwait(false); + var response = await instance.CreatePurchaseOrderHistoryAsync(accessToken, xeroTenantId, purchaseOrderID, historyRecords); Assert.IsType(response); } @@ -840,7 +840,7 @@ public async Task CreatePurchaseOrdersTest() PurchaseOrders purchaseOrders = new PurchaseOrders(); string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.CreatePurchaseOrdersAsync(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey).ConfigureAwait(false); + var response = await instance.CreatePurchaseOrdersAsync(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey); Assert.IsType(response); } @@ -853,7 +853,7 @@ public async Task CreateReceiptTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Receipts receipts = new Receipts(); - var response = await instance.CreateReceiptAsync(accessToken, xeroTenantId, receipts).ConfigureAwait(false); + var response = await instance.CreateReceiptAsync(accessToken, xeroTenantId, receipts); Assert.IsType(response); } @@ -882,7 +882,7 @@ public async Task CreateReceiptHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid receiptID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateReceiptHistoryAsync(accessToken, xeroTenantId, receiptID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateReceiptHistoryAsync(accessToken, xeroTenantId, receiptID, historyRecords); Assert.IsType(response); } @@ -911,7 +911,7 @@ public async Task CreateRepeatingInvoiceHistoryTest() string xeroTenantId = AutoFaker.Generate(); Guid repeatingInvoiceID = AutoFaker.Generate(); HistoryRecords historyRecords = new HistoryRecords(); - var response = await instance.CreateRepeatingInvoiceHistoryAsync(accessToken, xeroTenantId, repeatingInvoiceID, historyRecords).ConfigureAwait(false); + var response = await instance.CreateRepeatingInvoiceHistoryAsync(accessToken, xeroTenantId, repeatingInvoiceID, historyRecords); Assert.IsType(response); } @@ -924,7 +924,7 @@ public async Task CreateTaxRatesTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); TaxRates taxRates = new TaxRates(); - var response = await instance.CreateTaxRatesAsync(accessToken, xeroTenantId, taxRates).ConfigureAwait(false); + var response = await instance.CreateTaxRatesAsync(accessToken, xeroTenantId, taxRates); Assert.IsType(response); } @@ -937,7 +937,7 @@ public async Task CreateTrackingCategoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); TrackingCategory trackingCategory = new TrackingCategory(); - var response = await instance.CreateTrackingCategoryAsync(accessToken, xeroTenantId, trackingCategory).ConfigureAwait(false); + var response = await instance.CreateTrackingCategoryAsync(accessToken, xeroTenantId, trackingCategory); Assert.IsType(response); } @@ -951,7 +951,7 @@ public async Task CreateTrackingOptionsTest() string xeroTenantId = AutoFaker.Generate(); Guid trackingCategoryID = AutoFaker.Generate(); TrackingOption trackingOption = new TrackingOption(); - var response = await instance.CreateTrackingOptionsAsync(accessToken, xeroTenantId, trackingCategoryID, trackingOption).ConfigureAwait(false); + var response = await instance.CreateTrackingOptionsAsync(accessToken, xeroTenantId, trackingCategoryID, trackingOption); Assert.IsType(response); } @@ -964,7 +964,7 @@ public async Task DeleteAccountTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid accountID = AutoFaker.Generate(); - var response = await instance.DeleteAccountAsync(accessToken, xeroTenantId, accountID).ConfigureAwait(false); + var response = await instance.DeleteAccountAsync(accessToken, xeroTenantId, accountID); Assert.IsType(response); } @@ -978,7 +978,7 @@ public async Task DeleteContactGroupContactTest() string xeroTenantId = AutoFaker.Generate(); Guid contactGroupID = AutoFaker.Generate(); Guid contactID = AutoFaker.Generate(); - await instance.DeleteContactGroupContactAsync(accessToken, xeroTenantId, contactGroupID, contactID).ConfigureAwait(false); + await instance.DeleteContactGroupContactAsync(accessToken, xeroTenantId, contactGroupID, contactID); } @@ -991,7 +991,7 @@ public async Task DeleteContactGroupContactsTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid contactGroupID = AutoFaker.Generate(); - await instance.DeleteContactGroupContactsAsync(accessToken, xeroTenantId, contactGroupID).ConfigureAwait(false); + await instance.DeleteContactGroupContactsAsync(accessToken, xeroTenantId, contactGroupID); } @@ -1004,7 +1004,7 @@ public async Task DeleteItemTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid itemID = AutoFaker.Generate(); - await instance.DeleteItemAsync(accessToken, xeroTenantId, itemID).ConfigureAwait(false); + await instance.DeleteItemAsync(accessToken, xeroTenantId, itemID); } @@ -1017,7 +1017,7 @@ public async Task DeleteLinkedTransactionTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid linkedTransactionID = AutoFaker.Generate(); - await instance.DeleteLinkedTransactionAsync(accessToken, xeroTenantId, linkedTransactionID).ConfigureAwait(false); + await instance.DeleteLinkedTransactionAsync(accessToken, xeroTenantId, linkedTransactionID); } @@ -1035,7 +1035,7 @@ public async Task DeletePaymentTest() { Status = "DELETED", }; - var response = await instance.DeletePaymentAsync(accessToken, xeroTenantId, paymentID, paymentDelete).ConfigureAwait(false); + var response = await instance.DeletePaymentAsync(accessToken, xeroTenantId, paymentID, paymentDelete); Assert.IsType(response); } @@ -1048,7 +1048,7 @@ public async Task DeleteTrackingCategoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid trackingCategoryID = AutoFaker.Generate(); - var response = await instance.DeleteTrackingCategoryAsync(accessToken, xeroTenantId, trackingCategoryID).ConfigureAwait(false); + var response = await instance.DeleteTrackingCategoryAsync(accessToken, xeroTenantId, trackingCategoryID); Assert.IsType(response); } @@ -1062,7 +1062,7 @@ public async Task DeleteTrackingOptionsTest() string xeroTenantId = AutoFaker.Generate(); Guid trackingCategoryID = AutoFaker.Generate(); Guid trackingOptionID = AutoFaker.Generate(); - var response = await instance.DeleteTrackingOptionsAsync(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID).ConfigureAwait(false); + var response = await instance.DeleteTrackingOptionsAsync(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID); Assert.IsType(response); } @@ -1076,7 +1076,7 @@ public async Task EmailInvoiceTest() string xeroTenantId = AutoFaker.Generate(); Guid invoiceID = AutoFaker.Generate(); RequestEmpty requestEmpty = new RequestEmpty(); - await instance.EmailInvoiceAsync(accessToken, xeroTenantId, invoiceID, requestEmpty).ConfigureAwait(false); + await instance.EmailInvoiceAsync(accessToken, xeroTenantId, invoiceID, requestEmpty); } @@ -1089,7 +1089,7 @@ public async Task GetAccountTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid accountID = AutoFaker.Generate(); - var response = await instance.GetAccountAsync(accessToken, xeroTenantId, accountID).ConfigureAwait(false); + var response = await instance.GetAccountAsync(accessToken, xeroTenantId, accountID); Assert.IsType(response); } @@ -1150,7 +1150,7 @@ public async Task GetAccountsTest() DateTime? ifModifiedSince = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetAccountsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order).ConfigureAwait(false); + var response = await instance.GetAccountsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order); Assert.IsType(response); } @@ -1163,7 +1163,7 @@ public async Task GetBankTransactionTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid bankTransactionID = AutoFaker.Generate(); - var response = await instance.GetBankTransactionAsync(accessToken, xeroTenantId, bankTransactionID).ConfigureAwait(false); + var response = await instance.GetBankTransactionAsync(accessToken, xeroTenantId, bankTransactionID); Assert.IsType(response); } @@ -1223,7 +1223,7 @@ public async Task GetBankTransactionsTest() string order = AutoFaker.Generate(); int? page = AutoFaker.Generate(); int? unitdp = AutoFaker.Generate(); - var response = await instance.GetBankTransactionsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp).ConfigureAwait(false); + var response = await instance.GetBankTransactionsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp); Assert.IsType(response); } @@ -1236,7 +1236,7 @@ public async Task GetBankTransactionsHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid bankTransactionID = AutoFaker.Generate(); - var response = await instance.GetBankTransactionsHistoryAsync(accessToken, xeroTenantId, bankTransactionID).ConfigureAwait(false); + var response = await instance.GetBankTransactionsHistoryAsync(accessToken, xeroTenantId, bankTransactionID); Assert.IsType(response); } @@ -1249,7 +1249,7 @@ public async Task GetBankTransferTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid bankTransferID = AutoFaker.Generate(); - var response = await instance.GetBankTransferAsync(accessToken, xeroTenantId, bankTransferID).ConfigureAwait(false); + var response = await instance.GetBankTransferAsync(accessToken, xeroTenantId, bankTransferID); Assert.IsType(response); } @@ -1305,7 +1305,7 @@ public async Task GetBankTransferHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid bankTransferID = AutoFaker.Generate(); - var response = await instance.GetBankTransferHistoryAsync(accessToken, xeroTenantId, bankTransferID).ConfigureAwait(false); + var response = await instance.GetBankTransferHistoryAsync(accessToken, xeroTenantId, bankTransferID); Assert.IsType(response); } @@ -1320,7 +1320,7 @@ public async Task GetBankTransfersTest() DateTime? ifModifiedSince = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetBankTransfersAsync(accessToken, xeroTenantId, ifModifiedSince, where, order).ConfigureAwait(false); + var response = await instance.GetBankTransfersAsync(accessToken, xeroTenantId, ifModifiedSince, where, order); Assert.IsType(response); } @@ -1333,7 +1333,7 @@ public async Task GetBatchPaymentHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid batchPaymentID = AutoFaker.Generate(); - var response = await instance.GetBatchPaymentHistoryAsync(accessToken, xeroTenantId, batchPaymentID).ConfigureAwait(false); + var response = await instance.GetBatchPaymentHistoryAsync(accessToken, xeroTenantId, batchPaymentID); Assert.IsType(response); } @@ -1348,7 +1348,7 @@ public async Task GetBatchPaymentsTest() DateTime? ifModifiedSince = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetBatchPaymentsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order).ConfigureAwait(false); + var response = await instance.GetBatchPaymentsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order); Assert.IsType(response); } @@ -1361,7 +1361,7 @@ public async Task GetBrandingThemeTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid brandingThemeID = AutoFaker.Generate(); - var response = await instance.GetBrandingThemeAsync(accessToken, xeroTenantId, brandingThemeID).ConfigureAwait(false); + var response = await instance.GetBrandingThemeAsync(accessToken, xeroTenantId, brandingThemeID); Assert.IsType(response); } @@ -1374,7 +1374,7 @@ public async Task GetBrandingThemePaymentServicesTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid brandingThemeID = AutoFaker.Generate(); - var response = await instance.GetBrandingThemePaymentServicesAsync(accessToken, xeroTenantId, brandingThemeID).ConfigureAwait(false); + var response = await instance.GetBrandingThemePaymentServicesAsync(accessToken, xeroTenantId, brandingThemeID); Assert.IsType(response); } @@ -1386,7 +1386,7 @@ public async Task GetBrandingThemesTest() { // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); - var response = await instance.GetBrandingThemesAsync(accessToken, xeroTenantId).ConfigureAwait(false); + var response = await instance.GetBrandingThemesAsync(accessToken, xeroTenantId); Assert.IsType(response); } @@ -1399,7 +1399,7 @@ public async Task GetContactTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid contactID = AutoFaker.Generate(); - var response = await instance.GetContactAsync(accessToken, xeroTenantId, contactID).ConfigureAwait(false); + var response = await instance.GetContactAsync(accessToken, xeroTenantId, contactID); Assert.IsType(response); } @@ -1455,7 +1455,7 @@ public async Task GetContactCISSettingsTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid contactID = Guid.NewGuid(); - var response = await instance.GetContactCISSettingsAsync(accessToken, xeroTenantId, contactID).ConfigureAwait(false); + var response = await instance.GetContactCISSettingsAsync(accessToken, xeroTenantId, contactID); Assert.IsType(response); } @@ -1468,7 +1468,7 @@ public async Task GetContactGroupTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid contactGroupID = AutoFaker.Generate(); - var response = await instance.GetContactGroupAsync(accessToken, xeroTenantId, contactGroupID).ConfigureAwait(false); + var response = await instance.GetContactGroupAsync(accessToken, xeroTenantId, contactGroupID); Assert.IsType(response); } @@ -1482,7 +1482,7 @@ public async Task GetContactGroupsTest() string xeroTenantId = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetContactGroupsAsync(accessToken, xeroTenantId, where, order).ConfigureAwait(false); + var response = await instance.GetContactGroupsAsync(accessToken, xeroTenantId, where, order); Assert.IsType(response); } @@ -1495,7 +1495,7 @@ public async Task GetContactHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid contactID = AutoFaker.Generate(); - var response = await instance.GetContactHistoryAsync(accessToken, xeroTenantId, contactID).ConfigureAwait(false); + var response = await instance.GetContactHistoryAsync(accessToken, xeroTenantId, contactID); Assert.IsType(response); } @@ -1513,7 +1513,7 @@ public async Task GetContactsTest() List iDs = AutoFaker.Generate>(); int? page = AutoFaker.Generate(); bool? includeArchived = AutoFaker.Generate(); - var response = await instance.GetContactsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived).ConfigureAwait(false); + var response = await instance.GetContactsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived); Assert.IsType(response); } @@ -1526,7 +1526,7 @@ public async Task GetCreditNoteTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid creditNoteID = AutoFaker.Generate(); - var response = await instance.GetCreditNoteAsync(accessToken, xeroTenantId, creditNoteID).ConfigureAwait(false); + var response = await instance.GetCreditNoteAsync(accessToken, xeroTenantId, creditNoteID); Assert.IsType(response); } @@ -1540,8 +1540,8 @@ public async Task GetCreditNoteAsPdfTest() string xeroTenantId = AutoFaker.Generate(); Guid creditNoteID = AutoFaker.Generate(); // string contentType = AutoFaker.Generate(); - var response = await instance.GetCreditNoteAsPdfAsync(accessToken, xeroTenantId, creditNoteID).ConfigureAwait(false); - Assert.IsType(response); + var response = await instance.GetCreditNoteAsPdfAsync(accessToken, xeroTenantId, creditNoteID); + Assert.IsAssignableFrom(response); } // /// @@ -1596,7 +1596,7 @@ public async Task GetCreditNoteHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid creditNoteID = AutoFaker.Generate(); - var response = await instance.GetCreditNoteHistoryAsync(accessToken, xeroTenantId, creditNoteID).ConfigureAwait(false); + var response = await instance.GetCreditNoteHistoryAsync(accessToken, xeroTenantId, creditNoteID); Assert.IsType(response); } @@ -1612,7 +1612,7 @@ public async Task GetCreditNotesTest() string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); int? page = AutoFaker.Generate(); - var response = await instance.GetCreditNotesAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page).ConfigureAwait(false); + var response = await instance.GetCreditNotesAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page); Assert.IsType(response); } @@ -1626,7 +1626,7 @@ public async Task GetCurrenciesTest() string xeroTenantId = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetCurrenciesAsync(accessToken, xeroTenantId, where, order).ConfigureAwait(false); + var response = await instance.GetCurrenciesAsync(accessToken, xeroTenantId, where, order); Assert.IsType(response); } @@ -1639,7 +1639,7 @@ public async Task GetEmployeeTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid employeeID = AutoFaker.Generate(); - var response = await instance.GetEmployeeAsync(accessToken, xeroTenantId, employeeID).ConfigureAwait(false); + var response = await instance.GetEmployeeAsync(accessToken, xeroTenantId, employeeID); Assert.IsType(response); } @@ -1654,7 +1654,7 @@ public async Task GetEmployeesTest() DateTime? ifModifiedSince = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetEmployeesAsync(accessToken, xeroTenantId, ifModifiedSince, where, order).ConfigureAwait(false); + var response = await instance.GetEmployeesAsync(accessToken, xeroTenantId, ifModifiedSince, where, order); Assert.IsType(response); } @@ -1667,7 +1667,7 @@ public async Task GetExpenseClaimTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid expenseClaimID = AutoFaker.Generate(); - var response = await instance.GetExpenseClaimAsync(accessToken, xeroTenantId, expenseClaimID).ConfigureAwait(false); + var response = await instance.GetExpenseClaimAsync(accessToken, xeroTenantId, expenseClaimID); Assert.IsType(response); } @@ -1680,7 +1680,7 @@ public async Task GetExpenseClaimHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid expenseClaimID = AutoFaker.Generate(); - var response = await instance.GetExpenseClaimHistoryAsync(accessToken, xeroTenantId, expenseClaimID).ConfigureAwait(false); + var response = await instance.GetExpenseClaimHistoryAsync(accessToken, xeroTenantId, expenseClaimID); Assert.IsType(response); } @@ -1695,7 +1695,7 @@ public async Task GetExpenseClaimsTest() DateTime? ifModifiedSince = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetExpenseClaimsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order).ConfigureAwait(false); + var response = await instance.GetExpenseClaimsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order); Assert.IsType(response); } @@ -1708,7 +1708,7 @@ public async Task GetInvoiceTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid invoiceID = AutoFaker.Generate(); - var response = await instance.GetInvoiceAsync(accessToken, xeroTenantId, invoiceID).ConfigureAwait(false); + var response = await instance.GetInvoiceAsync(accessToken, xeroTenantId, invoiceID); Assert.IsType>(response._Invoices); } @@ -1720,7 +1720,7 @@ public async Task GetInvoiceUpdatedDateUtcTest() { string xeroTenantId = AutoFaker.Generate(); Guid invoiceID = AutoFaker.Generate(); - var response = await instance.GetInvoiceAsync(accessToken, xeroTenantId, invoiceID).ConfigureAwait(false); + var response = await instance.GetInvoiceAsync(accessToken, xeroTenantId, invoiceID); DateTime actualTime = response._Invoices[0].UpdatedDateUTC.Value; DateTime expectedTime = new DateTime(2019, 3, 7, 17, 59, 28, 133); Assert.Equal(expectedTime, actualTime); @@ -1736,8 +1736,8 @@ public async Task GetInvoiceAsPdfTest() string xeroTenantId = AutoFaker.Generate(); Guid invoiceID = AutoFaker.Generate(); // string contentType = AutoFaker.Generate(); - var response = await instance.GetInvoiceAsPdfAsync(accessToken, xeroTenantId, invoiceID).ConfigureAwait(false); - Assert.IsType(response); + var response = await instance.GetInvoiceAsPdfAsync(accessToken, xeroTenantId, invoiceID); + Assert.IsAssignableFrom(response); } // /// @@ -1751,7 +1751,7 @@ public async Task GetInvoiceAsPdfTest() // Guid invoiceID = AutoFaker.Generate(); // string fileName = AutoFaker.Generate(); // string contentType = AutoFaker.Generate(); - // var response = await instance.GetInvoiceAttachmentByFileNameAsync(accessToken, xeroTenantId, invoiceID, fileName, contentType).ConfigureAwait(false); + // var response = await instance.GetInvoiceAttachmentByFileNameAsync(accessToken, xeroTenantId, invoiceID, fileName, contentType); // Assert.IsType(response); // } @@ -1766,7 +1766,7 @@ public async Task GetInvoiceAsPdfTest() // Guid invoiceID = AutoFaker.Generate(); // Guid attachmentID = AutoFaker.Generate(); // string contentType = AutoFaker.Generate(); - // var response = await instance.GetInvoiceAttachmentByIdAsync(accessToken, xeroTenantId, invoiceID, attachmentID, contentType).ConfigureAwait(false); + // var response = await instance.GetInvoiceAttachmentByIdAsync(accessToken, xeroTenantId, invoiceID, attachmentID, contentType); // Assert.IsType(response); // } @@ -1792,7 +1792,7 @@ public async Task GetInvoiceHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid invoiceID = AutoFaker.Generate(); - var response = await instance.GetInvoiceHistoryAsync(accessToken, xeroTenantId, invoiceID).ConfigureAwait(false); + var response = await instance.GetInvoiceHistoryAsync(accessToken, xeroTenantId, invoiceID); Assert.IsType(response); } @@ -1804,7 +1804,7 @@ public async Task GetInvoiceRemindersTest() { // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); - var response = await instance.GetInvoiceRemindersAsync(accessToken, xeroTenantId).ConfigureAwait(false); + var response = await instance.GetInvoiceRemindersAsync(accessToken, xeroTenantId); Assert.IsType(response); } @@ -1827,7 +1827,7 @@ public async Task GetInvoicesTest() bool? includeArchived = AutoFaker.Generate(); bool? createdByMyApp = AutoFaker.Generate(); int? unitdp = AutoFaker.Generate(); - var response = await instance.GetInvoicesAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp).ConfigureAwait(false); + var response = await instance.GetInvoicesAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp); Assert.IsType(response); } @@ -1840,7 +1840,7 @@ public async Task GetItemTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid itemID = AutoFaker.Generate(); - var response = await instance.GetItemAsync(accessToken, xeroTenantId, itemID).ConfigureAwait(false); + var response = await instance.GetItemAsync(accessToken, xeroTenantId, itemID); Assert.IsType(response); } @@ -1853,7 +1853,7 @@ public async Task GetItemHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid itemID = AutoFaker.Generate(); - var response = await instance.GetItemHistoryAsync(accessToken, xeroTenantId, itemID).ConfigureAwait(false); + var response = await instance.GetItemHistoryAsync(accessToken, xeroTenantId, itemID); Assert.IsType(response); } @@ -1869,7 +1869,7 @@ public async Task GetItemsTest() string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); int? unitdp = AutoFaker.Generate(); - var response = await instance.GetItemsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp).ConfigureAwait(false); + var response = await instance.GetItemsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp); Assert.IsType(response); } @@ -1881,7 +1881,7 @@ public async Task GetJournalTest() { // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); - var response = await instance.GetJournalByNumberAsync(accessToken, xeroTenantId, 100).ConfigureAwait(false); + var response = await instance.GetJournalByNumberAsync(accessToken, xeroTenantId, 100); Assert.IsType(response); } @@ -1896,7 +1896,7 @@ public async Task GetJournalsTest() DateTime? ifModifiedSince = AutoFaker.Generate(); int? offset = AutoFaker.Generate(); bool? paymentsOnly = AutoFaker.Generate(); - var response = await instance.GetJournalsAsync(accessToken, xeroTenantId, ifModifiedSince, offset, paymentsOnly).ConfigureAwait(false); + var response = await instance.GetJournalsAsync(accessToken, xeroTenantId, ifModifiedSince, offset, paymentsOnly); Assert.IsType(response); } @@ -1909,7 +1909,7 @@ public async Task GetLinkedTransactionTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid linkedTransactionID = AutoFaker.Generate(); - var response = await instance.GetLinkedTransactionAsync(accessToken, xeroTenantId, linkedTransactionID).ConfigureAwait(false); + var response = await instance.GetLinkedTransactionAsync(accessToken, xeroTenantId, linkedTransactionID); Assert.IsType(response); } @@ -1927,7 +1927,7 @@ public async Task GetLinkedTransactionsTest() Guid contactID = AutoFaker.Generate(); string status = AutoFaker.Generate(); Guid targetTransactionID = AutoFaker.Generate(); - var response = await instance.GetLinkedTransactionsAsync(accessToken, xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID).ConfigureAwait(false); + var response = await instance.GetLinkedTransactionsAsync(accessToken, xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID); Assert.IsType(response); } @@ -1940,7 +1940,7 @@ public async Task GetManualJournalTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid manualJournalID = AutoFaker.Generate(); - var response = await instance.GetManualJournalAsync(accessToken, xeroTenantId, manualJournalID).ConfigureAwait(false); + var response = await instance.GetManualJournalAsync(accessToken, xeroTenantId, manualJournalID); Assert.IsType(response); } @@ -1999,7 +1999,7 @@ public async Task GetManualJournalsTest() string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); int? page = AutoFaker.Generate(); - var response = await instance.GetManualJournalsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page).ConfigureAwait(false); + var response = await instance.GetManualJournalsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page); Assert.IsType(response); } @@ -2012,7 +2012,7 @@ public async Task GetOnlineInvoiceTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid invoiceID = AutoFaker.Generate(); - var response = await instance.GetOnlineInvoiceAsync(accessToken, xeroTenantId, invoiceID).ConfigureAwait(false); + var response = await instance.GetOnlineInvoiceAsync(accessToken, xeroTenantId, invoiceID); Assert.IsType(response); } @@ -2025,7 +2025,7 @@ public async Task GetOrganisationCISSettingsTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid organisationID = AutoFaker.Generate(); - var response = await instance.GetOrganisationCISSettingsAsync(accessToken, xeroTenantId, organisationID).ConfigureAwait(false); + var response = await instance.GetOrganisationCISSettingsAsync(accessToken, xeroTenantId, organisationID); Assert.IsType(response); } @@ -2037,7 +2037,7 @@ public async Task GetOrganisationsTest() { // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); - var response = await instance.GetOrganisationsAsync(accessToken, xeroTenantId).ConfigureAwait(false); + var response = await instance.GetOrganisationsAsync(accessToken, xeroTenantId); Assert.IsType(response); } @@ -2050,7 +2050,7 @@ public async Task GetOverpaymentTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid overpaymentID = AutoFaker.Generate(); - var response = await instance.GetOverpaymentAsync(accessToken, xeroTenantId, overpaymentID).ConfigureAwait(false); + var response = await instance.GetOverpaymentAsync(accessToken, xeroTenantId, overpaymentID); Assert.IsType(response); } @@ -2063,7 +2063,7 @@ public async Task GetOverpaymentHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid overpaymentID = AutoFaker.Generate(); - var response = await instance.GetOverpaymentHistoryAsync(accessToken, xeroTenantId, overpaymentID).ConfigureAwait(false); + var response = await instance.GetOverpaymentHistoryAsync(accessToken, xeroTenantId, overpaymentID); Assert.IsType(response); } @@ -2080,7 +2080,7 @@ public async Task GetOverpaymentsTest() string order = AutoFaker.Generate(); int? page = AutoFaker.Generate(); int? unitdp = AutoFaker.Generate(); - var response = await instance.GetOverpaymentsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp).ConfigureAwait(false); + var response = await instance.GetOverpaymentsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp); Assert.IsType(response); } @@ -2093,7 +2093,7 @@ public async Task GetPaymentTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid paymentID = AutoFaker.Generate(); - var response = await instance.GetPaymentAsync(accessToken, xeroTenantId, paymentID).ConfigureAwait(false); + var response = await instance.GetPaymentAsync(accessToken, xeroTenantId, paymentID); Assert.IsType(response); } @@ -2106,7 +2106,7 @@ public async Task GetPaymentHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid paymentID = AutoFaker.Generate(); - var response = await instance.GetPaymentHistoryAsync(accessToken, xeroTenantId, paymentID).ConfigureAwait(false); + var response = await instance.GetPaymentHistoryAsync(accessToken, xeroTenantId, paymentID); Assert.IsType(response); } @@ -2118,7 +2118,7 @@ public async Task GetPaymentServicesTest() { // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); - var response = await instance.GetPaymentServicesAsync(accessToken, xeroTenantId).ConfigureAwait(false); + var response = await instance.GetPaymentServicesAsync(accessToken, xeroTenantId); Assert.IsType(response); } @@ -2133,7 +2133,7 @@ public async Task GetPaymentsTest() DateTime? ifModifiedSince = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetPaymentsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order).ConfigureAwait(false); + var response = await instance.GetPaymentsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order); Assert.IsType(response); } @@ -2146,7 +2146,7 @@ public async Task GetPrepaymentTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid prepaymentID = AutoFaker.Generate(); - var response = await instance.GetPrepaymentAsync(accessToken, xeroTenantId, prepaymentID).ConfigureAwait(false); + var response = await instance.GetPrepaymentAsync(accessToken, xeroTenantId, prepaymentID); Assert.IsType(response); } @@ -2159,7 +2159,7 @@ public async Task GetPrepaymentHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid prepaymentID = AutoFaker.Generate(); - var response = await instance.GetPrepaymentHistoryAsync(accessToken, xeroTenantId, prepaymentID).ConfigureAwait(false); + var response = await instance.GetPrepaymentHistoryAsync(accessToken, xeroTenantId, prepaymentID); Assert.IsType(response); } @@ -2176,7 +2176,7 @@ public async Task GetPrepaymentsTest() string order = AutoFaker.Generate(); int? page = AutoFaker.Generate(); int? unitdp = AutoFaker.Generate(); - var response = await instance.GetPrepaymentsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp).ConfigureAwait(false); + var response = await instance.GetPrepaymentsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp); Assert.IsType(response); } @@ -2189,7 +2189,7 @@ public async Task GetPurchaseOrderTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid purchaseOrderID = AutoFaker.Generate(); - var response = await instance.GetPurchaseOrderAsync(accessToken, xeroTenantId, purchaseOrderID).ConfigureAwait(false); + var response = await instance.GetPurchaseOrderAsync(accessToken, xeroTenantId, purchaseOrderID); Assert.IsType(response); } @@ -2202,7 +2202,7 @@ public async Task GetPurchaseOrderHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid purchaseOrderID = AutoFaker.Generate(); - var response = await instance.GetPurchaseOrderHistoryAsync(accessToken, xeroTenantId, purchaseOrderID).ConfigureAwait(false); + var response = await instance.GetPurchaseOrderHistoryAsync(accessToken, xeroTenantId, purchaseOrderID); Assert.IsType(response); } @@ -2220,7 +2220,7 @@ public async Task GetPurchaseOrdersTest() string dateTo = AutoFaker.Generate(); string order = AutoFaker.Generate(); int? page = AutoFaker.Generate(); - var response = await instance.GetPurchaseOrdersAsync(accessToken, xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page).ConfigureAwait(false); + var response = await instance.GetPurchaseOrdersAsync(accessToken, xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page); Assert.IsType(response); } @@ -2233,7 +2233,7 @@ public async Task GetQuoteTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid quoteID = AutoFaker.Generate(); - var response = await instance.GetQuoteAsync(accessToken, xeroTenantId, quoteID).ConfigureAwait(false); + var response = await instance.GetQuoteAsync(accessToken, xeroTenantId, quoteID); Assert.IsType(response); } @@ -2249,7 +2249,7 @@ public async Task GetQuotesTest() string status = "DRAFT"; int? page = 1; string order = AutoFaker.Generate(); - var response = await instance.GetQuotesAsync(accessToken, xeroTenantId, null, null, null, null, null, contactID, status, page, order, "QU-0001").ConfigureAwait(false); + var response = await instance.GetQuotesAsync(accessToken, xeroTenantId, null, null, null, null, null, contactID, status, page, order, "QU-0001"); Assert.IsType(response); } @@ -2262,7 +2262,7 @@ public async Task GetReceiptTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid receiptID = AutoFaker.Generate(); - var response = await instance.GetReceiptAsync(accessToken, xeroTenantId, receiptID).ConfigureAwait(false); + var response = await instance.GetReceiptAsync(accessToken, xeroTenantId, receiptID); Assert.IsType(response); } @@ -2318,7 +2318,7 @@ public async Task GetReceiptHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid receiptID = AutoFaker.Generate(); - var response = await instance.GetReceiptHistoryAsync(accessToken, xeroTenantId, receiptID).ConfigureAwait(false); + var response = await instance.GetReceiptHistoryAsync(accessToken, xeroTenantId, receiptID); Assert.IsType(response); } @@ -2334,7 +2334,7 @@ public async Task GetReceiptsTest() string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); int? unitdp = AutoFaker.Generate(); - var response = await instance.GetReceiptsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp).ConfigureAwait(false); + var response = await instance.GetReceiptsAsync(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp); Assert.IsType(response); } @@ -2347,7 +2347,7 @@ public async Task GetRepeatingInvoiceTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid repeatingInvoiceID = AutoFaker.Generate(); - var response = await instance.GetRepeatingInvoiceAsync(accessToken, xeroTenantId, repeatingInvoiceID).ConfigureAwait(false); + var response = await instance.GetRepeatingInvoiceAsync(accessToken, xeroTenantId, repeatingInvoiceID); Assert.IsType(response); } @@ -2362,7 +2362,7 @@ public async Task GetRepeatingInvoiceTest() // Guid repeatingInvoiceID = AutoFaker.Generate(); // string fileName = AutoFaker.Generate(); // string contentType = AutoFaker.Generate(); - // var response = await instance.GetRepeatingInvoiceAttachmentByFileNameAsync(accessToken, xeroTenantId, repeatingInvoiceID, fileName, contentType).ConfigureAwait(false); + // var response = await instance.GetRepeatingInvoiceAttachmentByFileNameAsync(accessToken, xeroTenantId, repeatingInvoiceID, fileName, contentType); // Assert.IsType(response); // } @@ -2403,7 +2403,7 @@ public async Task GetRepeatingInvoiceHistoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid repeatingInvoiceID = AutoFaker.Generate(); - var response = await instance.GetRepeatingInvoiceHistoryAsync(accessToken, xeroTenantId, repeatingInvoiceID).ConfigureAwait(false); + var response = await instance.GetRepeatingInvoiceHistoryAsync(accessToken, xeroTenantId, repeatingInvoiceID); Assert.IsType(response); } @@ -2417,7 +2417,7 @@ public async Task GetRepeatingInvoicesTest() string xeroTenantId = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetRepeatingInvoicesAsync(accessToken, xeroTenantId, where, order).ConfigureAwait(false); + var response = await instance.GetRepeatingInvoicesAsync(accessToken, xeroTenantId, where, order); Assert.IsType(response); } @@ -2433,7 +2433,7 @@ public async Task GetReportAgedPayablesByContactTest() DateTime? date = AutoFaker.Generate(); DateTime? fromDate = AutoFaker.Generate(); DateTime? toDate = AutoFaker.Generate(); - var response = await instance.GetReportAgedPayablesByContactAsync(accessToken, xeroTenantId, contactId, null, null, null).ConfigureAwait(false); + var response = await instance.GetReportAgedPayablesByContactAsync(accessToken, xeroTenantId, contactId, null, null, null); Assert.IsType(response); } @@ -2449,7 +2449,7 @@ public async Task GetReportAgedReceivablesByContactTest() DateTime? date = AutoFaker.Generate(); DateTime? fromDate = AutoFaker.Generate(); DateTime? toDate = AutoFaker.Generate(); - var response = await instance.GetReportAgedReceivablesByContactAsync(accessToken, xeroTenantId, contactId, null, null, null).ConfigureAwait(false); + var response = await instance.GetReportAgedReceivablesByContactAsync(accessToken, xeroTenantId, contactId, null, null, null); Assert.IsType(response); } @@ -2468,7 +2468,7 @@ public async Task GetReportBalanceSheetTest() string trackingOptionID2 = AutoFaker.Generate(); bool? standardLayout = false; bool? paymentsOnly = false; - var response = await instance.GetReportBalanceSheetAsync(accessToken, xeroTenantId, null, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly).ConfigureAwait(false); + var response = await instance.GetReportBalanceSheetAsync(accessToken, xeroTenantId, null, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly); Assert.IsType(response); } @@ -2482,7 +2482,7 @@ public async Task GetReportBankSummaryTest() string xeroTenantId = AutoFaker.Generate(); DateTime? fromDate = AutoFaker.Generate(); DateTime? toDate = AutoFaker.Generate(); - var response = await instance.GetReportBankSummaryAsync(accessToken, xeroTenantId, null).ConfigureAwait(false); + var response = await instance.GetReportBankSummaryAsync(accessToken, xeroTenantId, null); Assert.IsType(response); } @@ -2497,7 +2497,7 @@ public async Task GetReportBudgetSummaryTest() DateTime? date = AutoFaker.Generate(); int? period = AutoFaker.Generate(); int? timeframe = AutoFaker.Generate(); - var response = await instance.GetReportBudgetSummaryAsync(accessToken, xeroTenantId, null, period, timeframe).ConfigureAwait(false); + var response = await instance.GetReportBudgetSummaryAsync(accessToken, xeroTenantId, null, period, timeframe); Assert.IsType(response); } @@ -2510,7 +2510,7 @@ public async Task GetReportExecutiveSummaryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); DateTime? date = AutoFaker.Generate(); - var response = await instance.GetReportExecutiveSummaryAsync(accessToken, xeroTenantId).ConfigureAwait(false); + var response = await instance.GetReportExecutiveSummaryAsync(accessToken, xeroTenantId); Assert.IsType(response); } @@ -2532,7 +2532,7 @@ public async Task GetReportProfitAndLossTest() string trackingOptionID2 = AutoFaker.Generate(); bool? standardLayout = AutoFaker.Generate(); bool? paymentsOnly = AutoFaker.Generate(); - var response = await instance.GetReportProfitAndLossAsync(accessToken, xeroTenantId, null, null, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly).ConfigureAwait(false); + var response = await instance.GetReportProfitAndLossAsync(accessToken, xeroTenantId, null, null, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly); Assert.IsType(response); } @@ -2545,7 +2545,7 @@ public async Task GetReportTenNinetyNineTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); string reportYear = AutoFaker.Generate(); - var response = await instance.GetReportTenNinetyNineAsync(accessToken, xeroTenantId, reportYear).ConfigureAwait(false); + var response = await instance.GetReportTenNinetyNineAsync(accessToken, xeroTenantId, reportYear); Assert.IsType(response); } @@ -2559,7 +2559,7 @@ public async Task GetReportTrialBalanceTest() string xeroTenantId = AutoFaker.Generate(); DateTime? date = AutoFaker.Generate(); bool? paymentsOnly = AutoFaker.Generate(); - var response = await instance.GetReportTrialBalanceAsync(accessToken, xeroTenantId, null, paymentsOnly).ConfigureAwait(false); + var response = await instance.GetReportTrialBalanceAsync(accessToken, xeroTenantId, null, paymentsOnly); Assert.IsType(response); } @@ -2574,7 +2574,7 @@ public async Task GetTaxRatesTest() string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); string taxType = AutoFaker.Generate(); - var response = await instance.GetTaxRatesAsync(accessToken, xeroTenantId, where, order).ConfigureAwait(false); + var response = await instance.GetTaxRatesAsync(accessToken, xeroTenantId, where, order); Assert.IsType(response); } @@ -2589,7 +2589,7 @@ public async Task GetTrackingCategoriesTest() string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); bool? includeArchived = AutoFaker.Generate(); - var response = await instance.GetTrackingCategoriesAsync(accessToken, xeroTenantId, where, order, includeArchived).ConfigureAwait(false); + var response = await instance.GetTrackingCategoriesAsync(accessToken, xeroTenantId, where, order, includeArchived); Assert.IsType(response); } @@ -2602,7 +2602,7 @@ public async Task GetTrackingCategoryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid trackingCategoryID = AutoFaker.Generate(); - var response = await instance.GetTrackingCategoryAsync(accessToken, xeroTenantId, trackingCategoryID).ConfigureAwait(false); + var response = await instance.GetTrackingCategoryAsync(accessToken, xeroTenantId, trackingCategoryID); Assert.IsType(response); } @@ -2615,7 +2615,7 @@ public async Task GetUserTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid userID = AutoFaker.Generate(); - var response = await instance.GetUserAsync(accessToken, xeroTenantId, userID).ConfigureAwait(false); + var response = await instance.GetUserAsync(accessToken, xeroTenantId, userID); Assert.IsType(response); } @@ -2630,7 +2630,7 @@ public async Task GetUsersTest() DateTime? ifModifiedSince = AutoFaker.Generate(); string where = AutoFaker.Generate(); string order = AutoFaker.Generate(); - var response = await instance.GetUsersAsync(accessToken, xeroTenantId, ifModifiedSince, where, order).ConfigureAwait(false); + var response = await instance.GetUsersAsync(accessToken, xeroTenantId, ifModifiedSince, where, order); Assert.IsType(response); } @@ -2644,7 +2644,7 @@ public async Task UpdateAccountTest() string xeroTenantId = AutoFaker.Generate(); Guid accountID = AutoFaker.Generate(); Accounts accounts = new Accounts(); - var response = await instance.UpdateAccountAsync(accessToken, xeroTenantId, accountID, accounts).ConfigureAwait(false); + var response = await instance.UpdateAccountAsync(accessToken, xeroTenantId, accountID, accounts); Assert.IsType(response); } @@ -2673,7 +2673,7 @@ public async Task UpdateBankTransactionTest() string xeroTenantId = AutoFaker.Generate(); Guid bankTransactionID = AutoFaker.Generate(); BankTransactions bankTransactions = new BankTransactions(); - var response = await instance.UpdateBankTransactionAsync(accessToken, xeroTenantId, bankTransactionID, bankTransactions).ConfigureAwait(false); + var response = await instance.UpdateBankTransactionAsync(accessToken, xeroTenantId, bankTransactionID, bankTransactions); Assert.IsType(response); } @@ -2717,7 +2717,7 @@ public async Task UpdateContactTest() string xeroTenantId = AutoFaker.Generate(); Guid contactID = AutoFaker.Generate(); Contacts contacts = new Contacts(); - var response = await instance.UpdateContactAsync(accessToken, xeroTenantId, contactID, contacts).ConfigureAwait(false); + var response = await instance.UpdateContactAsync(accessToken, xeroTenantId, contactID, contacts); Assert.IsType(response); } @@ -2755,7 +2755,7 @@ public async Task UpdateContactGroupTest() } } }; - var response = await instance.UpdateContactGroupAsync(accessToken, xeroTenantId, contactGroupID, contactGroups).ConfigureAwait(false); + var response = await instance.UpdateContactGroupAsync(accessToken, xeroTenantId, contactGroupID, contactGroups); Assert.IsType(response); } @@ -2769,7 +2769,7 @@ public async Task UpdateCreditNoteTest() string xeroTenantId = AutoFaker.Generate(); Guid creditNoteID = AutoFaker.Generate(); CreditNotes creditNotes = new CreditNotes(); - var response = await instance.UpdateCreditNoteAsync(accessToken, xeroTenantId, creditNoteID, creditNotes).ConfigureAwait(false); + var response = await instance.UpdateCreditNoteAsync(accessToken, xeroTenantId, creditNoteID, creditNotes); Assert.IsType(response); } @@ -2798,7 +2798,7 @@ public async Task UpdateExpenseClaimTest() string xeroTenantId = AutoFaker.Generate(); Guid expenseClaimID = AutoFaker.Generate(); ExpenseClaims expenseClaims = new ExpenseClaims(); - var response = await instance.UpdateExpenseClaimAsync(accessToken, xeroTenantId, expenseClaimID, expenseClaims).ConfigureAwait(false); + var response = await instance.UpdateExpenseClaimAsync(accessToken, xeroTenantId, expenseClaimID, expenseClaims); Assert.IsType(response); } @@ -2812,7 +2812,7 @@ public async Task UpdateInvoiceTest() string xeroTenantId = AutoFaker.Generate(); Guid invoiceID = AutoFaker.Generate(); Invoices invoices = new Invoices(); - var response = await instance.UpdateInvoiceAsync(accessToken, xeroTenantId, invoiceID, invoices).ConfigureAwait(false); + var response = await instance.UpdateInvoiceAsync(accessToken, xeroTenantId, invoiceID, invoices); Assert.IsType(response); } @@ -2841,7 +2841,7 @@ public async Task UpdateItemTest() string xeroTenantId = AutoFaker.Generate(); Guid itemID = AutoFaker.Generate(); Items items = new Items(); - var response = await instance.UpdateItemAsync(accessToken, xeroTenantId, itemID, items).ConfigureAwait(false); + var response = await instance.UpdateItemAsync(accessToken, xeroTenantId, itemID, items); Assert.IsType(response); } @@ -2855,7 +2855,7 @@ public async Task UpdateLinkedTransactionTest() string xeroTenantId = AutoFaker.Generate(); Guid linkedTransactionID = AutoFaker.Generate(); LinkedTransactions linkedTransactions = new LinkedTransactions(); - var response = await instance.UpdateLinkedTransactionAsync(accessToken, xeroTenantId, linkedTransactionID, linkedTransactions).ConfigureAwait(false); + var response = await instance.UpdateLinkedTransactionAsync(accessToken, xeroTenantId, linkedTransactionID, linkedTransactions); Assert.IsType(response); } @@ -2869,7 +2869,7 @@ public async Task UpdateManualJournalTest() string xeroTenantId = AutoFaker.Generate(); Guid manualJournalID = AutoFaker.Generate(); ManualJournals manualJournals = new ManualJournals(); - var response = await instance.UpdateManualJournalAsync(accessToken, xeroTenantId, manualJournalID, manualJournals).ConfigureAwait(false); + var response = await instance.UpdateManualJournalAsync(accessToken, xeroTenantId, manualJournalID, manualJournals); Assert.IsType(response); } @@ -2899,7 +2899,7 @@ public async Task UpdateOrCreateBankTransactionsTest() BankTransactions bankTransactions = new BankTransactions(); string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.UpdateOrCreateBankTransactionsAsync(accessToken, xeroTenantId, bankTransactions, summarizeErrors, null, idempotencyKey).ConfigureAwait(false); + var response = await instance.UpdateOrCreateBankTransactionsAsync(accessToken, xeroTenantId, bankTransactions, summarizeErrors, null, idempotencyKey); Assert.IsType(response); } @@ -2914,7 +2914,7 @@ public async Task UpdateOrCreateContactsTest() string idempotencyKey = AutoFaker.Generate(); Contacts contacts = new Contacts(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.UpdateOrCreateContactsAsync(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey).ConfigureAwait(false); + var response = await instance.UpdateOrCreateContactsAsync(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey); Assert.IsType(response); } @@ -2929,7 +2929,7 @@ public async Task UpdateOrCreateCreditNotesTest() CreditNotes creditNotes = new CreditNotes(); string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.UpdateOrCreateCreditNotesAsync(accessToken, xeroTenantId, creditNotes, summarizeErrors, null, idempotencyKey).ConfigureAwait(false); + var response = await instance.UpdateOrCreateCreditNotesAsync(accessToken, xeroTenantId, creditNotes, summarizeErrors, null, idempotencyKey); Assert.IsType(response); } @@ -2944,7 +2944,7 @@ public async Task UpdateOrCreateInvoicesTest() Invoices invoices = new Invoices(); string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.UpdateOrCreateInvoicesAsync(accessToken, xeroTenantId, invoices, summarizeErrors, null, idempotencyKey).ConfigureAwait(false); + var response = await instance.UpdateOrCreateInvoicesAsync(accessToken, xeroTenantId, invoices, summarizeErrors, null, idempotencyKey); Assert.IsType(response); } @@ -2959,7 +2959,7 @@ public async Task UpdateOrCreateItemsTest() Items items = new Items(); string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.UpdateOrCreateItemsAsync(accessToken, xeroTenantId, items, summarizeErrors, null, idempotencyKey).ConfigureAwait(false); + var response = await instance.UpdateOrCreateItemsAsync(accessToken, xeroTenantId, items, summarizeErrors, null, idempotencyKey); Assert.IsType(response); } @@ -2974,7 +2974,7 @@ public async Task UpdateOrCreatePurchaseOrdersTest() PurchaseOrders purchaseOrders = new PurchaseOrders(); string idempotencyKey = AutoFaker.Generate(); bool? summarizeErrors = AutoFaker.Generate(); - var response = await instance.UpdateOrCreatePurchaseOrdersAsync(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey).ConfigureAwait(false); + var response = await instance.UpdateOrCreatePurchaseOrdersAsync(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey); Assert.IsType(response); } @@ -2988,7 +2988,7 @@ public async Task UpdatePurchaseOrderTest() string xeroTenantId = AutoFaker.Generate(); Guid purchaseOrderID = AutoFaker.Generate(); PurchaseOrders purchaseOrders = new PurchaseOrders(); - var response = await instance.UpdatePurchaseOrderAsync(accessToken, xeroTenantId, purchaseOrderID, purchaseOrders).ConfigureAwait(false); + var response = await instance.UpdatePurchaseOrderAsync(accessToken, xeroTenantId, purchaseOrderID, purchaseOrders); Assert.IsType(response); } @@ -3002,7 +3002,7 @@ public async Task UpdateReceiptTest() string xeroTenantId = AutoFaker.Generate(); Guid receiptID = AutoFaker.Generate(); Receipts receipts = new Receipts(); - var response = await instance.UpdateReceiptAsync(accessToken, xeroTenantId, receiptID, receipts).ConfigureAwait(false); + var response = await instance.UpdateReceiptAsync(accessToken, xeroTenantId, receiptID, receipts); Assert.IsType(response); } @@ -3017,7 +3017,7 @@ public async Task UpdateReceiptTest() // Guid receiptID = AutoFaker.Generate(); // string fileName = AutoFaker.Generate(); // byte[] body = AutoFaker.Generate(); - // var response = await instance.UpdateReceiptAttachmentByFileNameAsync(accessToken, xeroTenantId, receiptID, fileName, body).ConfigureAwait(false); + // var response = await instance.UpdateReceiptAttachmentByFileNameAsync(accessToken, xeroTenantId, receiptID, fileName, body); // Assert.IsType(response); // } @@ -3045,7 +3045,7 @@ public async Task UpdateTaxRateTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); TaxRates taxRates = new TaxRates(); - var response = await instance.UpdateTaxRateAsync(accessToken, xeroTenantId, taxRates).ConfigureAwait(false); + var response = await instance.UpdateTaxRateAsync(accessToken, xeroTenantId, taxRates); Assert.IsType(response); } @@ -3059,7 +3059,7 @@ public async Task UpdateTrackingCategoryTest() string xeroTenantId = AutoFaker.Generate(); Guid trackingCategoryID = AutoFaker.Generate(); TrackingCategory trackingCategory = new TrackingCategory(); - var response = await instance.UpdateTrackingCategoryAsync(accessToken, xeroTenantId, trackingCategoryID, trackingCategory).ConfigureAwait(false); + var response = await instance.UpdateTrackingCategoryAsync(accessToken, xeroTenantId, trackingCategoryID, trackingCategory); Assert.IsType(response); } @@ -3074,7 +3074,7 @@ public async Task UpdateTrackingOptionsTest() Guid trackingCategoryID = AutoFaker.Generate(); Guid trackingOptionID = AutoFaker.Generate(); TrackingOption trackingOption = new TrackingOption(); - var response = await instance.UpdateTrackingOptionsAsync(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption).ConfigureAwait(false); + var response = await instance.UpdateTrackingOptionsAsync(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption); Assert.IsType(response); } diff --git a/Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs b/Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs index cce9bb32..c22fcbb9 100644 --- a/Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs @@ -37,7 +37,6 @@ public class PayrollAuApiTests : IAsyncLifetime private const string accessToken = "XeroNetStandardTestAccessToken"; private const string xeroTenantId = "XeroNetStandardTestTenantId"; private PayrollAuApi instance; - private readonly ITestOutputHelper output; public PayrollAuApiTests() { diff --git a/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/FeedConnectionTests.cs b/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/FeedConnectionTests.cs index e8e71adf..9f166507 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/FeedConnectionTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/FeedConnectionTests.cs @@ -53,9 +53,9 @@ public void Dispose() [Theory] [InlineData("BANK", FeedConnection.AccountTypeEnum.BANK)] [InlineData("CREDITCARD", FeedConnection.AccountTypeEnum.CREDITCARD)] - public void AccountType_ValidInputs_Deserialises(string input, FeedConnection.AccountTypeEnum expected) + public async Task AccountType_ValidInputs_Deserialises(string input, FeedConnection.AccountTypeEnum expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(FeedConnection.AccountType), input), toProperty: (x) => x.AccountType, shouldBe: expected @@ -68,9 +68,9 @@ public void AccountType_ValidInputs_Deserialises(string input, FeedConnection.Ac [Theory] [InlineData("PENDING", FeedConnection.StatusEnum.PENDING)] [InlineData("REJECTED", FeedConnection.StatusEnum.REJECTED)] - public void Status_ValidInputs_Deserialises(string input, FeedConnection.StatusEnum expected) + public async Task Status_ValidInputs_Deserialises(string input, FeedConnection.StatusEnum expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(FeedConnection.Status), input), toProperty: (x) => x.Status, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/PaginationTests.cs b/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/PaginationTests.cs index e27cc3af..8afdd32b 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/PaginationTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/PaginationTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.Bankfeeds { @@ -47,9 +48,9 @@ public void Dispose() /// Test the property 'Page' deserialises from a valid int /// [Fact] - public void Page_ValidInteger_Deserialises() + public async Task Page_ValidInteger_Deserialises() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Pagination.Page), "20"), toProperty: (t) => t.Page, shouldBe: 20 @@ -59,9 +60,9 @@ public void Page_ValidInteger_Deserialises() /// Test the property 'Page' deserialises from null /// [Fact] - public void Page_Null_Deserialises() + public async Task Page_Null_Deserialises() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Null(nameof(Pagination.Page)), toProperty: (t) => t.Page, shouldBe: null @@ -71,9 +72,9 @@ public void Page_Null_Deserialises() /// Test the property 'PageSize' deserialises from a valid int /// [Fact] - public void PageSize_ValidInteger_Deserialises() + public async Task PageSize_ValidInteger_Deserialises() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Pagination.PageSize), "20"), toProperty: (t) => t.PageSize, shouldBe: 20 @@ -83,9 +84,9 @@ public void PageSize_ValidInteger_Deserialises() /// Test the property 'PageSize' deserialises from null /// [Fact] - public void PageSize_Null_Deserialises() + public async Task PageSize_Null_Deserialises() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Null(nameof(Pagination.PageSize)), toProperty: (t) => t.PageSize, shouldBe: null @@ -95,9 +96,9 @@ public void PageSize_Null_Deserialises() /// Test the property 'PageCount' deserialises from a valid int /// [Fact] - public void PageCount_ValidInteger_Deserialises() + public async Task PageCount_ValidInteger_Deserialises() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Pagination.PageCount), "20"), toProperty: (t) => t.PageCount, shouldBe: 20 @@ -107,9 +108,9 @@ public void PageCount_ValidInteger_Deserialises() /// Test the property 'PageCount' deserialises from null /// [Fact] - public void PageCount_Null_Deserialises() + public async Task PageCount_Null_Deserialises() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Null(nameof(Pagination.PageCount)), toProperty: (t) => t.PageCount, shouldBe: null @@ -119,9 +120,9 @@ public void PageCount_Null_Deserialises() /// Test the property 'ItemCount' deserialises from a valid int /// [Fact] - public void ItemCount_ValidInteger_Deserialises() + public async Task ItemCount_ValidInteger_Deserialises() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Pagination.ItemCount), "20"), toProperty: (t) => t.ItemCount, shouldBe: 20 @@ -131,9 +132,9 @@ public void ItemCount_ValidInteger_Deserialises() /// Test the property 'ItemCount' deserialises from null /// [Fact] - public void ItemCount_Null_Deserialises() + public async Task ItemCount_Null_Deserialises() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Null(nameof(Pagination.ItemCount)), toProperty: (t) => t.ItemCount, shouldBe: null diff --git a/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/StatementLineTests.cs b/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/StatementLineTests.cs index f2032b7b..060d687e 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/StatementLineTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/Bankfeeds/StatementLineTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.Bankfeeds { @@ -49,9 +50,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void Amount_ValidInputs_Deserialises(string input) + public async Task Amount_ValidInputs_Deserialises(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(StatementLine.Amount), input), toProperty: (x) => x.Amount, shouldBe: 20m diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/DeductionTypeTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/DeductionTypeTests.cs index 7732f8b6..79a78931 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/DeductionTypeTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/DeductionTypeTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -50,9 +51,9 @@ public void Dispose() [InlineData("NONE", DeductionType.DeductionCategoryEnum.NONE)] [InlineData("UNIONFEES", DeductionType.DeductionCategoryEnum.UNIONFEES)] [InlineData("WORKPLACEGIVING", DeductionType.DeductionCategoryEnum.WORKPLACEGIVING)] - public void DeductionCategory_ValidInputs_Deserialises(string input, DeductionType.DeductionCategoryEnum expected) + public async Task DeductionCategory_ValidInputs_Deserialises(string input, DeductionType.DeductionCategoryEnum expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(DeductionType.DeductionCategory), input), toProperty: (x) => x.DeductionCategory, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EarningsLineTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EarningsLineTests.cs index c711168d..2c490515 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EarningsLineTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EarningsLineTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -49,9 +50,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void AnnualSalaryTest(string input) + public async Task AnnualSalaryTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(EarningsLine.AnnualSalary), input), toProperty: x => x.AnnualSalary, shouldBe: 20m @@ -63,9 +64,9 @@ public void AnnualSalaryTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void NumberOfUnitsPerWeekTest(string input) + public async Task NumberOfUnitsPerWeekTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(EarningsLine.NumberOfUnitsPerWeek), input), toProperty: x => x.NumberOfUnitsPerWeek, shouldBe: 20m @@ -77,9 +78,9 @@ public void NumberOfUnitsPerWeekTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void RatePerUnitTest(string input) + public async Task RatePerUnitTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(EarningsLine.RatePerUnit), input), toProperty: x => x.RatePerUnit, shouldBe: 20m @@ -91,9 +92,9 @@ public void RatePerUnitTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void NormalNumberOfUnitsTest(string input) + public async Task NormalNumberOfUnitsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(EarningsLine.NormalNumberOfUnits), input), toProperty: x => x.NormalNumberOfUnits, shouldBe: 20m @@ -105,9 +106,9 @@ public void NormalNumberOfUnitsTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void AmountTest(string input) + public async Task AmountTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(EarningsLine.Amount), input), toProperty: x => x.Amount, shouldBe: 20m @@ -119,9 +120,9 @@ public void AmountTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void NumberOfUnitsTest(string input) + public async Task NumberOfUnitsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(EarningsLine.NumberOfUnits), input), toProperty: x => x.NumberOfUnits, shouldBe: 20m @@ -133,9 +134,9 @@ public void NumberOfUnitsTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void FixedAmountTest(string input) + public async Task FixedAmountTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(EarningsLine.FixedAmount), input), toProperty: x => x.FixedAmount, shouldBe: 20m @@ -148,9 +149,9 @@ public void FixedAmountTest(string input) [InlineData("USEEARNINGSRATE", EarningsRateCalculationType.USEEARNINGSRATE)] [InlineData("ANNUALSALARY", EarningsRateCalculationType.ANNUALSALARY)] [InlineData("ENTEREARNINGSRATE", EarningsRateCalculationType.ENTEREARNINGSRATE)] - public void CalculationType_ValidInputs_Deserialises(string input, EarningsRateCalculationType expected) + public async Task CalculationType_ValidInputs_Deserialises(string input, EarningsRateCalculationType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(EarningsLine.CalculationType), input), toProperty: x => x.CalculationType, shouldBe: expected @@ -160,9 +161,9 @@ public void CalculationType_ValidInputs_Deserialises(string input, EarningsRateC /// Test the property 'CalculationType' deserialises from null /// [Fact] - public void CalculationType_NullInput_DeserialisesTo0() + public async Task CalculationType_NullInput_DeserialisesTo0() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Null(nameof(EarningsLine.CalculationType)), toProperty: x => x.CalculationType, shouldBe: 0 @@ -172,9 +173,9 @@ public void CalculationType_NullInput_DeserialisesTo0() /// Test the property 'CalculationType' deserialises when not present /// [Fact] - public void CalculationType_NotPresent_DeserialisesTo0() + public async Task CalculationType_NotPresent_DeserialisesTo0() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.NotPresent(nameof(EarningsLine.CalculationType)), toProperty: x => x.CalculationType, shouldBe: 0 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EarningsRateTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EarningsRateTests.cs index 4a525ac1..7dfeca8d 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EarningsRateTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EarningsRateTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -57,9 +58,9 @@ public void Dispose() [InlineData("LUMPSUME", EarningsType.LUMPSUME)] [InlineData("ORDINARYTIMEEARNINGS", EarningsType.ORDINARYTIMEEARNINGS)] [InlineData("OVERTIMEEARNINGS", EarningsType.OVERTIMEEARNINGS)] - public void EarningsTypeTest(string input, EarningsType expected) + public async Task EarningsTypeTest(string input, EarningsType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(EarningsRate.EarningsType), input), toProperty: e => e.EarningsType, shouldBe: expected @@ -72,9 +73,9 @@ public void EarningsTypeTest(string input, EarningsType expected) [InlineData("FIXEDAMOUNT", RateType.FIXEDAMOUNT)] [InlineData("MULTIPLE", RateType.MULTIPLE)] [InlineData("RATEPERUNIT", RateType.RATEPERUNIT)] - public void RateTypeTest(string input, RateType expected) + public async Task RateTypeTest(string input, RateType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(EarningsRate.RateType), input), toProperty: e => e.RateType, shouldBe: expected @@ -86,9 +87,9 @@ public void RateTypeTest(string input, RateType expected) [Theory] [InlineData("20.00")] [InlineData("20")] - public void MultiplierTest(string input) + public async Task MultiplierTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(EarningsRate.Multiplier), input), toProperty: x => x.Multiplier, shouldBe: 20 @@ -100,9 +101,9 @@ public void MultiplierTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void AmountTest(string input) + public async Task AmountTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(EarningsRate.Amount), input), toProperty: x => x.Amount, shouldBe: 20 @@ -114,9 +115,9 @@ public void AmountTest(string input) [Theory] [InlineData("O", EmploymentTerminationPaymentType.O)] [InlineData("R", EmploymentTerminationPaymentType.R)] - public void EmploymentTerminationPaymentTypeTest(string input, EmploymentTerminationPaymentType expected) + public async Task EmploymentTerminationPaymentTypeTest(string input, EmploymentTerminationPaymentType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(EarningsRate.EmploymentTerminationPaymentType), input), toProperty: x => x.EmploymentTerminationPaymentType, shouldBe: expected @@ -132,9 +133,9 @@ public void EmploymentTerminationPaymentTypeTest(string input, EmploymentTermina [InlineData("OTHER", AllowanceType.OTHER)] [InlineData("TRANSPORT", AllowanceType.TRANSPORT)] [InlineData("TRAVEL", AllowanceType.TRAVEL)] - public void AllowanceTypeTest(string input, AllowanceType expected) + public async Task AllowanceTypeTest(string input, AllowanceType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(EarningsRate.AllowanceType), input), toProperty: x => x.AllowanceType, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EmployeeTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EmployeeTests.cs index 94638e34..e215fe83 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EmployeeTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/EmployeeTests.cs @@ -103,9 +103,9 @@ public async Task Gender_NotPresentInInput_DeserialisesTo0() [Theory] [InlineData("ACTIVE", EmployeeStatus.ACTIVE)] [InlineData("TERMINATED", EmployeeStatus.TERMINATED)] - public void StatusTest(string input, EmployeeStatus expected) + public async Task StatusTest(string input, EmployeeStatus expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(Employee.Status), input), toProperty: x => x.Status, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/HomeAddressTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/HomeAddressTests.cs index 8526b69e..f9bebebb 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/HomeAddressTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/HomeAddressTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -55,9 +56,9 @@ public void Dispose() [InlineData("TAS", State.TAS)] [InlineData("VIC", State.VIC)] [InlineData("WA", State.WA)] - public void RegionTest(string input, State expected) + public async Task RegionTest(string input, State expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(HomeAddress.Region), input), toProperty: x => x.Region, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveAccrualLineTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveAccrualLineTests.cs index 3937dbc1..3fbbb06e 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveAccrualLineTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveAccrualLineTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -42,9 +43,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void NumberOfUnitsTest(string input) + public async Task NumberOfUnitsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(LeaveAccrualLine.NumberOfUnits), input), toProperty: x => x.NumberOfUnits, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveBalanceTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveBalanceTests.cs index 6b824f75..baf70d8b 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveBalanceTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveBalanceTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -42,9 +43,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void NumberOfUnitsTest(string input) + public async Task NumberOfUnitsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(LeaveBalance.NumberOfUnits), input), toProperty: x => x.NumberOfUnits, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveEarningsLineTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveEarningsLineTests.cs index a5e0c0f7..5e17015c 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveEarningsLineTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveEarningsLineTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -42,9 +43,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void RatePerUnitTest(string input) + public async Task RatePerUnitTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(LeaveEarningsLine.RatePerUnit), input), toProperty: x => x.RatePerUnit, shouldBe: 20 @@ -56,9 +57,9 @@ public void RatePerUnitTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void NumberOfUnitsTest(string input) + public async Task NumberOfUnitsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(LeaveEarningsLine.NumberOfUnits), input), toProperty: x => x.NumberOfUnits, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveLineTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveLineTests.cs index fe183562..ef067bdb 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveLineTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveLineTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -45,9 +46,9 @@ public void Dispose() [InlineData("ENTERRATEINPAYTEMPLATE", LeaveLineCalculationType.ENTERRATEINPAYTEMPLATE)] [InlineData("FIXEDAMOUNTEACHPERIOD", LeaveLineCalculationType.FIXEDAMOUNTEACHPERIOD)] [InlineData("NOCALCULATIONREQUIRED", LeaveLineCalculationType.NOCALCULATIONREQUIRED)] - public void CalculationTypeTest(string input, LeaveLineCalculationType expected) + public async Task CalculationTypeTest(string input, LeaveLineCalculationType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(LeaveLine.CalculationType), input), toProperty: x => x.CalculationType, shouldBe: expected @@ -59,9 +60,9 @@ public void CalculationTypeTest(string input, LeaveLineCalculationType expected) [Theory] [InlineData("NOTPAIDOUT", EntitlementFinalPayPayoutType.NOTPAIDOUT)] [InlineData("PAIDOUT", EntitlementFinalPayPayoutType.PAIDOUT)] - public void EntitlementFinalPayPayoutTypeTest(string input, EntitlementFinalPayPayoutType expected) + public async Task EntitlementFinalPayPayoutTypeTest(string input, EntitlementFinalPayPayoutType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(LeaveLine.EntitlementFinalPayPayoutType), input), toProperty: x => x.EntitlementFinalPayPayoutType, shouldBe: expected @@ -73,9 +74,9 @@ public void EntitlementFinalPayPayoutTypeTest(string input, EntitlementFinalPayP [Theory] [InlineData("O", EmploymentTerminationPaymentType.O)] [InlineData("R", EmploymentTerminationPaymentType.R)] - public void EmploymentTerminationPaymentTypeTest(string input, EmploymentTerminationPaymentType expected) + public async Task EmploymentTerminationPaymentTypeTest(string input, EmploymentTerminationPaymentType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(LeaveLine.EmploymentTerminationPaymentType), input), toProperty: x => x.EmploymentTerminationPaymentType, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeavePeriodTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeavePeriodTests.cs index 457e4450..f4353f5a 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeavePeriodTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeavePeriodTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -43,9 +44,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void NumberOfUnitsTest(string input) + public async Task NumberOfUnitsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(LeavePeriod.NumberOfUnits), input), toProperty: x => x.NumberOfUnits, shouldBe: 20 @@ -57,9 +58,9 @@ public void NumberOfUnitsTest(string input) [Theory] [InlineData("PROCESSED", LeavePeriodStatus.PROCESSED)] [InlineData("SCHEDULED", LeavePeriodStatus.SCHEDULED)] - public void LeavePeriodStatusTest(string input, LeavePeriodStatus expected) + public async Task LeavePeriodStatusTest(string input, LeavePeriodStatus expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(LeavePeriod.LeavePeriodStatus), input), toProperty: x => x.LeavePeriodStatus, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveTypeTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveTypeTests.cs index 79949b1e..eb52bddf 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveTypeTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/LeaveTypeTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -43,9 +44,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void NormalEntitlementTest(string input) + public async Task NormalEntitlementTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(LeaveType.NormalEntitlement), input), toProperty: x => x.NormalEntitlement, shouldBe: 20 @@ -57,9 +58,9 @@ public void NormalEntitlementTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void LeaveLoadingRateTest(string input) + public async Task LeaveLoadingRateTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(LeaveType.LeaveLoadingRate), input), toProperty: x => x.LeaveLoadingRate, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayRunTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayRunTests.cs index e74b83fb..a893931e 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayRunTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayRunTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -43,9 +44,9 @@ public void Dispose() [Theory] [InlineData("DRAFT", PayRunStatus.DRAFT)] [InlineData("POSTED", PayRunStatus.POSTED)] - public void PayRunStatusTest(string input, PayRunStatus expected) + public async Task PayRunStatusTest(string input, PayRunStatus expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(PayRun.PayRunStatus), input), toProperty: x => x.PayRunStatus, shouldBe: expected @@ -57,9 +58,9 @@ public void PayRunStatusTest(string input, PayRunStatus expected) [Theory] [InlineData("20.00")] [InlineData("20")] - public void WagesTest(string input) + public async Task WagesTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayRun.Wages), input), toProperty: x => x.Wages, shouldBe: 20 @@ -71,9 +72,9 @@ public void WagesTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void DeductionsTest(string input) + public async Task DeductionsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayRun.Deductions), input), toProperty: x => x.Deductions, shouldBe: 20 @@ -85,9 +86,9 @@ public void DeductionsTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void TaxTest(string input) + public async Task TaxTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayRun.Tax), input), toProperty: x => x.Tax, shouldBe: 20 @@ -99,9 +100,9 @@ public void TaxTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void SuperTest(string input) + public async Task SuperTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayRun.Super), input), toProperty: x => x.Super, shouldBe: 20 @@ -113,9 +114,9 @@ public void SuperTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void ReimbursementTest(string input) + public async Task ReimbursementTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayRun.Reimbursement), input), toProperty: x => x.Reimbursement, shouldBe: 20 @@ -127,9 +128,9 @@ public void ReimbursementTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void NetPayTest(string input) + public async Task NetPayTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayRun.NetPay), input), toProperty: x => x.NetPay, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayrollCalendarTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayrollCalendarTests.cs index 1f3a8381..5f62a835 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayrollCalendarTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayrollCalendarTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -47,9 +48,9 @@ public void Dispose() [InlineData("MONTHLY", CalendarType.MONTHLY)] [InlineData("QUARTERLY", CalendarType.QUARTERLY)] [InlineData("WEEKLY", CalendarType.WEEKLY)] - public void CalendarTypeTest(string input, CalendarType expected) + public async Task CalendarTypeTest(string input, CalendarType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(PayrollCalendar.CalendarType), input), toProperty: x => x.CalendarType, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayslipSummaryTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayslipSummaryTests.cs index 20e10462..38984bcf 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayslipSummaryTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayslipSummaryTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -43,9 +44,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void WagesTest(string input) + public async Task WagesTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayslipSummary.Wages), input), toProperty: x => x.Wages, shouldBe: 20 @@ -57,9 +58,9 @@ public void WagesTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void DeductionsTest(string input) + public async Task DeductionsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayslipSummary.Deductions), input), toProperty: x => x.Deductions, shouldBe: 20 @@ -71,9 +72,9 @@ public void DeductionsTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void TaxTest(string input) + public async Task TaxTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayslipSummary.Tax), input), toProperty: x => x.Tax, shouldBe: 20 @@ -85,9 +86,9 @@ public void TaxTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void SuperTest(string input) + public async Task SuperTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayslipSummary.Super), input), toProperty: x => x.Super, shouldBe: 20 @@ -99,9 +100,9 @@ public void SuperTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void ReimbursementsTest(string input) + public async Task ReimbursementsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayslipSummary.Reimbursements), input), toProperty: x => x.Reimbursements, shouldBe: 20 @@ -113,9 +114,9 @@ public void ReimbursementsTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void NetPayTest(string input) + public async Task NetPayTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(PayslipSummary.NetPay), input), toProperty: x => x.NetPay, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayslipTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayslipTests.cs index b5b393a5..3c960394 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayslipTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/PayslipTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -43,9 +44,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void WagesTest(string input) + public async Task WagesTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Payslip.Wages), input), toProperty: x => x.Wages, shouldBe: 20 @@ -57,9 +58,9 @@ public void WagesTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void DeductionsTest(string input) + public async Task DeductionsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Payslip.Deductions), input), toProperty: x => x.Deductions, shouldBe: 20 @@ -71,9 +72,9 @@ public void DeductionsTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void TaxTest(string input) + public async Task TaxTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Payslip.Tax), input), toProperty: x => x.Tax, shouldBe: 20 @@ -85,9 +86,9 @@ public void TaxTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void SuperTest(string input) + public async Task SuperTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Payslip.Super), input), toProperty: x => x.Super, shouldBe: 20 @@ -99,9 +100,9 @@ public void SuperTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void ReimbursementsTest(string input) + public async Task ReimbursementsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Payslip.Reimbursements), input), toProperty: x => x.Reimbursements, shouldBe: 20 @@ -113,9 +114,9 @@ public void ReimbursementsTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void NetPayTest(string input) + public async Task NetPayTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Payslip.NetPay), input), toProperty: x => x.NetPay, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/ReimbursementLineTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/ReimbursementLineTests.cs index c17df448..bbfdbcba 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/ReimbursementLineTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/ReimbursementLineTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -43,9 +44,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void AmountTest(string input) + public async Task AmountTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(ReimbursementLine.Amount), input), toProperty: x => x.Amount, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SettingsTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SettingsTests.cs index b97cc381..3e910320 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SettingsTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SettingsTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -41,9 +42,9 @@ public void Dispose() /// Test the property 'DaysInPayrollYear' /// [Fact] - public void DaysInPayrollYearTest() + public async Task DaysInPayrollYearTest() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Settings.DaysInPayrollYear), "20"), toProperty: x => x.DaysInPayrollYear, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperFundTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperFundTests.cs index 443dc7ff..a6dcdb0b 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperFundTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperFundTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -43,9 +44,9 @@ public void Dispose() [Theory] [InlineData("REGULATED", SuperFundType.REGULATED)] [InlineData("SMSF", SuperFundType.SMSF)] - public void TypeTest(string input, SuperFundType expected) + public async Task TypeTest(string input, SuperFundType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(SuperFund.Type), input), toProperty: x => x.Type, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperLineTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperLineTests.cs index d82dc8b0..fce7ab01 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperLineTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperLineTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -45,9 +46,9 @@ public void Dispose() [InlineData("EMPLOYERADDITIONAL", SuperannuationContributionType.EMPLOYERADDITIONAL)] [InlineData("SALARYSACRIFICE", SuperannuationContributionType.SALARYSACRIFICE)] [InlineData("SGC", SuperannuationContributionType.SGC)] - public void ContributionTypeTest(string input, SuperannuationContributionType expected) + public async Task ContributionTypeTest(string input, SuperannuationContributionType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(SuperLine.ContributionType), input), toProperty: x => x.ContributionType, shouldBe: expected @@ -60,9 +61,9 @@ public void ContributionTypeTest(string input, SuperannuationContributionType ex [InlineData("FIXEDAMOUNT", SuperannuationCalculationType.FIXEDAMOUNT)] [InlineData("PERCENTAGEOFEARNINGS", SuperannuationCalculationType.PERCENTAGEOFEARNINGS)] [InlineData("STATUTORY", SuperannuationCalculationType.STATUTORY)] - public void CalculationTypeTest(string input, SuperannuationCalculationType expected) + public async Task CalculationTypeTest(string input, SuperannuationCalculationType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(SuperLine.CalculationType), input), toProperty: x => x.CalculationType, shouldBe: expected @@ -74,9 +75,9 @@ public void CalculationTypeTest(string input, SuperannuationCalculationType expe [Theory] [InlineData("20.00")] [InlineData("20")] - public void MinimumMonthlyEarningsTest(string input) + public async Task MinimumMonthlyEarningsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(SuperLine.MinimumMonthlyEarnings), input), toProperty: x => x.MinimumMonthlyEarnings, shouldBe: 20 @@ -88,9 +89,9 @@ public void MinimumMonthlyEarningsTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void PercentageTest(string input) + public async Task PercentageTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(SuperLine.Percentage), input), toProperty: x => x.Percentage, shouldBe: 20 @@ -102,9 +103,9 @@ public void PercentageTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void AmountTest(string input) + public async Task AmountTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(SuperLine.Amount), input), toProperty: x => x.Amount, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperannuationLineTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperannuationLineTests.cs index ba3f0fdc..aca16200 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperannuationLineTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/SuperannuationLineTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -45,9 +46,9 @@ public void Dispose() [InlineData("EMPLOYERADDITIONAL", SuperannuationContributionType.EMPLOYERADDITIONAL)] [InlineData("SALARYSACRIFICE", SuperannuationContributionType.SALARYSACRIFICE)] [InlineData("SGC", SuperannuationContributionType.SGC)] - public void ContributionTypeTest(string input, SuperannuationContributionType expected) + public async Task ContributionTypeTest(string input, SuperannuationContributionType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(SuperannuationLine.ContributionType), input), toProperty: x => x.ContributionType, shouldBe: expected @@ -60,9 +61,9 @@ public void ContributionTypeTest(string input, SuperannuationContributionType ex [InlineData("FIXEDAMOUNT", SuperannuationCalculationType.FIXEDAMOUNT)] [InlineData("PERCENTAGEOFEARNINGS", SuperannuationCalculationType.PERCENTAGEOFEARNINGS)] [InlineData("STATUTORY", SuperannuationCalculationType.STATUTORY)] - public void CalculationTypeTest(string input, SuperannuationCalculationType expected) + public async Task CalculationTypeTest(string input, SuperannuationCalculationType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(SuperannuationLine.CalculationType), input), toProperty: x => x.CalculationType, shouldBe: expected @@ -74,9 +75,9 @@ public void CalculationTypeTest(string input, SuperannuationCalculationType expe [Theory] [InlineData("20.00")] [InlineData("20")] - public void MinimumMonthlyEarningsTest(string input) + public async Task MinimumMonthlyEarningsTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(SuperannuationLine.MinimumMonthlyEarnings), input), toProperty: x => x.MinimumMonthlyEarnings, shouldBe: 20 @@ -88,9 +89,9 @@ public void MinimumMonthlyEarningsTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void PercentageTest(string input) + public async Task PercentageTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(SuperannuationLine.Percentage), input), toProperty: x => x.Percentage, shouldBe: 20 @@ -102,9 +103,9 @@ public void PercentageTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void AmountTest(string input) + public async Task AmountTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(SuperannuationLine.Amount), input), toProperty: x => x.Amount, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TaxDeclarationTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TaxDeclarationTests.cs index 043a4b33..1c8e7e26 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TaxDeclarationTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TaxDeclarationTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -46,9 +47,9 @@ public void Dispose() [InlineData("CASUAL", EmploymentBasis.CASUAL)] [InlineData("LABOURHIRE", EmploymentBasis.LABOURHIRE)] [InlineData("SUPERINCOMESTREAM", EmploymentBasis.SUPERINCOMESTREAM)] - public void EmploymentBasis_ValidInputs_Deserialises(string input, EmploymentBasis expected) + public async Task EmploymentBasis_ValidInputs_Deserialises(string input, EmploymentBasis expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(TaxDeclaration.EmploymentBasis), input), toProperty: (t) => t.EmploymentBasis, shouldBe: expected @@ -58,9 +59,9 @@ public void EmploymentBasis_ValidInputs_Deserialises(string input, EmploymentBas /// Test the property 'EmploymentBasis' deserialises from null to 0 /// [Fact] - public void EmploymentBasis_NullInput_DeserialisesTo0() + public async Task EmploymentBasis_NullInput_DeserialisesTo0() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Null(nameof(TaxDeclaration.EmploymentBasis)), toProperty: (t) => t.EmploymentBasis, shouldBe: 0 @@ -70,9 +71,9 @@ public void EmploymentBasis_NullInput_DeserialisesTo0() /// Test the property 'EmploymentBasis' deserialises to 0 when not present /// [Fact] - public void EmploymentBasis_NotPresentInInput_DeserialisesTo0() + public async Task EmploymentBasis_NotPresentInInput_DeserialisesTo0() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.NotPresent(nameof(TaxDeclaration.EmploymentBasis)), toProperty: (t) => t.EmploymentBasis, shouldBe: 0 @@ -86,9 +87,9 @@ public void EmploymentBasis_NotPresentInInput_DeserialisesTo0() [InlineData("PENDING", TFNExemptionType.PENDING)] [InlineData("PENSIONER", TFNExemptionType.PENSIONER)] [InlineData("UNDER18", TFNExemptionType.UNDER18)] - public void TFNExemptionType_ValidInputs_Deserialises(string input, TFNExemptionType expected) + public async Task TFNExemptionType_ValidInputs_Deserialises(string input, TFNExemptionType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(TaxDeclaration.TFNExemptionType), input), toProperty: (declaration) => declaration.TFNExemptionType, shouldBe: expected @@ -98,9 +99,9 @@ public void TFNExemptionType_ValidInputs_Deserialises(string input, TFNExemption /// Test the property 'TFNExemptionType' deserialises from null to 0 /// [Fact] - public void TFNExemptionType_NullInput_DeserialisesTo0() + public async Task TFNExemptionType_NullInput_DeserialisesTo0() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Null(nameof(TaxDeclaration.TFNExemptionType)), toProperty: (declaration) => declaration.TFNExemptionType, shouldBe: 0 @@ -110,9 +111,9 @@ public void TFNExemptionType_NullInput_DeserialisesTo0() /// Test the property 'TFNExemptionType' deserialises to 0 when not present /// [Fact] - public void TFNExemptionType_NotPresentInInput_DeserialisesTo0() + public async Task TFNExemptionType_NotPresentInInput_DeserialisesTo0() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.NotPresent(nameof(TaxDeclaration.TFNExemptionType)), toProperty: (declaration) => declaration.TFNExemptionType, shouldBe: 0 @@ -124,9 +125,9 @@ public void TFNExemptionType_NotPresentInInput_DeserialisesTo0() [Theory] [InlineData("true", true)] [InlineData("false", false)] - public void AustralianResidentForTaxPurposesTest(string input, bool expected) + public async Task AustralianResidentForTaxPurposesTest(string input, bool expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Bool( nameof(TaxDeclaration.AustralianResidentForTaxPurposes), input), @@ -141,9 +142,9 @@ public void AustralianResidentForTaxPurposesTest(string input, bool expected) [InlineData("AUSTRALIANRESIDENT", ResidencyStatus.AUSTRALIANRESIDENT)] [InlineData("FOREIGNRESIDENT", ResidencyStatus.FOREIGNRESIDENT)] [InlineData("WORKINGHOLIDAYMAKER", ResidencyStatus.WORKINGHOLIDAYMAKER)] - public void ResidencyStatus_ValidInputs_Deserialises(string input, ResidencyStatus expected) + public async Task ResidencyStatus_ValidInputs_Deserialises(string input, ResidencyStatus expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(TaxDeclaration.ResidencyStatus), input), toProperty: x => x.ResidencyStatus, shouldBe: expected @@ -155,9 +156,9 @@ public void ResidencyStatus_ValidInputs_Deserialises(string input, ResidencyStat [Theory] [InlineData("20.00")] [InlineData("20")] - public void TaxOffsetEstimatedAmountTest(string input) + public async Task TaxOffsetEstimatedAmountTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(TaxDeclaration.TaxOffsetEstimatedAmount), input), toProperty: (declaration) => declaration.TaxOffsetEstimatedAmount, shouldBe: 20 @@ -169,9 +170,9 @@ public void TaxOffsetEstimatedAmountTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void UpwardVariationTaxWithholdingAmountTest(string input) + public async Task UpwardVariationTaxWithholdingAmountTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(TaxDeclaration.UpwardVariationTaxWithholdingAmount), input), toProperty: x => x.UpwardVariationTaxWithholdingAmount, shouldBe: 20 @@ -183,9 +184,9 @@ public void UpwardVariationTaxWithholdingAmountTest(string input) [Theory] [InlineData("20.00")] [InlineData("20")] - public void ApprovedWithholdingVariationPercentageTest(string input) + public async Task ApprovedWithholdingVariationPercentageTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(TaxDeclaration.ApprovedWithholdingVariationPercentage), input), toProperty: x => x.ApprovedWithholdingVariationPercentage, shouldBe: 20 @@ -195,9 +196,9 @@ public void ApprovedWithholdingVariationPercentageTest(string input) /// Test the property 'UpdatedDateUTC' /// [Fact] - public void UpdatedDateUTCTest() + public async Task UpdatedDateUTCTest() { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String( nameof(TaxDeclaration.UpdatedDateUTC), "/Date(1535481994000+0000)/"), diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TaxLineTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TaxLineTests.cs index 359f62a5..667d6b9c 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TaxLineTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TaxLineTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -43,9 +44,9 @@ public void Dispose() [Theory] [InlineData("20.00")] [InlineData("20")] - public void AmountTest(string input) + public async Task AmountTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(TaxLine.Amount), input), toProperty: x => x.Amount, shouldBe: 20 @@ -60,9 +61,9 @@ public void AmountTest(string input) [InlineData("PAYGMANUAL", ManualTaxType.PAYGMANUAL)] [InlineData("SCHEDULE5MANUAL", ManualTaxType.SCHEDULE5MANUAL)] [InlineData("SCHEDULE5STSLMANUAL", ManualTaxType.SCHEDULE5STSLMANUAL)] - public void ManualTaxTypeTest(string input, ManualTaxType expected) + public async Task ManualTaxTypeTest(string input, ManualTaxType expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(TaxLine.ManualTaxType), input), toProperty: x => x.ManualTaxType, shouldBe: expected diff --git a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TimesheetTests.cs b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TimesheetTests.cs index 54b852c8..585f4f5f 100644 --- a/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TimesheetTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Model/PayrollAu/TimesheetTests.cs @@ -20,6 +20,7 @@ using Xero.NetStandard.OAuth2.Client; using System.Reflection; using Newtonsoft.Json; +using System.Threading.Tasks; namespace Xero.NetStandard.OAuth2.Test.Model.PayrollAu { @@ -45,9 +46,9 @@ public void Dispose() [InlineData("PROCESSED", TimesheetStatus.PROCESSED)] [InlineData("REJECTED", TimesheetStatus.REJECTED)] [InlineData("REQUESTED", TimesheetStatus.REQUESTED)] - public void StatusTest(string input, TimesheetStatus expected) + public async Task StatusTest(string input, TimesheetStatus expected) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.String(nameof(Timesheet.Status), input), toProperty: x => x.Status, shouldBe: expected @@ -59,9 +60,9 @@ public void StatusTest(string input, TimesheetStatus expected) [Theory] [InlineData("20.00")] [InlineData("20")] - public void HoursTest(string input) + public async Task HoursTest(string input) { - JsonDoc.Assert( + await JsonDoc.Assert( input: new JsonDoc.Number(nameof(Timesheet.Hours), input), toProperty: x => x.Hours, shouldBe: 20 diff --git a/Xero.NetStandard.OAuth2.Test/Xero.NetStandard.OAuth2.Test.csproj b/Xero.NetStandard.OAuth2.Test/Xero.NetStandard.OAuth2.Test.csproj index dce0f22b..9a18b4f9 100644 --- a/Xero.NetStandard.OAuth2.Test/Xero.NetStandard.OAuth2.Test.csproj +++ b/Xero.NetStandard.OAuth2.Test/Xero.NetStandard.OAuth2.Test.csproj @@ -5,24 +5,24 @@ Properties Xero.NetStandard.OAuth2.Test Xero.NetStandard.OAuth2.Test - netcoreapp3.1 + net8.0 false 512 - - - - - - - + + + + + + + - - - - - + + + + + diff --git a/Xero.NetStandard.OAuth2.Test/util/start-prism.sh b/Xero.NetStandard.OAuth2.Test/util/start-prism.sh old mode 100644 new mode 100755 index b9b564dd..f6d3aa00 --- a/Xero.NetStandard.OAuth2.Test/util/start-prism.sh +++ b/Xero.NetStandard.OAuth2.Test/util/start-prism.sh @@ -1,3 +1,5 @@ +#!/bin/bash + prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_accounting.yaml --host 127.0.0.1 --port 4010 & prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-app-store.yaml --host 127.0.0.1 --port 4011 & prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_assets.yaml --host 127.0.0.1 --port 4012 & diff --git a/Xero.NetStandard.OAuth2/Client/ApiClient.cs b/Xero.NetStandard.OAuth2/Client/ApiClient.cs index 39de7452..5237fe3d 100644 --- a/Xero.NetStandard.OAuth2/Client/ApiClient.cs +++ b/Xero.NetStandard.OAuth2/Client/ApiClient.cs @@ -643,6 +643,7 @@ private async Task> Exec(HttpRequestMessage req, /// /// The target path (or resource). /// The additional request options. + /// The Cancellation Token. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse @@ -656,6 +657,7 @@ public ApiResponse Get(string path, RequestOptions options, IReadableConfi /// /// The target path (or resource). /// The additional request options. + /// The Cancellation Token. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse @@ -669,6 +671,7 @@ public ApiResponse Post(string path, RequestOptions options, IReadableConf /// /// The target path (or resource). /// The additional request options. + /// The Cancellation Token. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse @@ -682,6 +685,7 @@ public ApiResponse Put(string path, RequestOptions options, IReadableConfi /// /// The target path (or resource). /// The additional request options. + /// The Cancellation Token. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse @@ -695,6 +699,7 @@ public ApiResponse Delete(string path, RequestOptions options, IReadableCo /// /// The target path (or resource). /// The additional request options. + /// The Cancellation Token. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse @@ -708,6 +713,7 @@ public ApiResponse Head(string path, RequestOptions options, IReadableConf /// /// The target path (or resource). /// The additional request options. + /// The Cancellation Token. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse @@ -721,6 +727,7 @@ public ApiResponse Options(string path, RequestOptions options, IReadableC /// /// The target path (or resource). /// The additional request options. + /// The Cancellation Token. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse diff --git a/Xero.NetStandard.OAuth2/Xero.NetStandard.OAuth2.csproj b/Xero.NetStandard.OAuth2/Xero.NetStandard.OAuth2.csproj index 35be262e..05d1a240 100644 --- a/Xero.NetStandard.OAuth2/Xero.NetStandard.OAuth2.csproj +++ b/Xero.NetStandard.OAuth2/Xero.NetStandard.OAuth2.csproj @@ -27,10 +27,10 @@ - - - - + + + + diff --git a/Xero.NetStandard.OAuth2Client/Xero.NetStandard.OAuth2Client.csproj b/Xero.NetStandard.OAuth2Client/Xero.NetStandard.OAuth2Client.csproj index 4a859c5a..582dc6d4 100644 --- a/Xero.NetStandard.OAuth2Client/Xero.NetStandard.OAuth2Client.csproj +++ b/Xero.NetStandard.OAuth2Client/Xero.NetStandard.OAuth2Client.csproj @@ -13,8 +13,8 @@ - - - + + + diff --git a/scripts/format.sh b/scripts/format.sh new file mode 100644 index 00000000..0753356d --- /dev/null +++ b/scripts/format.sh @@ -0,0 +1,4 @@ +SCRIPT_DIR=$(dirname "$0") +PROJECT_ROOT=$(realpath "${SCRIPT_DIR}/..") +cd "${PROJECT_ROOT}" +dotnet format \ No newline at end of file