public void GetBookSales_When_BookDoesNotExist_ReturnsNotFound() { var request = SaleRequestHelper.GetBookSales(shopName, NON_EXISTING_BOOK); var response = this.restClient.Execute <BookResponse>(request); Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode); }
public void GetBookSales_When_ShopDoesNotExist_ReturnsOk() { var request = SaleRequestHelper.GetBookSales("UnexistingShop", EXISTING_BOOK); var response = this.restClient.Execute <List <SaleResponse> >(request); Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode); }
public void GetBookSales_When_BookSoldWithoutSeller_ReturnsNoContent() { var request = SaleRequestHelper.GetBookSales(shopName, EXISTING_BOOK2); var response = this.restClient.Execute <List <SaleResponse> >(request); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.NotNull(response.Data); }
private string GetLastSaleDate(string shop, long isbn) { var request = SaleRequestHelper.GetBookSales(shop, isbn); var response = this.restClient.Execute <List <SaleResponse> >(request); var result = response.Data[0].Date.ToUniversalTime().ToString("o"); return(result); }