public void UpdateShop_When_ShopUpdatedWithDifferentId_ReturnsBadRequest() { var ticks = DateTime.UtcNow.Ticks; var updatedShop = new ShopRequest { Id = EXISTING_SHOP + "test", Name = "Existing name", Description = ticks.ToString() }; var request = ShopRequestHelper.UpdateShop(EXISTING_SHOP, updatedShop); var response = this.restClient.Execute <ShopResponse>(request); Assert.AreEqual(HttpStatusCode.BadRequest, response.StatusCode); }
public void UpdateShop_When_ShopDoesNotExist_ReturnsNotFound() { var ticks = DateTime.UtcNow.Ticks; var updatedShop = new ShopRequest { Id = UNEXISTING_SHOP, Name = "Existing name", Description = ticks.ToString() }; var request = ShopRequestHelper.UpdateShop(UNEXISTING_SHOP, updatedShop); var response = this.restClient.Execute <ShopResponse>(request); Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode); }
public void UpdateShop_When_ShopUpdated_ReturnsOk() { var ticks = DateTime.UtcNow.Ticks; var updatedShop = new ShopRequest { Id = EXISTING_SHOP, Name = "Existing name", Description = ticks.ToString() }; var request = ShopRequestHelper.UpdateShop(EXISTING_SHOP, updatedShop); var response = this.restClient.Execute <ShopResponse>(request); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.NotNull(response.Data); Assert.AreEqual(updatedShop.Id, response.Data.Id); Assert.AreEqual(updatedShop.Name, response.Data.Name); Assert.AreEqual(updatedShop.Description, response.Data.Description); }