Cotton command: cotton -u https://services.odata.org -d northwind_customers.md
Query first 10 customers
Assert | Expected |
---|---|
StatusCode | 200 |
Data.d[0].CustomerID | ALFKI |
Data.d[1].CustomerID | ANATR |
Data.d[2].CustomerID | ANTON |
Data.d[3].CustomerID | AROUT |
Data.d[4].CustomerID | BERGS |
Data.d[5].CustomerID | BLAUS |
Data.d[6].CustomerID | BLONP |
Data.d[7].CustomerID | BOLID |
Data.d[8].CustomerID | BONAP |
Data.d[9].CustomerID | BOTTM |
Data.d[10].CustomerID | Should not exist |
Query customer with ContactName = 'Frédérique Citeaux'
Assert | Expected |
---|---|
StatusCode | 200 |
Data.d.results[0].CustomerID | BLONP |
Data.d.results[0].CompanyName | Should exist |
Data.d.results[0].ContactName | Should exist |
Data.d.results[0].ContactTitle | Should exist |
Data.d.results[0].Address | Should exist |
Data.d.results[0].City | Should exist |
Data.d.results[0].Region | Should be null |
Data.d.results[0].Region | Should exist |
Data.d.results[0].PostalCode | Should exist |
Data.d.results[0].Country | Should exist |
Data.d.results[0].Phone | Should exist |
Data.d.results[0].Fax | Should exist |
Data.d.results[0].Orders | Should exist |
Data.d.results[0].CustomerDemographics | Should exist |
Data.d.results[1] | should not exist |
Get single customer ID BOLID
GET /V2/Northwind/Northwind.svc/Customers('BOLID')/?$format=json&$select=CustomerID,CompanyName,ContactName,Country
Assert | Expected |
---|---|
StatusCode | 200 |
Data.d.CustomerID | BOLID |
Data.d.CompanyName | Should exist |
Data.d.ContactName | Should exist |
Data.d.ContactTitle | Should not exist |
Data.d.Address | Should not exist |
Data.d.City | Should not exist |
Data.d.Region | Should not exist |
Data.d.PostalCode | Should not exist |
Data.d.Country | Should exist |
Data.d.Phone | Should not exist |
Data.d.Fax | Should not exist |
Data.d.Orders | Should not exist |
Data.d.CustomerDemographics | Should not exist |
Assert | Expected |
---|---|
StatusCode | 200 |
Data.d.ProductID | 1 |
Data.d.Discontinued | Should be false |