public void GivenOwnerHasBakedProductThatAlreadyExists() { string jsonResponse = requestHelper.ExecutePostProductRequest("Bread", "3.45"); BakeryProduct bakeryProduct = DeserializeJSON_ToBakeryProduct.GetAddedBakeryProductFromPostRequest(jsonResponse); ScenarioContext.Current.Set(bakeryProduct.Id, "id"); }
public void GivenOwnerHasBakedNewProductWithoutNameAndPrice() { string jsonResponse = requestHelper.ExecutePostProductRequest(string.Empty, null); BakeryProduct bakeryProduct = DeserializeJSON_ToBakeryProduct.GetAddedBakeryProductFromPostRequest(jsonResponse); ScenarioContext.Current.Set(bakeryProduct.Id, "id"); }
public void ThenCustomerCanBuyNewProduct() { string jsonResponse = requestHelper.ExecuteGetSpecificProductRequest(ScenarioContext.Current["id"].ToString()); BakeryProduct bakeryProduct = DeserializeJSON_ToBakeryProduct.GetAddedBakeryProductFromGetSpecificOrNewestIdRequest(jsonResponse); Assert.AreEqual(ScenarioContext.Current["id"].ToString(), bakeryProduct.Id); }
public void GivenOwnerHasBakedNewProductThatCosts(string name, string price) { string jsonResponse = requestHelper.ExecutePostProductRequest(name, price); BakeryProduct bakeryProduct = DeserializeJSON_ToBakeryProduct.GetAddedBakeryProductFromPostRequest(jsonResponse); ScenarioContext.Current.Set(bakeryProduct.Id, "id"); }
public void WhenCustomerAsksForMostFreshBakeryGood() { string jsonResponse = requestHelper.Client.Execute(requestHelper.GetNewestProductRequest).Content; BakeryProduct bakeryProduct = DeserializeJSON_ToBakeryProduct.GetAddedBakeryProductFromGetSpecificOrNewestIdRequest(jsonResponse); ScenarioContext.Current.Set(bakeryProduct.Id, "id"); }
public void WhenCustomerAsksForAllBakeryGoods() { string jsonResponse = requestHelper.Client.Execute(requestHelper.GetProductsRequest).Content; List <BakeryProduct> bakeryProducts = DeserializeJSON_ToBakeryProduct.GetAddedBakeriesProductFromGetProductsRequest(jsonResponse); ScenarioContext.Current.Set(bakeryProducts, "bakeryProducts"); }
public void ThenBakeryGoodWithNameAndPriceIsVisibleIsVisible(string name, string price) { string jsonResponse = requestHelper.ExecuteGetSpecificProductRequest(ScenarioContext.Current["id"].ToString()); BakeryProduct bakeryProduct = DeserializeJSON_ToBakeryProduct.GetAddedBakeryProductFromGetSpecificOrNewestIdRequest(jsonResponse); Assert.AreEqual(ScenarioContext.Current["id"].ToString(), bakeryProduct.Id); Assert.AreEqual(name, bakeryProduct.Name); Assert.AreEqual(price, bakeryProduct.Price); }