Skip to content

Commit fc8cba9

Browse files
Build for version - 12.0.0 (#615)
Build for version - 12.0.0 (#615)
1 parent 199a254 commit fc8cba9

33 files changed

+321
-1719
lines changed

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ The Xero-NetStandard SDK makes it easy for developers to access Xero's APIs in t
1717
- [API Clients](#api-clients)
1818
- [Helper Methods](#helper-methods)
1919
- [Usage Examples](#usage-examples)
20-
- [Running Test(s) in Local](#running-tests-in-local)
2120
- [SDK conventions](#sdk-conventions)
2221
- [Contributing](#contributing)
2322

@@ -797,16 +796,6 @@ await FilesApi.DeleteFileAssociationAsync(accessToken, xeroTenantId, fileIdGuid,
797796
```
798797

799798
---
800-
## Running Test(s) in Local
801-
For Running Test cases PRISM Mock Server needs to be started in the local machine.
802-
Steps to Run Test(s)
803-
* Install PRISM from npm using the command: **npm install -g @stoplight/prism-cli**
804-
* Verify Installation: **prism --version**
805-
* Navigate to **Xero-NetStandard--> Xero.NetStandard.OAuth2.Test--> util** folder in the terminal
806-
* Execute the script **./start-prism.sh**
807-
* This will start the PRISM Server in Local
808-
* Run **dotnet test** to run the dotnet test cases.
809-
810799
## SDK conventions
811800

812801
## Security (state check & Jwt validation)

Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs

Lines changed: 42 additions & 200 deletions
Large diffs are not rendered by default.

Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,9 @@ public void InstanceTest()
7676
[Fact]
7777
public async Task CreateEmployeeTest()
7878
{
79-
List<Employee> employees = new List<Employee> { new Employee()
80-
{
81-
FirstName = "Adam",
82-
LastName = "Adamson",
83-
DateOfBirth = new DateTime(2000, 10, 10)
84-
}};
85-
var response = await instance.CreateEmployeeAsync(accessToken, xeroTenantId, employees);
79+
List<Employee> employee =
80+
new List<Employee> { new Employee() };
81+
var response = await instance.CreateEmployeeAsync(accessToken, xeroTenantId, employee);
8682
Assert.IsType<Employees>(response);
8783
}
8884

@@ -115,10 +111,7 @@ public async Task CreatePayItemTest()
115111
[Fact]
116112
public async Task CreatePayRunTest()
117113
{
118-
List<PayRun> payRun = new List<PayRun> { new PayRun()
119-
{
120-
PayrollCalendarID = Guid.Parse("00000000-0000-0000-0000-000000000000")
121-
}};
114+
List<PayRun> payRun = new List<PayRun> { new PayRun() };
122115
var response = await instance.CreatePayRunAsync(accessToken, xeroTenantId, payRun);
123116
Assert.IsType<PayRuns>(response);
124117
}
@@ -140,10 +133,7 @@ public async Task CreatePayrollCalendarTest()
140133
[Fact]
141134
public async Task CreateSuperfundTest()
142135
{
143-
List<SuperFund> superFund = new List<SuperFund> { new SuperFund()
144-
{
145-
Type = SuperFundType.REGULATED
146-
}};
136+
List<SuperFund> superFund = new List<SuperFund> { new SuperFund() };
147137
var response = await instance.CreateSuperfundAsync(accessToken, xeroTenantId, superFund);
148138
Assert.IsType<SuperFunds>(response);
149139
}
@@ -154,14 +144,7 @@ public async Task CreateSuperfundTest()
154144
[Fact]
155145
public async Task CreateTimesheetTest()
156146
{
157-
var startDate = new DateTime(2020, 10, 23);
158-
var endDate = new DateTime(2020, 10, 30);
159-
List<Timesheet> timesheet = new List<Timesheet> { new Timesheet()
160-
{
161-
EmployeeID = Guid.Parse("00000000-0000-0000-0000-000000000000"),
162-
StartDate = startDate,
163-
EndDate = endDate,
164-
}};
147+
List<Timesheet> timesheet = new List<Timesheet> { new Timesheet() };
165148
var response = await instance.CreateTimesheetAsync(accessToken, xeroTenantId, timesheet);
166149
Assert.IsType<Timesheets>(response);
167150
}
@@ -370,12 +353,7 @@ public async Task GetTimesheetsTest()
370353
public async Task UpdateEmployeeTest()
371354
{
372355
Guid employeeId = AutoFaker.Generate<Guid>();
373-
List<Employee> employee = new List<Employee> { new Employee()
374-
{
375-
FirstName = "Adam",
376-
LastName = "Adamson",
377-
DateOfBirth = new DateTime(2000, 10, 10)
378-
}};
356+
List<Employee> employee = new List<Employee> { new Employee() };
379357
string idempotencyKey = AutoFaker.Generate<string>();
380358
var response = await instance.UpdateEmployeeAsync(accessToken, xeroTenantId, employeeId, employee, idempotencyKey);
381359
Assert.IsType<Employees>(response);
@@ -401,10 +379,7 @@ public async Task UpdatePayRunTest()
401379
{
402380
Guid payRunID = AutoFaker.Generate<Guid>();
403381
string idempotencyKey = AutoFaker.Generate<string>();
404-
List<PayRun> payRun = new List<PayRun> { new PayRun()
405-
{
406-
PayrollCalendarID = Guid.Parse("00000000-0000-0000-0000-000000000000")
407-
}};
382+
List<PayRun> payRun = new List<PayRun> { new PayRun() };
408383
var response = await instance.UpdatePayRunAsync(accessToken, xeroTenantId, payRunID, payRun, idempotencyKey);
409384
Assert.IsType<PayRuns>(response);
410385
}
@@ -430,10 +405,7 @@ public async Task UpdateSuperfundTest()
430405
{
431406
Guid superFundID = AutoFaker.Generate<Guid>();
432407
string idempotencyKey = AutoFaker.Generate<string>();
433-
List<SuperFund> superFund = new List<SuperFund> { new SuperFund()
434-
{
435-
Type = SuperFundType.REGULATED
436-
}};
408+
List<SuperFund> superFund = new List<SuperFund> { new SuperFund() };
437409
var response = await instance.UpdateSuperfundAsync(accessToken, xeroTenantId, superFundID, superFund, idempotencyKey);
438410
Assert.IsType<SuperFunds>(response);
439411
}
@@ -446,14 +418,7 @@ public async Task UpdateTimesheetTest()
446418
{
447419
Guid timesheetID = AutoFaker.Generate<Guid>();
448420
string idempotencyKey = AutoFaker.Generate<string>();
449-
var startDate = new DateTime(2020, 10, 23);
450-
var endDate = new DateTime(2020, 10, 30);
451-
List<Timesheet> timesheet = new List<Timesheet> { new Timesheet()
452-
{
453-
EmployeeID = Guid.Parse("00000000-0000-0000-0000-000000000000"),
454-
StartDate = startDate,
455-
EndDate = endDate,
456-
}};
421+
List<Timesheet> timesheet = new List<Timesheet> { new Timesheet() };
457422
var response = await instance.UpdateTimesheetAsync(accessToken, xeroTenantId, timesheetID, timesheet, idempotencyKey);
458423
Assert.IsType<Timesheets>(response);
459424
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"XeroConfiguration": {
3-
"AccountingBaseUrl": "http://127.0.0.1:4010",
4-
"BankfeedsBaseUrl": "http://127.0.0.1:4013",
5-
"PayrollAuBaseUrl": "http://127.0.0.1:4017"
3+
"AccountingBaseUrl": "https://25faf04a-c71e-40e7-b7ce-f1fae0149465.mock.pstmn.io/api.xro/2.0",
4+
"BankfeedsBaseUrl": "https://3e140044-4914-47dd-b4e1-df0cc040a44f.mock.pstmn.io/bankfeeds.xro/1.0",
5+
"PayrollAuBaseUrl": "https://5f9f95f1-25c8-40dd-8b10-8192c658dd79.mock.pstmn.io/payroll.xro/1.0"
66
}
77
}

0 commit comments

Comments
 (0)