public void Get() { int validID = GetValidProductID(); var product = ProductEndpoints.GetProduct(validID).Result; Assert.IsTrue(product != null); }
private int GetValidProductID() { int validID = 0; for (int i = 1; i < 100; i++) { Product product = ProductEndpoints.GetProduct(i).Result; if (product != null && product.ID != 0) { validID = product.ID; break; } } return(validID); }
public async Task <IActionResult> Edit(int id) { var product = await ProductEndpoints.GetProduct(id); return(View(product)); }